
User’s Manual
8-4
05.99
Fail Safe Mechanisms
C513AO
8.1.1 Refreshing the Watchdog Timer
At the same time the Watchdog Timer is started, the 7-bit register WDTH is preset by the contents
of WDTREL.0 to WDTREL.6. Once started, the Watchdog Timer cannot be stopped by software.
However, it can be refreshed to the reload value only by first setting bit WDT (WDCON) and by the
next instruction setting SWDT (WDCON). Bit WDT will be cleared automatically during the third
machine cycle after having been set. This double-instruction refresh of the Watchdog Timer is
implemented to minimize the chance of an unintentional reset of the watchdog unit.
When the Watchdog Timer is started or refreshed, its lower eight bits, stored in WDTL are reset to
00H (see Figure 8-1).
The reload register, WDTREL, can be written at any time. Therefore, a periodic refresh of WDTREL
can be included in the starting procedure of the Watchdog Timer. Thus, a wrong reload value
caused by a possible distortion during the write operation to WDTREL can be corrected by software.
8.1.2 Watchdog Reset and Watchdog Status Flag (WDTS)
If the software fails to clear the watchdog in time, an internally generated watchdog reset is entered
at the counter state 7FFCH. The duration of the reset signal then depends on the prescaler
selection (either 8 or 128 cycles). Unlike an external reset, in an internal reset the Watchdog Timer
is not disabled and bit WDTS is set. The WDTS is a flip-flop which is set by a Watchdog Timer reset
and can be cleared by an external hardware reset. Bit WDTS allows the software to identify the
source from which the reset was activated. The bit WDTS can also be cleared by software.