www.geehy.com Page 220
19.2.3.5
Hardware watchdog
After the "hardware watchdog" function is enabled, and the system is powered
on and reset, the watchdog will run automatically. If 0xAAAA is not written to the
key register, reset will be generated after the counter finishes counting.
19.2.3.6
Debug mode
The independent watchdog can be configured in debug mode and choose to
stop or continue to work. It depends on the IWDT_STS bit of DBGMCU_APB1F
register in DBGMCU module.
19.3
Window Watchdog
Introduction
The window watchdog contains a 7-bit free-running down counter, prescaler and
control register WWDT_CTRL, configuration register WWDT_CFG and state
register WWDT_STS.
The window watchdog clock comes from PCLK, and the counter clock is
obtained from the CK counter clock through frequency division by prescaler
(configured by the configuration register).
The window watchdog is applicable when precise timing is needed.
Structure Block Diagram
Figure 90 Window Watchdog Structure Block Diagram
Down counter CNT
Configuration
register CFG
/4096
CNT>CFG
Write WWDT-CTRL
Reset
CNTT6-bit clear
PCLK1
PCLK1 from RCM
clock controller
/1
/2
/4
/8
TBPSC
Functional Description
Enable window watchdog timer; the reset conditions are:
When the counter count is less than 0x40, a reset will be generated.
The reload counter will be reset before the counter counts to the value
of the window register.
After reset, the watchdog is always closed and the watchdog can be enabled
only by setting the WWDTEN bit of WWDT_CTRL register.
The counter of window watchdog is in free state. When the watchdog is disabled,
the counter will continue to count down. The counter must be reloaded between
the value of window register and 0x40 to avoid reset.
Setting the EWIEN bit of the configuration register can enable the early wake-up
interrupt. When the count reaches 0x40, the interrupt will be generated. Entering
the interrupt service program (ISTS) can be used to prevent the window
watchdog from resetting. EWIEN interrupt can be cleared by writing 0 in the state
register.
The unique window of the window watchdog timer can effectively monitor
whether the program is faulty. For example, assuming that the running time of a