Independent watchdog (IWDG)
Min-max timeout value @41KHz (LSI): ~0.1ms / ~25.5s The IWDG timeout may vary due
to LSI frequency dispersion. STM32F30x devices provide the capability to measure the LSI
frequency (LSI clock connected internally to TIM16 CH1 input capture). The measured
value can be used to have an IWDG timeout with an acceptable accuracy. For more
information, please refer to the STM32F30x Reference manual.
14.2.2 How to use this driver
This driver allows to use IWDG peripheral with either window option enabled or disabled.
To do so follow one of the two procedures below.
1. Window option is enabled:
ï€ Start the IWDG using IWDG_Enable() function, when the IWDG is used in
software mode (no need to enable the LSI, it will be enabled by hardware).
ï€ Enable write access to IWDG_PR and IWDG_RLR registers using
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable) function.
ï€ Configure the IWDG prescaler using IWDG_SetPrescaler() function.
ï€ Configure the IWDG counter value using IWDG_SetReload() function. This value
will be loaded in the IWDG counter each time the counter is reloaded, then the
IWDG will start counting down from this value.
ï€ Wait for the IWDG registers to be updated using IWDG_GetFlagStatus()
function.
ï€ Configure the IWDG refresh window using IWDG_SetWindowValue() function.
2. Window option is disabled:
ï€ Enable write access to IWDG_PR and IWDG_RLR registers using
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable) function.
ï€ Configure the IWDG prescaler using IWDG_SetPrescaler() function.
ï€ Configure the IWDG counter value using IWDG_SetReload() function. This value
will be loaded in the IWDG counter each time the counter is reloaded, then the
IWDG will start counting down from this value.
ï€ Wait for the IWDG registers to be updated using IWDG_GetFlagStatus()
function.
ï€ reload the IWDG counter at regular intervals during normal operation to prevent
an MCU reset, using IWDG_ReloadCounter() function.
ï€ Start the IWDG using IWDG_Enable() function, when the IWDG is used in
software mode (no need to enable the LSI, it will be enabled by hardware).
14.2.3 Prescaler and Counter configuration functions
ï‚· IWDG_WriteAccessCmd()
ï‚· IWDG_SetPrescaler()
ï‚· IWDG_SetReload()
ï‚· IWDG_ReloadCounter()
ï‚· IWDG_SetWindowValue()
14.2.4 IWDG activation function
ï‚· IWDG_Enable()
14.2.5 Flag management function