7 WATCHDOG TIMER (WDT)
S1C17F13 TeChniCal Manual
Seiko epson Corporation
7-1
(Rev. 1.0)
Watchdog Timer (WDT)
7
Overview
7.1
WDT restarts the system if a problem occurs, such as when the program cannot be executed normally.
The features of WDT are listed below.
• Includes a 10-bit up counter to count NMI/reset generation cycle.
• A counter clock source and clock division ratio are selectable.
• Counter overflow generates a reset or NMI.
Figure 7.1.1 shows the configuration of WDT.
WDT
CLK_WDT
NMI
Reset
request
10-bit counter
STATNMI
NMIXRST
Clock generator
Inter
nal data
bu
s
WDTCNTRST
WDTRUN[3:0]
CLKSRC[1:0]
CLKDIV[1:0]
DBRUN
1.1 WDT Configuration
Figure 7.
Clock Settings
7.2
WDT Operating Clock
7.2.1
When using WDT, the WDT operating clock CLK_WDT must be supplied to WDT from the clock generator.
The CLK_WDT supply should be controlled as in the procedure shown below.
1. Write 0x0096 to the MSCPROT.PROT[15:0] bits. (Remove system protection)
2. Enable the clock source in the clock generator if it is stopped (refer to “Clock Generator” in the “Power Supply,
Reset, and Clocks” chapter).
3. Set the following WDTCLK register bits:
WDTCLK.CLKSRC[1:0] bits
(Clock source selection)
WDTCLK.CLKDIV[1:0] bits
(Clock division ratio selection = Clock frequency setting)
4. Write a value other than 0x0096 to the MSCPROT.PROT[15:0] bits. (Set system protection)
Use the following equation to calculate the WDT counter overflow cycle (NMI/reset generation cycle).
1,024
t
WDT
= ——————
(Eq. 7.1)
CLK_WDT
Where
t
WDT
:
Counter overflow cycle [second]
CLK_WDT: WDT operating clock frequency [Hz]
Example)
t
WDT
= 4 seconds when CLK_WDT = 256 Hz