436
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Window watchdog (WWDG)
Introduction
The clock of the window watchdog (WWDG) is obtained by dividing the APB1 clock frequency by 4096, and
whether the program operation is abnormal is detected through the configuration of the time window. Therefore,
WWDG is suitable for precise timing, and is often used to monitor software failures caused by external disturbances
or unforeseen logic conditions that cause an application to deviate from its normal operating sequence. A system reset
occurs when the WWDG down counter is refreshed before reaching the window register value or after the
WWDG_CTRL.T6 bit becomes 0.
Main features
7-bit independent running down counter programmable
After WWDG is enabled, a reset occurs under the following conditions
The value of the decremented counter is less than 0x40.
When the decremented counter value is greater than the value of the window register, it is reloaded.
Early wake-up interrupt: If the watchdog is started and the interrupt is enabled, wake-up interrupt
(WWDG_CFG.EWINT) will be generated when the count value reaches 0x40.
Function description
If the watchdog is activated (the WWDG_CTRL.ACTB bit), when the 7-bit (WWDG_CTRL.T[6:0]) down-counter
reaches 0x3F(WWDG_CTRL.T6 bit is cleared), or the software reloads the counter when the counter value is greater
than the value of the window register, a system reset will be generated. In order to avoid system reset, the software
must periodically refresh the counter value in the window during normal operation.
Figure 17-1 Watchdog block diagram
Set the WWDG_CTRL.ACTB bit to enable the watchdog, and thereafter, the WWDG will remain on until reset
occurs. The 7-bit down-counter runs independently, and the counter keeps counting down whether WWDG is enabled
or not. Therefore, before enabling the watchdog, you need to set WWDG_CTRL.T [6] bit to 1, preventing reset right
after enable. The pre-scaler value set by the clock APB1 and WWDG_CFG.TIMERB[1:0] bits determine the
WWDG Control Register (WWDG_CTRL)
T[6:0] 7-bit Down-counter value
WWDG Config Register (WWDG_CFG)
W[7:0] 7-bit window value
C
O
M
P
T[6:0] > W[6:0]
Comparing results = 1
Write WWDG_CTRL
WWDG_CTRL.T6
WWDG_CTRL.ACTB = 1
WWDG_CFG.TIMERB[1:0]
1/2/4/8
PCLK1
Reset