Application – Renesas 4514 User Manual
Page 141
APPLICATION
2.3 Timers
2-38
4513/4514 Group User’s Manual
Fig. 2.3.9 Watchdog timer setting example
g0 h
•
•
•
••
•
➀
Activate Watchdog Timer
Watchdog timer is activated.
Watchdog timer enable flag WEF “1”
Watchdog timer enable flag WEF set
(WRST instruction)
Main routine (every 20 ms)
Reset Flag WDF
Watchdog timer flag WDF1 is reset.
“0”
Watchdog timer flag WDF1 cleared
(WRST instruction)
Main routine execution
Repeat
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
WRST
; WDF flag cleared
EPOF ;
POF instruction enabled
POF
↓
Oscillation stop (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.”