Writing to
WDTLOAD
does not clear an active interrupt. An interrupt must be specifically cleared
by writing to the
Watchdog Interrupt Clear (WDTICR)
register.
The Watchdog module interrupt and reset generation can be enabled or disabled as required. When
the interrupt is re-enabled, the 32-bit counter is preloaded with the load register value and not its
last state.
The watchdog timer is disabled by default out of reset. To achieve maximum watchdog protection
of the device, the watchdog timer can be enabled at the start of the reset vector.
14.2.1
Register Access Timing
Because the Watchdog Timer 1 module has an independent clocking domain, its registers must be
written with a timing gap between accesses. Software must guarantee that this delay is inserted
between back-to-back writes to WDT1 registers or between a write followed by a read to the registers.
The timing for back-to-back reads from the WDT1 module has no restrictions. The
WRC
bit in the
Watchdog Control (WDTCTL)
register for WDT1 indicates that the required timing gap has elapsed.
This bit is cleared on a write operation and set once the write completes, indicating to software that
another write or read may be started safely. Software should poll
WDTCTL
for
WRC
=1 prior to
accessing another register. Note that WDT0 does not have this restriction as it runs off the system
clock.
14.3
Initialization and Configuration
To use the WDT, its peripheral clock must be enabled by setting the
Rn
bit in the
Watchdog Timer
Run Mode Clock Gating Control (RCGCWD)
register, see page 379.
The Watchdog Timer is configured using the following sequence:
1.
Load the
WDTLOAD
register with the desired timer load value.
2.
If WDT1, wait for the
WRC
bit in the
WDTCTL
register to be set.
3.
Set the
INTEN
bit (if interrupts are required) or the
RESEN
bit (if a reset is required after two
timeouts) in the
WDTCTL
register. The Watchdog Timer starts when either of them is enabled.
If software requires that all of the watchdog registers are locked, the Watchdog Timer module can
be fully locked by writing any value to the
WDTLOCK
register. To unlock the Watchdog Timer, write
a value of 0x1ACC.E551.
To service the watchdog, periodically reload the count value into the
WDTLOAD
register to restart
the count. The interrupt can be enabled using the
INTEN
bit in the
WDTCTL
register to allow the
processor to attempt corrective action if the watchdog is not serviced often enough. The
RESEN
bit
in
WDTCTL
can be set so that the system resets if the failure is not recoverable using the ISR.
Note:
The application should be sure not to modify the
ALTCLK
encoding in the
ALTCLKCFG
register while the WDT1 is enabled and running.
14.4
Register Map
Table 14-1 on page 1031 lists the Watchdog registers. The offset listed is a hexadecimal increment
to the register's address, relative to the Watchdog Timer base address:
■ WDT0: 0x4000.0000
■ WDT1: 0x4000.1000
June 18, 2014
1030
Texas Instruments-Production Data
Watchdog Timers