Watchdog Timer (WDT)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
243
12
Watchdog Timer (WDT)
12.1
Introduction
The Watchdog is used to detect the occurrence of a software fault, usually generated by external interference or by unforeseen logical
conditions, which causes the application program to abandon its normal sequence. The watchdog circuit generates a MCU reset or a WDG
interrupt on the expiry of a programmed time period, unless the program refreshes the contents of the watchdog timer counter before it’s
overflow.
When a MCU reset happens, the watchdog timer counter is always cleared and the watchdog is always disabled.
12.2
Features
Reset mode: The watchdog circuit generates a MCU reset on the expiry of a programmed time period, unless the program refreshes the
watchdog.
Interrupt mode: The watchdog circuit generates a WDG interrupt on the expiry of a programmed time period, unless the program
refreshes the watchdog.
Clock source: The watchdog is supported by 32.768kHz.
Timeout formula:
𝑇𝑖𝑚𝑒𝑜𝑢𝑡 =
1
32.768𝑘𝐻𝑧
𝐷𝑖𝑣𝐹𝑎𝑐𝑡𝑜𝑟 + 1
∗ 𝐶𝑜𝑢𝑛𝑡
12.3
Registers
The base address of WDT register is:
KM4: 0x4000_2800
KM0: 0x4800_2800
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
WDT_
TO
WDT_
MODE
RSVD
COUNTID
WDT_
CLEAR
RSVD
WDT_E
N_BIT
R/W1C
R/W
R/W
W
R/W
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
BIT_VNDR_DIVFACTOR
R/W
Bit
Name
Access
Reset
Description
31
WDT_TO
R/W1C
0
Watchdog timer timeout. 1 cycle pulse.
30
WDT_MODE
R/W
0
0: Interrupt CPU when WDT timer counter is overflow.
1: Reset system when WDT timer counter is overflow.
29
RSVD
N/A
0
Reserved
28:25
COUNTID
R/W
0
0: 0x001
1: 0x003
2: 0x007
3: 0x00F
4: 0x01F
5: 0x03F
6: 0x07F
7: 0x0FF
8: 0x1FF
9: 0x3FF
10: 0x7FF
11~15: 0xFFF
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03