Hardware Watchdog; Register Access Protection; Debug Mode - STMicroelectronics STM32F05 series Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Independent watchdog (IWDG)
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 to
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 register access by writing 0x0000 5555 in the IWDG_KR register.
2.
Write the IWDG prescaler by programming IWDG_PR from 0 to 7.
3.
Write the reload register (IWDG_RLR).
4.
Wait for the registers to be updated (IWDG_SR = 0x0000 0000).
5.
Refresh the counter value with IWDG_RLR (IWDG_KR = 0x0000 AAAA).
6.
Enable the IWDG by writing 0x0000 CCCC in the IWDG_KR.
21.3.2

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.
21.3.3

Register access protection

Write access to the IWDG_PR, IWDG_RLR and IWDG_WINR registers is protected. To
modify them, you must first write the code 0x0000 5555 in the IWDG_KR register. A write
access to this register with a different value will break the sequence and register access will
be protected again. This implies that it is the case of the reload operation
(writing 0x0000 AAAA).
A status register is available to indicate that an update of the prescaler or the down-counter
reload value or the window value is on going.
21.3.4

Debug mode

When the microcontroller enters debug mode (core halted), the IWDG counter either
continues to work normally or stops, depending on DBG_IWDG_STOP configuration bit in
DBG module.
454/742
Doc ID 018940 Rev 1
RM0091

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents