CHAPTER 10 WATCHDOG TIMER FUNCTION
User’s Manual U15109EJ3V0UD
321
10.4 Operation
10.4.1 Operation as watchdog timer
Set bit 4 (WDTM4) of the watchdog timer mode register (WDTM) to 1 to operate as a watchdog timer to detect
inadvertent program looping.
Setting bit 7 (RUN) of WDTM to 1 starts the count. After counting starts, if RUN is set to 1 again within the set
time interval for loop detection, the watchdog timer is cleared and counting starts again.
If RUN is not set to 1 and the loop detection time has elapsed, a non-maskable interrupt (INTWDT) is generated
(no reset functions).
The watchdog timer stops running in the IDLE and STOP modes. Consequently, set RUN to 1 and clear the
watchdog timer before entering the IDLE or STOP mode. Do not set the watchdog timer when using the HALT mode
since the watchdog timer continues to operate in the HALT mode.
Cautions 1. The actual loop detection time may be up to 2
12
/f
XX
seconds shorter than the set time.
2.
When the subclock is selected for the CPU clock, the watchdog timer stops counting
(pauses).
Table 10-4. Loop Detection Time of Watchdog Timer
Loop Detection Time
Clock
f
XX
= 20 MHz
f
XX
= 18.87 MHz
f
XX
= 16 MHz
2
16
/f
XX
3.3 ms
3.5 ms
4.1 ms
2
17
/f
XX
6.6 ms
6.9 ms
8.2 ms
2
18
/f
XX
13.1 ms
13.9 ms
16.4 ms
2
19
/f
XX
26.2 ms
27.8 ms
32.8 ms
2
20
/f
XX
52.4 ms
55.6 ms
65.5 ms
2
21
/f
XX
104.9 ms
111.1 ms
131.1 ms
2
22
/f
XX
209.7 ms
222.3 ms
262.1 ms
2
24
/f
XX
838.9 ms
889.1 ms
1.05 s