APPLICATION
2.3 Timers
Activate Watchdog Timer
Watchdog timer is activated.
Watchdog timer enable flag WEF "1"
Main routine (every 20 ms)
Reset Flag WDF
Watchdog timer flag WDF1 is reset.
Do not clear watchdog timer WDF flag in interrupt service routine.
Interrupt may be executed even if program run-away occurs.
When going to RAM back-up mode
In the RAM back-up mode, WEF, WDF1 and WDF2 flags are initialized. However, when WDF2 flag is set to "1", at the
same time, system enters RAM back-up mode, microcomputer may be reset. When watchdog timer and RAM back-up
mode are used, execute the WRST instruction before system enters the RAM back-up mode to initialize WDF flag.
" ": it can be "0" or "1."
Fig. 2.3.9 Watchdog timer setting example
2-38
g0 h
Main routine execution
Repeat
•
•
• •
•
•
WRST
; WDF flag cleared
EPOF
; POF instruction enabled
POF
Oscillation stop (RAM back-up mode)
4513/4514 Group User's Manual
Watchdog timer enable flag WEF set
(WRST instruction)
Watchdog timer flag WDF1 cleared
"0"
(WRST instruction)