English
Language : 

W78IRD2 Datasheet, PDF (44/76 Pages) Winbond – 8-BIT MICROCONTROLLER
W78IRD2
11. PROGRAMMABLE COUNTER ARRAY (PCA)
The PCA is a special 16-bit timer that has five 16-bit capture/compare modules associated with it. Each
module can be programmed to operate in one of four modes: rising and/or falling edge capture,
software timer, high-speed output, or pulse width modulator. Each module has a pin associated with it
in port 1. Module 0 is connected to p1.3 (CEX0), module 1 to p1.4 (CEX1), and so on.
Module0
P1.3/CEX0
Module1
P1.4/CEX1
PCA Timer/Counter
CH
CL
16-bit Up-Counter
time base for PCA modules
Module Functions:
16-bit Capture
16-bit Timer/Compare
16-bit High Speed Output
8-bit PWM
Watchdog Timer (Module 4 Only)
Module2
Module3
Module4
P1.5/CEX2
P1.6/CEX3
P1.7/CEX4
Figure 11-1 Programmable Counter Array (PCA)
Each module has a special function register CCAPMn, where n is the same number as the module
(CCAPM0 for module0, CCAPM1 for module1, etc.). CCAPMn contains the bits that control the mode
of each module.
CCAPMn: PCA module compare/capture register
CCAPM0(DAH) , CCAPM1(DBH) , CCAPM2(DCH) , CCAPM3(DDH), CCAPM4(DEH)
BIT
NAME
FUNCTION
7
-
Reserved
6
ECOMn Enable Comparator. ECOMn = 1 enables the comparator function
5
CAPPn Capture Positive. CAPPn = 1 enables positive-edge capture.
4
CAPNn Capture Negative. CAPNn = 1 enables negative-edge capture.
Match. When MATn = 1 a match of the PCA counter with this module’s
3
MATn
compare/capture register causes the CCFn bit in CCON to be set and, if
ECCFn is set, generating an interrupt.
2
TOGn
Toggle. When TOGn = 1 a match of the PCA counter with this module’s
compare/capture register causes the CEXn bit to toggle.
1
PWMn
Pulse Width Modulation Mode. PWMn = 1 enables the CEXn bit to be used
for pulse-width modulated output.
0
ECCFn
Enable CCF interrupt. Enables the compare/capture flag CCFn in the
CCON register to generate an interrupt.
- 44 -