DS80C400 Maxim, DS80C400 Datasheet - Page 88
![no-image](/images/no-image-200.jpg)
DS80C400
Manufacturer Part Number
DS80C400
Description
The DS80C400 network microcontroller offers the highest integration available in an 8051 device
Manufacturer
Maxim
Datasheet
1.DS80C400.pdf
(97 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
DS80C400
Manufacturer:
DALLAS
Quantity:
748
Company:
Part Number:
DS80C400-FNY
Manufacturer:
DALLAS
Quantity:
85
Company:
Part Number:
DS80C400-FNY
Manufacturer:
Maxim Integrated
Quantity:
10 000
Company:
Part Number:
DS80C400-FNY+
Manufacturer:
TDK-Lambda
Quantity:
34
Company:
Part Number:
DS80C400-FNY+
Manufacturer:
Maxim
Quantity:
3 861
Company:
Part Number:
DS80C400-FNY+
Manufacturer:
Maxim Integrated
Quantity:
10 000
Part Number:
DS80C400-FNY+
Manufacturer:
MAXI/DALLAS
Quantity:
20 000
Timers
The microcontroller provides four general-purpose timer/counters. Timers 0, 1, and 3 have three common modes of
operation. Each of the three can be used as a 13-bit timer/counter, 16-bit timer/counter, or 8-bit timer/counter with
auto-reload. Timer 0 can also operate as two 8-bit timer/counters. When operated as a counter, timers 0, 1, and 3
count pulses on the corresponding T0, T1, and T3 external pins. Timer 2 is a true 16-bit timer/counter with several
additional operating modes. With a 16-bit reload register, timer 2 supports other features such as 16-bit auto-
reload, capture, up/down count, and output clock generation. All four timer/counters default to the standard
oscillator frequency divided by 12 input clock but can be configured to run from the system clock divided by 4.
Timers 1 and 2 can also be configured to operate with an input clock equal to the system clock divided by 13.
Table 26
Table 26. Timer/Counter SFRs
Watchdog Timer
The watchdog is a free-running, programmable timer that can set a flag, cause an interrupt, and/or reset the
microcontroller if allowed to reach a preselected timeout. It can be restarted by software.
A typical application uses the watchdog timer as a reset source to prevent software from losing control. The
watchdog timer is initialized, selecting the timeout period and enabling the reset and/or interrupt functions. After
enabling the reset function, software must then restart the timer before its expiration or hardware resets the CPU.
In this way, if the code execution goes awry and software does not reset the watchdog as scheduled, the
microcontroller is put in reset, a known good state.
Software can select one of four timeout values as controlled by the WD1 and WD0 bits. Timeout values are precise
since they are a function of the crystal frequency. When the watchdog times out, the watchdog interrupt flag (WDIF
= WDCON.3) is set. If the watchdog interrupt source has been enabled, program execution immediately vectors to
the watchdog timer interrupt-service routine (code address = 63h). To enable the watchdog interrupt source, both
the EWDI (EIE.4) and EA (IE.7) bits must be set. Furthermore, setting the EWT (WDCON.1) bit allows the
watchdog timer to generate a reset exactly 512 system clocks following a timeout. To prevent the watchdog reset
from occurring in such a situation, the watchdog timer count must be reset (RWT = 1) or the watchdog-reset
function itself must be disabled (EWT = 0). Both the enable watchdog timer (EWT) reset and the reset watchdog
timer (RWT) control bits are protected by timed-access circuitry. This prevents errant software from accidentally
clearing or disabling the watchdog. When a watchdog timer reset condition occurs, the watchdog timer reset flag
(WTRF = WDCON.2) is set by the hardware. This flag can then be interrogated following a reset to determine
whether the reset was caused by the watchdog timer.
The watchdog interrupt is useful for systems that do not require a reset circuit. It sets the WDIF (watchdog
interrupt) flag 512 system clocks before setting the reset flag. Software can optionally enable this interrupt source,
which is independent of the watchdog-reset function. The interrupt is commonly used during the debug process to
determine where watchdog reset commands must be located in the application software. The interrupt also can
serve as a convenient time-base generator or can wake up the microcontroller from power-saving modes.
The watchdog timer is controlled by the clock control (CKCON) and the watchdog control (WDCON) SFRs.
CKCON.7 and CKCON.6 are WD1 and WD0 respectively, and they select the watchdog timeout period. Of course,
the 4X/2X (PMR.3) and CD1:0 (PMR.7:6) system clock control bits also affect the timeout period.
the selection of timeout.
Timer/Counter Mode Selection and
Control
Count Registers
8-Bit Reload Register
16-Bit Reload/Capture Registers
Timer Input Clock-Select Bit
Divide-by-13 Clock-Option Bit
TIMER/COUNTER FUNCTION
shows the SFRs and bits associated with the four timer/counters.
TMOD, TCON
COUNTER 0
CKCON.3
TH0, TL0
TIMER/
TH0
—
—
88 of 97
TMOD, TCON
COUNTER 1
CKCON.4
T2MOD.4
TH1, TL1
TIMER/
TH1
—
RCAP2H, RCAP2L
T2MOD, T2CON
COUNTER 2
CKCON.5
T2MOD.3
TH2, TL2
TIMER/
—
Table 27
COUNTER 3
TH3, TL3
T3CM.5
TIMER/
T3CM
TH3
—
—
shows