AT83C51SND1C_03 ATMEL [ATMEL Corporation], AT83C51SND1C_03 Datasheet - Page 54

no-image

AT83C51SND1C_03

Manufacturer Part Number
AT83C51SND1C_03
Description
Single-Chip Flash Microcontroller with MP3 Decoder and Human Interface
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
Figure 35. Timer/Counter 0 in Mode 3: 2 8-bit Counters
Figure 36. Mode 3 Overflow Period Formula
Timer 1
54
INT0
AT8xC51SND1C
CLOCK
CLOCK
TIM0
TIM0
T0
GATE0
TMOD.3
÷ 6
÷ 6
TMOD.2
C/T0#
TF0
3. Figure 34 gives the autoreload period calculation formulas for both TF0 and TF1
flags.
Timer 1 is identical to Timer 0 except for Mode 3 which is a hold-count mode. The fol-
lowing comments help to understand the differences:
0
1
PER
TCON.4
TR0
Timer 1 functions as either a Timer or event Counter in three modes of operation.
Figure 29 through Figure 33 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 61)
and bits 2, 3, 6 and 7 of TCON register (see Figure 60). 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.
For normal Timer operation (GATE1 = 0), setting TR1 allows TL1 to be incremented
by the selected input. Setting GATE1 and TR1 allows external pin INT1 to control
Timer operation.
Timer 1 overflow (count rolls over from all 1s to all 0s) sets the TF1 flag generating
an interrupt request.
When Timer 0 is in mode 3, it uses Timer 1’s overflow flag (TF1) and run control bit
(TR1). For this situation, use Timer 1 only for applications that do not require an
interrupt (such as a Baud Rate Generator for the Serial Port) and switch Timer 1 in
and out of mode 3 to turn it off and on.
It is important to stop the Timer/Counter before changing modes.
=
6
(256 – TL0)
TCON.6
F
TR1
TIM0
(8 bits)
(8 bits)
TH0
TL0
TF1
PER
=
6
Overflow
Overflow
(256 – TH0)
F
TIM0
TCON.5
TCON.7
TF0
TF1
Timer 0
Interrupt
Request
Timer 1
Interrupt
Request
4109E–8051–06/03

Related parts for AT83C51SND1C_03