GD32VF103 User Manual
203
Figure 13.1. Free watchdog block diagram
IRC40K
Reset
Prescaler
/4/8
…256
12-Bit
DownCounter
Reload
register
Control
register
Reload
Status: PUD
Status: RUD
The free watchdog is enabled by writing the value 0xCCCC in the control register
(FWDGT_CTL), and the counter starts counting down. When the counter reaches the value
0x000, a reset is generated.
The counter can be reloaded by writing the value 0xAAAA to the FWDGT_CTL register at
anytime. The reload value comes from the FWDGT_RLD register. The software can prevent
the watchdog reset by reloading the counter before the counter reaches the value 0x000.
The free watchdog can automatically start at power on when the hardware free watchdog bit
in the device option bytes is set. To avoid reset, the software should reload the counter before
the counter reaches 0x000.
The FWDGT_PSC register and the FWDGT_RLD register are write-protected. Before writing
these registers, the software should write the value 0x5555 to the FWDGT_CTL register.
These registers will be protected again by writing any other value to the FWDGT_CTL register.
When an update operation of the prescaler register (FWDGT_PSC) or the reload value
register (FWDGT_RLD) is on going, the status bits in the FWDGT_STAT register are set.
If the FWDGT_HOLD bit in DBG module is cleared, the FWDGT continues to work even the
RISC-V core halted (Debug mode). While the FWDGT stops in Debug mode if the
FWDGT_HOLD bit is set.
Table 13.1. Min/max FWDGT timeout period at 40 kHz (IRC40K)
Prescaler divider PSC[2:0] bits
Min timeout (ms)
RLD[11:0]=0x000
Max timeout (ms)
RLD[11:0]=0xFFF
1/4
000
0.1
409.6
1/8
001
0.2
819.2
1/16
010
0.4
1638.4
1/32
011
0.8
3276.8
1/64
100
1.6
6553.6
1/128
101
3.2
13107.2