AT89C5115
16-bit Software Timer
Mode
The PCA modules can be used as software timers by setting both the ECOM and MAT
bits in the modules CCAPMn register. The PCA timer will be compared to the module’s
capture registers and when a match occurs an interrupt will occur if the CCFn (CCON
SFR) and the ECCFn (CCAPMn SFR) bits for the module are both set.
Figure 35. PCA 16-bit Software Timer and High Speed Output Mode
PCA Counter
Compare/Capture Module
CH
CL
CCAPnL
(8 bits)
CCAPnH
(8 bits)
(8 bits) (8 bits)
Toggle
Match
16-bit Comparator
Enable
CEXn
PCA
Interrupt
Request
CCFn
CCON reg
ECOMn0 0MATn TOGn0 ECCFn
0
7
CCAPMn Register
(n = 0, 1)
“0”
Reset
Write to
For software Timer mode, set ECOMn and MATn.
For high speed output mode, set ECOMn, MATn and TOGn.
“1”
CCAPnL
Write to CCAPnH
75
4128F–8051–05/06