17 WATCHDOG TIMER (WDT)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
17-3
Starting/Stopping the Watchdog Timer
17.4.2
Writing 1 to RUNSTP/WD_EN register starts counting by the watchdog timer; writing 0 stops the watchdog timer.
Since RUNSTP exists in the write-protected WD_EN register, write protection must be removed by writing 0x96 to
WDPTC[15:0]/WD_PROTECT register before the content of RUNSTP can be altered.
Resetting the Watchdog Timer
17.4.3
Before the NMI/reset generation function of the watchdog timer can be used, a routine to reset the watchdog timer
before NMI or reset generation must be prepared in a location for periodic processing. Make sure that this routine
is processed within the NMI/reset generation cycle described earlier.
Writing 1 to WDRESEN/WD_CTL register resets the watchdog timer. The up-counter is reset to 0 at this time, then
starts counting NMI/reset generation cycles all over again.
If the watchdog timer is not reset within the set cycle for some reason, the CPU is placed into trap handling by an
NMI or reset signal to execute the processing routine.
The count value of the up-counter can be read out from CTRDT[29:0]/WD_CNT_L/H registers at any time.
Operation in Standby Mode
17.4.4
In HALT mode
In HALT mode, the watchdog timer remains active as it is supplied with a clock. Therefore, if HALT mode re-
mains active beyond the NMI/reset generation cycle, an NMI or reset signal deactivates HALT mode.
To disable the watchdog timer in HALT mode, set NMIEN/WD_EN register or RESEN/WD_EN register to 0.
Otherwise, write 0 to RUNSTP/WD_EN register to stop the watchdog timer before executing the halt instruc-
tion. When NMIEN or RESEN disables NMI or reset generation, the watchdog timer continues counting even
in HALT mode. To reenable NMI or reset generation after exiting HALT mode, be sure to reset the watchdog
timer beforehand. When HALT mode is entered after stopping the watchdog timer, be sure to reset the watch-
dog timer before restarting it.
In SLEEP mode
The supply of PCLK2 from the CMU stops in SLEEP mode. Therefore, the watchdog timer also stops operat-
ing. To prevent an unnecessary NMI or reset signal from being generated after exiting SLEEP mode, be sure to
reset the watchdog timer before executing the slp instruction. Moreover, disable NMI/reset generation by set-
ting NMIEN/WD_EN register or RESEN/WD_EN register as required.
Clock Output of the Watchdog Timer
17.4.5
The watchdog timer can output an NMI/reset generation cycle-synchronous clock from the IC to external devices.
For this clock output, set CLKEN/WD_EN register to 1 after setting up the WDT_CLK pin.
Since CLKEN also exists in the write-protected WDT_EN register, write protection must be removed by writing
0x96 to WDPTC[15:0]/WD_PROTECT register before the content of CLKEN can be altered.
If the watchdog timer is not reset in software, the level of clock output from the IC is reversed synchronously with
the NMI generation cycles. (This applies when reset generation is disabled.)
When the watchdog timer is reset in software, clock output from the IC goes low at that time and remains low.
Input clock
Counter data
Comparison data
Comparison match signal
WDT_CLK output clock
FFFF1D FFFF1E FFFF1F FFFF20
FFFF20
0
1
2
FFFF1F FFFF20
0
1
2
4.5.1 Clock Output of Watchdog Timer
Figure 17.