Window Option - ST STM32L4x6 Reference Manual

Table of Contents

Advertisement

Independent watchdog (IWDG)
When the independent watchdog is started by writing the value 0x0000 CCCC in the Key
register (IWDG_KR), the counter starts counting down from the reset value of 0xFFF. When
it reaches the end of count value (0x000) a reset signal is generated (IWDG reset).
Whenever the key value 0x0000 AAAA is written in the IWDG_KR register, the IWDG_RLR
value is reloaded in the counter and the watchdog reset is prevented.
32.3.2

Window option

The IWDG can also work as a window watchdog by setting the appropriate window in the
IWDG_WINR register.
If the reload operation is performed while the counter is greater than the value stored in the
window register (IWDG_WINR), then a reset is provided.
The default value of the IWDG_WINR is 0x0000 0FFF, so if it is not updated, the window
option is disabled.
As soon as the window value is changed, a reload operation is performed in order to reset
the downcounter to the IWDG_RLR value and ease the cycle number calculation to
generate the next reload.
Configuring the IWDG when the window option is enabled
1.
Enable the IWDG by writing 0x0000 CCCC in the IWDG_KR register.
2.
Enable register access by writing 0x0000 5555 in the IWDG_KR register.
3.
Write the IWDG prescaler by programming IWDG_PR from 0 to 7.
4.
Write the reload register (IWDG_RLR).
5.
Wait for the registers to be updated (IWDG_SR = 0x0000 0000).
6.
Write to the window register IWDG_WINR. This automatically refreshes the counter
value IWDG_RLR.
Note:
Writing the window value allows to refresh the Counter value by the RLR when IWDG_SR is
set to 0x0000 0000.
Configuring the IWDG when the window option is disabled
When the window option it is not used, the IWDG can be configured as follows:
1.
Enable the IWDG by writing 0x0000 CCCC in the IWDG_KR register.
2.
Enable register access by writing 0x0000 5555 in the IWDG_KR register.
3.
Write the IWDG prescaler by programming IWDG_PR from 0 to 7.
4.
Write the reload register (IWDG_RLR).
5.
Wait for the registers to be updated (IWDG_SR = 0x0000 0000).
6.
Refresh the counter value with IWDG_RLR (IWDG_KR = 0x0000 AAAA)
32.3.3
Hardware watchdog
If the "Hardware watchdog" feature is enabled through the device option bits, the watchdog
is automatically enabled at power-on, and generates a reset unless the Key register is
written by the software before the counter reaches end of count or if the downcounter is
reloaded inside the window.
1048/1693
DocID024597 Rev 3
RM0351

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32L4x6 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF