English
Language : 

DS80C320-MCG Datasheet, PDF (125/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
MODE 2
This mode configures the timer as an 8-bit timer/ counter with automatic reload of the start value. This
configuration is shown in Figure 11-2, and is selected when bits M1and M0 of the TCON register are set
to 1 and 0 respectively. When configured in Mode 2, the timer uses TLn to count and THn to store the
reload value. Software must initialize both TLn and THn with the same starting value for the first count
to be correct. Once the TLn reaches FFh, it will be automatically loaded with the value in THn. The THn
value remains unchanged unless modified by software. Mode 2 is commonly used to generate baud rates
since it runs without continued software intervention. As in modes 0 and 1, mode 2 allows counting of
either oscillator cycles (crystal/12 or crystal/4) or pulses on pin Tn (C/T=1) when counting is enabled by
TRn and the proper setting of GATE and INTn pins.
TIMER/COUNTER 0 AND 1, MODE 2 Figure 11-2
OSC INPUT TO TIMER
CLK MODE TIMER INPUT
DIVIDE BY 4 OSC/1
PMM1
OSC/16
2PMM2
OSC/256
T0M = CKCON.3
(T1M = CKCON.4)
DIVIDE
BY 12
0
0
DIVIDE
BY 4
1
C/ T = TMOD.2
(C/ T = TMOD.6)
TL0
(TL1)
CLK
0
T0 = P3.4
1
(T1 = P3.5)
TR0 = TCON.4
(TR1 = TCON.6)
GATE = TMOD.3
(GATE = TMOD.7)
0
TH0
(TH1)
7 RELOAD
7
INT0 = P3.2
( INT1 = P3.3)
TF0 = TCON.5
(TF1 = TCON.7)
INTERRUPT
TIMER 1 FUNCTIONS
SHOWN IN PARENTHESIS ()
MODE 3
This mode provides an 8-bit timer/counter and a second 8-bit timer as indicated in Figure 11-3. In Mode
3, TL0 is an 8-bit timer/counter controlled by the normal Timer 0 bits (TR0=TCON.4 and TF0=TCON.5).
TL0 can be used to count oscillator cycles (crystal/12 or crystal/ 4) or 1 to 0 transitions on pin T0 as
determined by C/ T (TMOD.2). As in the other modes, the GATE function can use INT0 to give external
run control of the timer to an outside signal.
TH0 becomes an independent 8-bit Timer in Mode 3, however it can only count oscillator cycles (divided
by 12 or 4) as shown in the figure. In this mode, some of Timer 1’s control signals are used to manipulate
TH0. That is, TR1 (TCON.6) and TF1 (TCON.7) become the relevant control and flag bits associated
with TH0.
125 of 175