User Manual
74
T89C51AC2
Rev. B – 19-Dec-01
Figure 35. PCA PWM Mode
15.8 PCA Watchdog
Timer
An on-board watchdog timer is available with the PCA to improve system reliability with-
out increasing chip coun t. Watchdog timers are usefu l for s y stem s that are s ens itive to
noise, power glitches, or electrostatic discharge . Module 4 is the only PCA m odule that
can be programmed as a watc hdog. However, this module can still be used for other
modes if the w atchdog is not need ed. The user pre-loads a 16-bit value in the c ompare
regist ers . Just like t he o th er com pare modes, this 16-bit value is compa r ed to t he PCA
timer va lue. If a match is allowed to occ ur, an internal res et will be gene rat ed. Th is will
not cause the RST pin to be driven high.
To hold off the reset, th e user has three options:
• 1. periodically c hange the compare value so it will never match the PCA t imer,
• 2. periodically change the PCA timer value so i t will nev er m atch the compare
values, or
• 3. disable the watchdog by clearing the WDTE bit bef ore a match oc c urs and then
re-enable it.
The first two options are mo re reliable because the watchdo g timer is never disabl ed as
in option #3. I f the program counter ever goes astray, a match will eventually occur and
cause a n internal reset. If other PC A modules are being used the second option no t rec-
ommended either. Re mem ber, the PCA t im er is the tim e base for all modules; changing
the time base for other modules would not be a good idea. Thus, in most applications
the first s olution is the best option.
CL rolls over from FFh TO 00h load s
CCAPnH contents i nto CCAPnL
CCAPnL
CCAPnH
8-Bit
Comparator
CL (8 bits)
“0”
“1”
CL < CCA PnL
CL >= CCAPn L
CEX
PWMn
CCAPMn.1
ECOMn
CCAPMn.6










