AT89C5115
Figure 26. Timer/Counter x (x= 0 or 1) in Mode 2
See section “Clock”
FTx
CLOCK
Timer x
Interrupt
Request
÷ 6
0
1
Overflow
TLx
(8 bits)
TFx
TCON Reg
Tx
C/Tx#
TMOD Reg
INTx#
THx
(8 bits)
GATEx
TMOD Reg
TRx
TCON Reg
Mode 3 (Two 8-bit Timers)
Mode 3 configures Timer 0 such that registers TL0 and TH0 operate as separate 8-bit
Timers (See Figure 27). This mode is provided for applications requiring an additional 8-
bit Timer or Counter. TL0 uses the Timer 0 control bits C/T0# and GATE0 in TMOD reg-
ister, and TR0 and TF0 in TCON register in the normal manner. TH0 is locked into a
Timer function (counting FPER /6) and takes over use of the Timer 1 interrupt (TF1) and
run control (TR1) bits. Thus, operation of Timer 1 is restricted when Timer 0 is in mode
3.
Figure 27. Timer/Counter 0 in Mode 3: Two 8-bit Counters
FTx
CLOCK
Timer 0
Interrupt
Request
÷ 6
0
1
Overflow
TL0
(8 bits)
TF0
TCON.5
T0
C/T0#
TMOD.2
INT0#
GATE0
TMOD.3
TR0
TCON.4
Timer 1
Interrupt
Request
Overflow
FTx
CLOCK
TH0
(8 bits)
÷ 6
TF1
TCON.7
TR1
TCON.6
See section “Clock”
Timer 1
Timer 1 is identical to Timer 0 excepted for Mode 3 which is a hold-count mode. Follow-
ing comments help to understand the differences:
•
Timer 1 functions as either a Timer or event Counter in three modes of operation.
Figure 24 to Figure 26 show the logical configuration for modes 0, 1, and 2. Timer
1’s mode 3 is a hold-count mode.
•
Timer 1 is controlled by the four high-order bits of TMOD register (See Figure 38)
and bits 2, 3, 6 and 7 of TCON register (See Figure 37). TMOD register selects the
method of Timer gating (GATE1), Timer or Counter operation (C/T1#) and mode of
operation (M11 and M01). TCON register provides Timer 1 control functions:
overflow flag (TF1), run control bit (TR1), interrupt flag (IE1) and interrupt type
control bit (IT1).
•
Timer 1 can serve as the Baud Rate Generator for the Serial Port. Mode 2 is best
suited for this purpose.
57
4128F–8051–05/06