User Manual
72
T89C51AC2
Rev. B – 19-Dec-01
Figure 32. PC A C apture Mode
15.5 16-bit Software
Timer Mode
The PCA modules can be used as s of tware timers by setting both the ECOM and MAT
bits in the modules CCAPM n register. Th e PCA timer will be c ompared to the m odule’s
ca pt ure r egist ers an d whe n a mat c h o c curs an in t errupt wil l occ ur if the C CFn (CCON
SFR) and the ECCFn (CCAPMn SFR) b its for t he module are both set.
Figure 33. PCA 16-bit S of tware Timer and High Speed Output Mode
CEXn
n=0,4
PCA Counter
CH
(8bits)
CL
(8bit s)
CCAPnH
CCAPnL
CCFn
CCON
PCA
Interrupt
Request
- 0CAPPnCAPNn000E CCFn
7
CCAPMn Regist er (n = 0, 4)
0
CCAPnL
(8 bits)
CCAPnH
- ECOMn0 0 MATn TOGn0 ECCFn
70
CCAPMn Register
(n = 0, 4)
CH
(8 bits)
CL
(8 bits)
16-Bit Com-
parator
Match
Enable
CCFn
CCON reg
PCA
Interrupt
Request
CEXn
Compare/Capture Module
PCA Counter
“0”
“1”
Reset
Write to
CCAPnL
WritetoCCAPnH
For software Timer mode, set ECOMn and MATn.
For high speed output mode , set ECOMn, MATn and TOGn.
Toggle










