i~.
87C51GBHARDWARE DESCRIPTION
nibbleof TMOD = OO1OB).In this case,thebaud rate
8.6 Timer2 to GenerateBaudRates
is
aivenby the formula:
-.
Timer2is sekted as thebaud rate generatorbysetting
~~~~t~nd 3 = 2SWlll X
Oscillator Frequancy
TCLK snd/or RCLK in T2CON.Note that the baud
32 X 12 X [25S– (THl)]
rates
for transmit and receive can be simultaneously
different.SettingRCLK snd/or TCLK puts Timer 2
One can achieveverylowbaud rates with Timer 1by
into its baud rate generator mode as shownin Figure
leavingthe Timer 1interrupt ensbled,and configuring 29.
the Timer to run as a id-bit timer (high nibble of
TMOD = OOOIB),and usingthe Timer 1interrupt to
do a id-bit softwarereload.
Timer1
BaudRate
ModeOMax:
1 MHz
Mode2 Max375K
Modes1&3: 62.5K
19.2K
9.6K
4.6K
2.4K
1.2K
137.5
110
110
F=
12MHz
12MHz
12MHz
11.059MHz
11.059MHz
11.059MHz
11.059MHz
11.059MHz
11.986MHz
6 MHz
12MHz
SMOD
x
1
1
1
0
0
0
0
0
0
0
C—T
x
x
o
0
0
0
0
0
0
0
0
Mode
x
x
2
2
2
2
2
2
2
2
1
Figure28.Timer1GeneratedCommonlyUeedBaudRatea
ReloadValue
x
x
FFH
FDH
FDH
FAH
F4H
E6H
lDH
72H
FEEBH
nwn 1
Ovawlaw
1
ma: osc msasavs4so
eva sol
12.
ma
-rLz
RXCLOCK
ma
------ lus
I
RCAPZH
I
RCAPZL
TXCLOCK
r%%%
4
Tzaxml
-11 Hq+-El-
..TNER 2.
INTSRRUPT
CemRoL
Sxam
L
Nols AwLsm.m*smnmML
SXIERSAL INTSRSUP?
270S97-30
Figure29.Timer2inBaudRateGeneratorMode
6-37