
ML674001 Series/ML675001 Series User’s Manual
Chapter 14
Watchdog Timer (WDT)
14-6
14.3
Description of Operation
The watchdog timer allows the programmer to detect when the program has run out of control by having counter
overflow generate an interrupt or system reset request.
If the design does not call for a watchdog timer, this timer is available for use as an interval timer.
14.3.1
Operation Modes
The ITM bit in the WDTBCON register specifies the operation mode: watchdog timer or interval timer.
The WDCLK[1:0] bits in the WDTBCON register specify the frequency divisor for deriving the operating
clock from CCLK.
14.3.2
Interval Timer Operation
Setting both the ITM and ITEN bits in the WDTBCON register to “1” produces interval timer operation.
Writing 0x3C to the WDTCON register then starts counting up from zero. Additional writes of the same
value reset the counter to zero. Failure to reset the counter in a timely fashion produces overflow and an
interrupt request.
This configuration does not generate system reset signals.
14.3.3
Watchdog Timer Operation
Setting the ITM bit in the WDTBCON register to “0” produces watchdog timer operation. Writing 0x3C to
the WDTCON register then starts counting up from zero. After that, alternately writing 0xC3 and 0x3C
resets the timer to zero. Failure to reset the counter in a timely fashion produces overflow and an interrupt
or system reset request.
In a typical application, timer overflow should be avoided entirely except as an indication that the program
has run out of control.
14.3.4
Starting Timer
Specifying the operation mode and other settings in the count operation (WDTBCON) register and then
writing 0x3C to the watchdog timer control (WDTCON) register starts counter operation. From that point
onward, the program must reset the counter to zero at regular intervals by writing to WDTCON: 0xC3 and
0x3C alternately for watchdog timer operation or just 0x3C for interval timer operation.
Failure to reset the counter in a timely fashion produces overflow and an interrupt or system reset request
as specified by the OFINTMODE bit in the WDTBCON register. Note, however, that interval timer
operation only produces interrupt requests.
Watchdog timer operation continues even after the CPU shifts to HALT mode. If this behavior is not
desirable, set the ITM and ITEN bits in the WDTBCON register to “1” and “0,” respectively, to switch to
interval timer operation and stop the counter. When the CPU leaves HALT mode, write “0” to the ITM bit
to resume watchdog timer operation and restart the counter.
STANDBY mode suspends watchdog timer operation.