
iVPeRiPheRaLMoDuLes2(tiMeRs):WatChDogtiMeR(WDt)
s1C33L17teChniCaLManuaL
ePson
iV-2-5
IV
WDT
Writeprotectionofwatchdogtimerregisters
The Watchdog Timer Enable Register (0x300662) and Watchdog Timer Comparison Data Registers (0x300664,
0x300666) are write-protected to prevent NMI or reset signals from being inadvertently generated by unnec-
essary write operations. To rewrite these registers, write protection must be removed by writing 0x96 to the
Watchdog Timer Write-Protect Register (0x300660). Once the registers are rewritten, be sure to write other than
0x96 to the Watchdog Timer Write-Protect Register (0x300660) to reapply write protection.
iV.2.4.2starting/stoppingtheWatchdogtimer
Writing 1 to RUNSTP (D4/0x300662) starts counting by the watchdog timer; writing 0 stops the watchdog timer.
RunstP:WatchdogTimerRun/StopControlBitintheWatchdogTimerEnableRegister(D4/0x300662)
Since RUNSTP (D4/0x300662) exists in the write-protected Watchdog Timer Enable Register (0x300662), write
protection must be removed by writing 0x96 to the Watchdog Timer Write-Protect Register (0x300660) before the
content of RUNSTP can be altered.
iV.2.4.3ResettingtheWatchdogtimer
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 (D0/0x30066C) resets the watchdog timer. The up-counter is reset to 0 at this time, then
starts counting NMI/reset generation cycles all over again.
WDResen:WatchdogTimerResetBitintheWatchdogTimerControlRegister(D0/0x30066C)
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 reset and NMI trap vector addresses are set by default to 0xC00000 and 0xC0001C, respectively. The trap table
base address can be altered by using TTBR.
The count value of the up-counter can be read out from the Watchdog Timer Count Registers (0x300668,
0x30066A) at any time.
CtRDt[15:0]:16Low-orderCounterDataBitsintheWatchdogTimerCountRegister0(D[15:0]/0x300668)
CtRDt[29:16]:14High-orderCounterDataBitsintheWatchdogTimerCountRegister1(D[13:0]/0x30066A)
iV.2.4.4operationinstandbyMode
inhaLtmode
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 (D1/0x300662) or RESEN (D0/0x300662) to 0.
Otherwise, write 0 to RUNSTP (D4/0x300662) to stop the watchdog timer before executing the halt instruction.
When NMIEN (D1/0x300662) or RESEN (D0/0x300662) 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 watchdog timer before re-
starting it.
insLeePmode
The supply of MCLK 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 (D1/0x300662) or RESEN (D0/0x300662) as required.