
Rev. 1.00
411 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
19 W
atchdog T
imer (WDT)
19 W
atchdog T
imer (WDT)
Features
▆
Clock source from either the internal 32 kHz RC oscillator (LSI) or the external 32,768 Hz
oscillator (LSE)
▆
Can be independently setup to keep running or to stop when entering the Sleep or Deep-Sleep1
mode
▆
12-bit down-counter with 3-bit prescaler structure
▆
Provides reset to the system
▆
Limited reload window setup function for custom Watchdog Timer reload times
▆
Watchdog Timer may be stopped when the processor is in the debug mode
▆
Reload lock key to prevent unexpected operation
▆
Configuration register write protection function for counter value, reset enable, delta value, and
prescaler value
Functional Description
The Watchdog Timer is formed from a 12-bit count-down counter and a fixed 3-bit prescaler. The
largest time-out period is 16 seconds, using the LSE or LSI clock and a 1/128 maximum prescaler
value.
The Watchdog Timer configuration setup includes programmable Counter-Reload value, reset
enable, window value and prescaler value. These configurations are set using the WDTMR0
and WDTMR1 registers which must be properly programmed before the Watchdog Timer starts
counting. In order to prevent unexpected write operations to those configurations, a register write
protection function can be enabled by writing any value, other than 0x35CA to PROTECT[15:0],
in the WDTPR register. A value of 0x35CA can be written to PROTECT[15:0] to disable the
register write protection function before accessing any configuration register. A read operation on
PROTECT[0] can obtain the enable/disable status of the register write protection function.
During normal operation, the Watchdog Timer counter should be reloaded before it underflows to
prevent the generation of a Watchdog reset. The 12-bit count-down counter can be reloaded with
the required Watchdog Timer Counter Value (WDTV) by first setting the WDTRS bit to 1 with the
correct key, which is 0x5FA0 in the WDTCR register.
If a software deadlock occurs during a Watchdog Timer reload routine, the reload operation will
still go ahead and therefore the software deadlock cannot be detected. To prevent this situation
from occurring, the reload operation must be executed in such a way that the value of the Watchdog
Timer counter is limited to within a delta value (WDTD). If the Watchdog Timer counter value is
greater than the delta value and a reload operation is executed, a Watchdog Timer error will occur.
The Watchdog Timer error will cause a Watchdog reset if the related functional control is enabled.
Additionally, the above features can be disabled by programming a WDTD value greater than or
equal to the WDTV value.
The WDTERR and WDTUF flags in the WDTSR register will be set respectively when the
Watchdog Timer error occurs or when a Watchdog Timer underflows. A system reset or writing “1”
operation on the WDTSR register will clear the WDTERR and WDTUF flags.
The Watchdog Timer uses two clocks: PCLK and CK_WDT. The PCLK clock is used for APB
access to the watchdog registers. The CK_WDT clock is used for the Watchdog Timer functionality
and counting. There is some synchronization logic between these two clock domains.