AT32F421
Series Reference Manual
2022.11.11
Page 287
Rev 2.02
15
Window watchdog timer (WWDT)
15.1 WWDT introduction
The window watchdog downcounter must be reloaded in a limited time window to prevent the watchdog
circuits from generating a system reset. The window watch dog is used to detect the occurrence of
system malfunctions.
The window watchdog timer is clocked by a divided APB1_CLK. The precision of the APB1_CLK enables
the window watchdog to take accurate control of the limited window.
15.2 WWDT main features
7-bit downcounter
If the watchdog is enabled, a system reset is generated when the value of the downcounter is less
than 0x40 or when the downcounter is reloaded outside the window.
The downcounter can be reloaded by enabling the counter interrupt.
15.3 WWDT functional overview
When the watchdog is enabled, a system reset is generated at the following conditions:
When the 7-bit downcounter scrolls from 0x40 to 0x3F;
When the counter is reloaded while the 7-bit downcounter is greater than the value programmed in the
window register.
Figure 15-1 Window watchdog block diagram
EN
7-bit window value,WIN[6:0]
Prescaler(1/2/4/8)
7-bit counter,CNT[6:0]
PCLK/4096
CNT<0x40
reset
reload at CNT>WIN
reset
To prevent system reset, the counter must be reloaded only when its value is less than the value stored
in the window register and greater than 0x40.
The WWDT counter is clocked by a divided APB1_CLK, with the division factor being defined by the
DIV[1: 0] bit in the WWDT_CFG register. The counter value determines the maximum counter period
before the watchdog generates a reset. The WIN[6: 0] bit can be used to configure the window value.
WWDT offers reload counter interrupt feature. If enabled, the WWDT will set the RLDF flag when the
counter value reaches 0x40h, and an interrupt is generated accordingly. The interrupt service routine
(ISTS) can be used to reload the counter to prevent a system reset. Note that if CNT[6]=0, setting the
WWDTEN bit will generate a system reset, so the CNT[6] bit must be always set (CNT[6]=1) while writing
to the WWDT_CTRL register to prevent the occurrence of an immediate reset once the window watchdog
is enabled.
The formula to calculate the window watchdog time out:
T
WWDT
= T
PCLK1
× 4096 × 2
DIV[1:0]
× (CNT[5: 0] + 1); (ms)
Where: T
PCLK1
refers to APB1 clock period, in ms.