English
Language : 

AT80C5112_14 Datasheet, PDF (59/97 Pages) ATMEL Corporation – Hardware Watchdog Timer with Reset-out
16-bit Software Timer/
Compare 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 (See Figure 22).
Figure 4. PCA Compare Mode and PCA Watchdog Timer
Write to
CCAPnL Reset
CF CR
Write to
CCAPnH
CCAPnH
CCAPnL
CCON
CCF4 CCF3 CCF2 CCF1 CCF0 0xD8
PCA IT
1
0
Enable
16-bit Comparator
Match
CH
CL
PCA Counter/Timer
RESET (1)
CCAPMn, n = 0 to 4
ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn
0xDA to 0xDE
Note: 1. Only for Module 4
CIDL WDTE
CPS1 CPS0 ECF CMOD
0xD9
Before enabling ECOM bit, CCAPnL and CCAPnH should be set with a non zero value,
otherwise an unwanted match could occur. Writing to CCAPnH will set the ECOM bit.
Once ECOM is set, writing CCAPnL will clear ECOM so that an unwanted match doesn’t
occur while modifying the compare value. Writing to CCAPnH will set ECOM. For this
reason, user software should write CCAPnL first, and then CCAPnH. Of course, the
ECOM bit can still be controlled by accessing to CCAPMn register.
51 AT8xC5112
4191C–8051–02/08