14.3.1 Clock Source
Three clock sources are available for use with the watchdog, through the CLKSEL field in WDOGn_CTRL. The corresponding clocks
must be enabled in the CMU. The SWOSCBLOCK bit in WDOGn_CTRL can be written to prevent accidental disabling of the selected
clocks. Also, setting this bit will automatically start the selected oscillator source when the watchdog is enabled. The PERSEL field in
WDOGn_CTRL is used to divide the selected watchdog clock, and the timeout for the watchdog timer can be calculated with the formu-
la:
T
TIMEOUT
= (2
3+PERSEL
+ 1) / f
where f is the frequency of the selected clock.
When the watchdog is enabled, it is recommended to clear the watchdog before changing PERSEL.
To use this module, the LE interface clock must be enabled in CMU_HFBUSCLKEN0.
14.3.2 Debug Functionality
The watchdog timer can either keep running or be frozen when the device is halted by a debugger. This configuration is done through
the DEBUGRUN bit in WDOGn_CTRL. When code execution is resumed, the watchdog will continue counting where it left off.
14.3.3 Energy Mode Handling
The watchdog timer can be configured to either keep on running or freeze when entering EM2 Deep Sleep or EM3 Stop. The configura-
tion is done individually for each energy mode in the EM2RUN and EM3RUN bits in WDOGn_CTRL. When the watchdog has been
frozen and is re-entering an energy mode where it is running, the watchdog timer will continue counting where it left off. For the watch-
dog there is no difference between EM0 Active and EM1 Sleep. The watchdog does not run in EM4 Hibernate/Shutoff. If EM4BLOCK in
WDOGn_CTRL is set, the CPU will be prevented from entering EM4 Hibernate/Shutoff by software request.
Note:
If the WDOG is clocked by the LFXO or LFRCO, writing the SWOSCBLOCK bit will prevent the CPU from entering EM3 Stop. When
running from the ULFRCO, writing the SWOSCBLOCK bit will prevent the CPU from entering EM4 Hibernate/Shutoff.
14.3.4 Register Access
Since this module is a Low Energy Peripheral, and runs off a clock which is asynchronous to the HFCORECLK, special considerations
must be taken when accessing registers. Refer to
4.3 Access to Low Energy Peripherals (Asynchronous Registers)
for a description on
how to perform register accesses to Low Energy Peripherals. Note that clearing the EN bit in WDOGn_CTRL will reset the WDOG mod-
ule, which will halt any ongoing register synchronization.
Note:
Never write to the WDOG registers when it is disabled, except to enable the watchdog by setting the EN bitfield in WDOGn_CTRL.
14.3.5 Warning Interrupt
The watchdog implements a warning interrupt which can be configured to occur at approximately 25%, 50%, or 75% of the timeout
period through the WARNSEL field of the WDOGn_CTRL register. This interrupt can be used to wake up the cpu for clearing the watch-
dog. The warning point for the watchdog timer can be calculated with the formula:
T
WARNING
= (2
3+PERSEL
) * (WARNSEL / 4) + 1) / f,
where f is the frequency of the selected clock.
When the watchdog is enabled, it is recommended to clear the watchdog before changing WARNSEL.
Reference Manual
WDOG - Watchdog Timer
silabs.com
| Building a more connected world.
Rev. 1.1 | 406