![Seiko Epson S1C17153 Technical Manual Download Page 105](http://html1.mh-extra.com/html/seiko-epson/s1c17153/s1c17153_technical-manual_1235939105.webp)
13 WaTChDOG TiMeR (WDT)
13-2
Seiko epson Corporation
S1C17153 TeChniCal Manual
(Rev. 1.0)
WDT Run/Stop Control
13.3.2
WDT starts counting when a value other than 0b1010 is written to WDTRUN[3:0]/WDT_CTL register and stops
when 0b1010 is written.
At initial reset, WDTRUN[3:0] is set to 0b1010 to stop the watchdog timer.
Since an NMI or reset may be generated immediately after running depending on the counter value, WDT should
also be reset concurrently (before running the watchdog timer), as explained in the following section.
WDT Reset
13.3.3
To reset WDT, write 1 to WDTRST/WDT_CTL register.
A location should be provided for periodically processing the routine for resetting WDT before an NMI or reset is
generated when using WDT. Process this routine within 131,072/f
OSC1A
second (4 seconds when f
OSC1A
= 32.768
kHz) cycle.
After resetting, WDT starts counting with a new NMI/Reset generation cycle.
If WDT is not reset within the NMI/Reset generation cycle for any reason, the CPU is switched to interrupt pro-
cessing by NMI or reset, the interrupt vector is read out, and the interrupt handler routine is executed. The reset and
NMI vector addresses are TTBR + 0x0 and TTBR + 0x08.
If the counter overflows and generates an NMI without WDT being reset, WDTST/WDT_ST register is set to 1.
This bit is provided to confirm that WDT was the source of the NMI. The WDTST set to 1 is cleared to 0 by reset-
ting WDT.
Operations in halT and SleeP Modes
13.3.4
halT mode
The WDT module operates in HALT mode, as the clock is supplied. HALT mode is therefore cleared by an NMI or
reset if it continues for more than the NMI/reset generation cycle. To disable WDT while in HALT mode, stop WDT
by writing 0b1010 to WDTRUN[3:0]/WDT_CTL register before executing the
halt
instruction. Reset WDT before
resuming operations after HALT mode is cleared.
SleeP mode
The clock supplied from the CLG module is stopped in SLEEP mode, which also stops WDT. To prevent generation
of an unnecessary NMI or reset after clearing SLEEP mode, reset WDT before executing the
slp
instruction. WDT
should also be stopped as required using WDTRUN[3:0].
Control Register Details
13.4
Table 13.4.1 List of WDT Registers
address
Register name
Function
0x5040
WDT_CTL
Watchdog Timer Control Register
Resets and starts/stops the timer.
0x5041
WDT_ST
Watchdog Timer Status Register
Sets the timer mode and indicates NMI status.
The WDT registers are described in detail below.
note
: When data is written to the registers, the “Reserved” bits must always be written as 0 and not 1.
Watchdog Timer Control Register (WDT_CTl)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
Watchdog
Timer Control
Register
(WDT_CTl)
0x5040
(8 bits)
D7–5
–
reserved
–
–
–
0 when being read.
D4
WDTRST
Watchdog timer reset
1 Reset
0 Ignored
0
W
D3–0
WDTRun[3:0]
Watchdog timer run/stop control
Other than 1010
Run
1010
Stop
1010 R/W
D[7:5]
Reserved