at89s8253-24psu ATMEL Corporation, at89s8253-24psu Datasheet - Page 16

no-image

at89s8253-24psu

Manufacturer Part Number
at89s8253-24psu
Description
At89s8253 8-bit Microcontroller With 12k Bytes Flash And 2k Bytes Eeprom
Manufacturer
ATMEL Corporation
Datasheet
Figure 10-1. Timer 2 in Capture Mode
10.3
Table 10-3.
16
T2MOD Address = 0C9H
Not Bit Addressable
Symbol
T2OE
DCEN
Bit
T2EX PIN
Auto-reload (Up or Down Counter)
AT89S8253
OSC
Function
Not implemented, reserved for future use.
Timer 2 Output Enable bit.
When set, this bit allows Timer 2 to be configured as an up/down counter.
7
T2MOD – Timer 2 Mode Control Register
T2 PIN
÷12
Timer 2 can be programmed to count up or down when configured in its 16-bit auto-reload
mode. This feature is invoked by the DCEN (Down Counter Enable) bit located in the SFR
T2MOD (see
count up. When DCEN is set, Timer 2 can count up or down, depending on the value of the
T2EX pin.
Figure 10-2
are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to 0FFFFH and then sets
the TF2 bit upon overflow. The overflow also causes the timer registers to be reloaded with the
16-bit value in RCAP2H and RCAP2L. The values in RCAP2H and RCAP2L are preset by soft-
ware. If EXEN2 = 1, a 16-bit reload can be triggered either by an overflow or by a 1-to-0
transition at external input T2EX. This transition also sets the EXF2 bit. Both the TF2 and EXF2
bits can generate an interrupt if enabled.
Setting the DCEN bit enables Timer 2 to count up or down, as shown in
mode, the T2EX pin controls the direction of the count. A logic 1 at T2EX makes Timer 2 count
up. The timer will overflow at 0FFFFH and set the TF2 bit. This overflow also causes the 16-bit
value in RCAP2H and RCAP2L to be reloaded into the timer registers, TH2 and TL2,
respectively.
6
TRANSITION
DETECTOR
shows Timer 2 automatically counting up when DCEN = 0. In this mode, two options
C/T2 = 0
C/T2 = 1
Table
5
10-3). Upon reset, the DCEN bit is set to 0 so that timer 2 will default to
EXEN2
4
TR2
CAPTURE
CONTROL
CONTROL
3
RCAP2H
TH2
EXF2
RCAP2L
2
TL2
Reset Value = XXXX XX00B
OVERFLOW
T2OE
TF2
1
Figure
INTERRUPT
DCEN
TIMER 2
3286K–MICRO–12/06
0
10-3. In this

Related parts for at89s8253-24psu