Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
347
/
631
become write protected again.
Debugging mode
In debug mode (Cortex-M4 core stops), IWDG counter will either continue to work normally or stops, depending on
DBG_CTRL.IWDG_STOP bit in debug module. If this bit is set to ‘1’, the counter stops. The counter works normally
when the bit is ‘0’. See the chapter on debugging module for details 27.3.2.
User interface
IWDG module user interface contains 4 registers: Key Register (IWDG_KEY), Pre-scale Register (IWDG_PREDIV),
Reload Register (IWDG_RELV) and Status Register (IWDG_STS).
Operate flow
When IWDG is enable from reset from software (write 0xAAAA to IWDG_KEY.KEYV[15:0] bits) or hardware
(clear WDG_SW bit). It starts counting down from 0xFFF. Down counting gap is determined by pre-scale LSI clock.
Once the counter is reloaded, each new round will start from the value in IWDG_RELV.REL[11:0] instead of 0xFFF.
When program is running normally, software needs to feed IWDG before counter reaches 0 and start a new round of
down counting. When counter reach 0, this indicates program malfunction. IWDG generates reset signal under this
circumstance.
If user wants to configure IWDG pre-scale and reload value register, it needs to write 0x5555 to
IWDG_KEY.KEYV[15:0] first. Then confirm IWDG_STS.CRVU bit and IWDG_STS.PVU bit. IWDG_STS.CRVU
bit indicates reload value update is ongoing, IWDG_STS.PVU indicates Pre-scale divider ratio is updating. Only
when those two bit are 0 then user can update corresponding value. When update is on-going, hardware sets
corresponding bit to 1. At this time, reading IWDG_PREDIV.PD[2:0] or IWDG_RELV.REL[11:0] is invalid since
data needs sync to LSI clock domain. The value read from IWDG_PREDIV.PD[2:0] or IWDG_RELV.REL[11:0]
will be valid after hardware clears the IWDG_STS.PVU bit or IWDG_STS.CRVU bit.
If the application uses more than one reload value or pre-scaler value, it must wait until the IWDG_STS.CRVU bit
is reset before changing the reload value, the same as changing the pre-scaler value. However, after updating the pre-
scale and/or the reload value, it is not necessary to wait until IWDG_STS.CRVU bit or IWDG_STS.PVU bit are reset
before continuing code execution (even in case of low-power mode entry, the write operation is taken into account
and will complete).
Pre-scale register and reload register controls the time that generates reset, as shown in Table 15-1.
Table 15-1 IWDG counting maximum and minimum reset time
Pre-scale factor
PD[2:0]
Minimum
(
ms
)
RL[11:0]=0
Maximum
(
ms
)
RL[11:0]=0xFFF
/4
000
0.1
409.6
/8
001
0.2
819.2