|
EVAL-ADUC831QSZ Datasheet, PDF (44/76 Pages) Analog Devices – MicroConverter®, 12-Bit ADCs and DACs with Embedded 62 kBytes Flash MCU | |||
|
◁ |
ADuC831
WATCHDOG TIMER
The purpose of the watchdog timer is to generate a device
reset or interrupt within a reasonable amount of time if the
ADuC831 enters an erroneous state, possibly due to a program-
ming error or electrical noise. The watchdog function can be
disabled by clearing the WDE (Watchdog Enable) bit in the
Watchdog Control (WDCON) SFR. When enabled, the watch-
dog circuit will generate a system reset or interrupt (WDS) if
the user program fails to set the watchdog (WDE) bit within a
predetermined amount of time (see PRE3â0 bits in WDCON).
The watchdog timer itself is a 16-bit counter that is clocked at
32 kHz by the internal R/C oscillator. The watchdog time out
interval can be adjusted via the PRE3â0 bits in WDCON. Full
control and status of the watchdog timer function can be con-
trolled via the watchdog timer control SFR (WDCON). The
WDCON SFR can only be written by user software if the
double write sequence described in WDWR below is initiated
on every write access to the WDCON SFR.
WDCON
SFR Address
Power-On Default Value
Bit Addressable
Watchdog Timer Control Register
C0H
10H
Yes
Bit
Name
7
PRE3
6
PRE2
5
PRE1
4
PRE0
3
WDIR
2
WDS
1
WDE
0
WDWR
Table XV. WDCON SFR Bit Designations
Description
Watchdog Timer Prescale Bits.
The Watchdog timeout period is given by the equation: tWD = (2PRE Ï« (29/fR/C OSC))
(0 ⤠PRE ⤠7; fR/C OSC = 32 kHz Ϯ10% at 25ºC)
PRE3 PRE2 PRE1 PRE0 Timeout Period (ms) Action
000
0
15.6
Reset or Interrupt
000
1
31.2
Reset or Interrupt
001
0
62.5
Reset or Interrupt
001
1
125
Reset or Interrupt
010
0
250
Reset or Interrupt
010
1
500
Reset or Interrupt
011
0
1000
Reset or Interrupt
011
1
2000
Reset or Interrupt
100
0
0.0
Immediate Reset
PRE3â0 > 1000
Reserved
Watchdog Interrupt Response Enable Bit.
If this bit is set by the user, the watchdog will generate an interrupt response instead of a
system reset when the watchdog timeout period has expired. This interrupt is not disabled by
the CLR EA instruction and it is also a fixed, high-priority interrupt. If the watchdog is not
being used to monitor the system, it can alternatively be used as a timer. The prescaler is used
to set the timeout period in which an interrupt will be generated.
Watchdog Status Bit.
Set by the Watchdog Controller to indicate that a watchdog timeout has occurred.
Cleared by writing a â0â or by an external hardware reset. It is not cleared by a watchdog reset.
Watchdog Enable Bit.
Set by the user to enable the watchdog and clear its counters. If this bit is not set by the user
within the watch dog timeout period, the watchdog will generate a reset or interrupt, depending
on WDIR. Cleared under the following conditions, user writes â0,â Watchdog Reset (WDIR = â0â);
Hardware Reset; PSM Interrupt.
Watchdog Write Enable Bit.
To write data into the WDCON SFR involves a double instruction sequence. The WDWR bit
must be set and the very next instruction must be a write instruction to the WDCON SFR.
For example:
CLR EA
;disable interrupts while writing
;to WDT
SETB WDWR
;allow write to WDCON
MOV WDCON, #72H ;enable WDT for 2.0s timeout
SETB EA
;enable interrupts again (if rqd)
â44â
REV. 0
|
▷ |