UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
130 of 362
1.
Features
•
Optionally resets chip (via Clock Generation Unit) if not periodically reloaded.
•
Optional interrupt via Event Router (preceding or instead of Reset)
•
32-bit Prescaler and 32-bit Counter allow extended watchdog period
2.
Applications
The purpose of the Watchdog Timer is to interrupt and/or reset the microcontroller within a
reasonable amount of time if it enters an erroneous state. When enabled, the Watchdog
will generate an interrupt or a system reset if the user program fails to reset the Watchdog
within a predetermined amount of time. Alternatively, it can be used as an additional
general purpose Timer.
3.
Description
The Clock Generation Unit (CGU) outputs a clock for the Watchdog Timer (WDT). The
WDT is located on APB0. As described in
, the WDT clock can be selected
from APB0’s base clock, or either of two fractional dividers associated with APB0.
The WDT clock increments a 32-bit Prescale Counter, the value of which is continually
compared to the value of the Prescale Register. When the Prescale Counter matches the
Prescale Register at a WDT clock edge, the Prescale Counter is cleared and the 32-bit
Timer Counter is incremented. Thus the Prescale facility divides the WDT clock by the
value in the Prescale Register plus one.
The value of the Timer Counter is continually compared to the values in two registers
called Match Register 0 and 1. When/if the value of the Timer Counter matches that of
Match Register 0 at a WDT clock edge, a signal "m0" can be asserted to the Event
Router, which can be programmed to send an interrupt signal to the Interrupt Controller as
a result. When/if the value of the Timer Counter matches that of Match Register 1 at a
WDT clock edge, a signal "m1" can be asserted to the CGU, which resets the chip as a
result. The CGU also includes a flag to indicate whether a reset is due to a Watchdog
timeout.
Operation of the Watchdog facility depends on how it is programmed, and for interrupt,
how the Event Router is programmed. Recommended programming for both modules is
provided after the description of the Watchdog registers,
4.
Register description
The Watchdog Timer contains eight registers as shown in
below. All
addresses in the allocated range of the Watchdog Timer (0x8000 2800 through
0x8000 2BFF), other than those shown in
, are reserved and should not be
written.
UM10208
Chapter 11: WatchDog Timer (WDT)
Rev. 02 — 1 June 2007
User manual