
C165UTAH
Watchdog Timer (WDT)
Data Sheet
432
2001-02-23
Note:
The WDTCON register bits [7, 6, 5] 4, 3, 2 and 1 are cleared by the EINIT
command.
After any software reset, external hardware reset, or watchdog timer reset, the watchdog
timer is enabled and starts counting up from 0000
H
with the frequency
f
CPU
/2. The input
frequency may be switched to
f
CPU
/128 by setting bit WDTIN. The watchdog timer can
be disabled via the instruction DISWDT (Disable Watchdog Timer). Instruction DISWDT
is a protected 32-bit instruction which will ONLY be executed during the time between a
reset and execution of either the EINIT (End of Initialization) or the SRVWDT (Service
Watchdog Timer) instruction. Either one of these instructions disables the execution of
DISWDT.
When the watchdog timer is not disabled via instruction DISWDT, it will continue
counting up, even during Idle Mode. If it is not serviced via the instruction SRVWDT by
the time the count reaches FFFF
H
the watchdog timer will overflow and cause an internal
reset. This reset will pull the external reset indication pin RSTOUT low. It differs from a
software or external hardware reset in that bit WDTR (Watchdog Timer Reset Indication
Flag) of register WDTCON will be set. A hardware reset or the SRVWDT instruction will
clear this bit. Bit WDTR can be examined by software in order to determine the cause of
the reset.
A watchdog reset will also complete a running external bus cycle before starting the
internal reset sequence if this bus cycle does not use READY or samples READY active
(low) after the programmed waitstates. Otherwise the external bus cycle will be aborted.
Note:
After a hardware reset that activates the Bootstrap Loader the watchdog timer will
be disabled.
To prevent the watchdog timer from overflowing, it must be serviced periodically by the
user software. The watchdog timer is serviced with the instruction SRVWDT, which is a
protected 32-bit instruction. Servicing the watchdog timer clears the low byte and reloads
the high byte of the watchdog timer register WDT with the preset value from bitfield
WDTREL which is the high byte of register WDTCON. Servicing the watchdog timer will
also reset bit WDTR. After being serviced the watchdog timer continues counting up from
the value (<WDTREL> * 2
8
). Instruction SRVWDT has been encoded in such a way that
the chance of unintentionally servicing the watchdog timer (eg. by fetching and executing
Table 101
WDTCON Register: Reset Source Identification
Type of Reset
WDTCON
Reset Value
WDTCON Flags being set
Hardware reset via pin RSTIN
001C
H
0004
H
0006
H
LHWR, SHWR, SWR
Software reset via command SRST
SWR
Watchdog Timer reset
SWR, WDTR