AN201
Rev 1.5 | 68/91
www.cmostek.com
8 Watchdog Timer
16-bit
WDT
Module
32KHz
WDTEN
SWDTEN
0
1
From Timer0
Clock Source
P
S
A
WDTPS<3:0>
Prescaler
8bit
1
0
P
S
A
To Timer0
WDT
Time-out
Figure 22. Watchdog and Timer 0 Diagram
The watchdog's clock source is the internal slow clock (32 kHz), which is a 16-bit counter. It shares an 8-bit prescaler with Timer 0.
The enabled bit WDTEN is the 3rd bit of the configuration register UCFG0. When the WDTEN is 1, it enables the watchdog.
When it is 0, disable. It is determined by BOOT during the power-on process, or it can be written through the external serial port.
The CLRWDT instruction for clearing the watchdog and SLEEP instruction will clear the watchdog counter. In the case of
enabling the watchdog, the watchdog overflowing can be used as a wake-up source when the MCU is in the sleep state, and the
watchdog can be used as a reset source when the MCU operates in normal status.
Table 89. Watchdog Status
Condition
Watchdog Status
WDTEN and SWDTEN are 0 at the same time
Cleared
CLRWDT instruction
Enter the SLEEP, exit the SLEEP
Notes:
1.
If the internal slow clock switches from the 32 k to 256 k mode (or from the 256 k to 32 k mode), it does not affect the
watchdog timing, as WDT is fixed to use the 32 k clock source.