ADuCM310 Hardware Reference Manual
UG-549
Rev. C | Page 169 of 192
WATCHDOG TIMER
WATCHDOG TIMER FEATURES
The watchdog timer is a 16-bit count-down timer, which can recover from an invalid software state. The watchdog timer is clocked by the
32 kHz internal oscillator (LFOSC) with a programmable prescaler (1, 16,256, or 4096).
WATCHDOG TIMER BLOCK DIAGRAM
16 BIT UP/DOWN COUNTER
TIMER 3 VALUE
WATCHDOG TIMER RESET
WATCHDOG TIMER INTERRUPT
16-BIT DOWN COUNTER
LFOSC
PRESCALER
1, 16, 256
OR 4096
16-BIT LOAD
1
1461-
026
Figure 28. Watchdog Timer Block Diagram
WATCHDOG TIMER OVERVIEW
The watchdog timer (Timer 3) recovers from an invalid software state. When enabled, the watchdog timer requires periodic servicing to
prevent it from forcing a device reset. For debug purposes, the timer can be configured to generate an interrupt instead of a reset.
The watchdog timer is clocked by the internal 32.768 kHz oscillator, LFOSC. It is clocked at all times except during a reset.
The watchdog timer is a 16-bit count-down timer with a programmable prescaler. The prescaler is selectable and can divide LFOSC by a
factor of 1, 16,256, or 4096.
WATCHDOG TIMER OPERATION
The watchdog timer is enabled by default after a reset.
User code must disable the watchdog timer at the start of user code when debugging or if the watchdog timer is not required.
T3CON = 0x00;
// Disable watchdog timer
Enabling the watchdog timer (set T3CON[5] = 1) also write protects T3CON and T3LD.
This means that after kernel execution, user code can disable the timer and then reconfigure it with T3CON[5] = 1 only once. Then
T3CON and T3LD are write protected. T3STA[4] indicates if the timer configuration has been locked. Only a reset clears T3CON[5],
unlocking T3CON and T3LD, and allows reconfiguration of the timer.
If T3CON is not modified, user code can change T3LD at any time. If T3CON[5] is cleared to 0, the timer is disabled. Settings can be
modified, and the timer can be reenabled.
When the watchdog timer is used in interrupt mode, T3STA[0], the watchdog timer interrupt bit, is only set to 1 for a very short period
(2 × PCLK). Therefore, T3STA[0] must not be used for polling purposes.
REGISTER SUMMARY: WATCHDOG TIMER
Table 247. Watchdog Timer Register Summary
Address
Name
Description
Reset
Access
0x40002580
T3LD
Load value register
0x1000
RW
0x40002584
T3VAL
Current count value register
0x1000
R
0x40002588
T3CON
Control register
0x00E9
RW
0x4000258C
T3CLRI
Clear interrupt register
0x0000
W
0x40002598
T3STA
Status register
0x0000
R