Related Information
on page 3-1
For more information, refer to the
Reset Manager
chapter.
Watchdog Timer State Machine
The following state machine flow chart illustrates the behavior of the watchdog timer, including the behavior
of both output response modes. Once initialized, the counter decrements at every clock cycle. The state
machine remains in the Decrement Counter state until the counter reaches zero, or the watchdog timer is
restarted. If software reads the interrupt clear register (
wdt_eoi
), or writes 0x76 to the
wdt_crr
register,
the state changes from Decrement Counter to Load Counter with Restart Timeout Value. In this state, the
watchdog counter gets reloaded with the restart timeout value, and then the state changes back to Decrement
Counter.
Figure 24-2: Watchdog Timer State Machine
Load Counter with Initial Timeout
Value & Start Timer
Decrement
Counter
Assert Interrupt &
Load Counter with
Restart Timeout Value
Assert System
Reset Request
Decrement
Counter
Load Counter
with Restart
Timeout Value
Software Reads WDT_EOI
or Writes 0x76 to WDT_CRR
Counter > 0
Counter == 0 and
WDT_CR.RMOD == 1
Counter == 0
Counter == 0 and
WDT_CR.RMOD == 0
Software Reads WDT_EOI
or Writes 0x76 to WDT_CRR
Counter > 0
Software Sets Initial and Restart Timeout Periods (WDT_TORR),
Sets Output Response Mode (WDT_CR.RMOD),
and Enables the Timer (WDT_CR.WDT_EN)
System Reset
(Timer Disabled)
If the counter reaches zero, the state changes based on the value of the output response mode setting defined
in the
rmod
bit of the
wdt_cr
register. If the
rmod
bit of the
wdt_cr
register is 0, the output response
mode is to generate a system reset request. In this case, the state changes to Assert System Reset Request. In
response, the reset manager resets and disables the watchdog timer, and gives software the opportunity to
reinitialize the timer.
If the
rmod
bit of the
wdt_cr
register is 1, the output response mode is to generate an interrupt. In this
case, the state changes to Assert Interrupt and Load Counter with Restart Timeout Value. An interrupt to
the processor is generated, and the watchdog counter is reloaded with the restart timeout value. The state
then changes to the second Decrement Counter state, and the counter resumes decrementing. If software
Altera Corporation
Watchdog Timer
24-5
Watchdog Timer State Machine
cv_54024
2013.12.30