The 12 in the denominator in the above equation can be changed to 4 by setting the T1M bit in
the CKCON SFR. To derive the required TH1 value from a known baud rate (when TM1 = 0),
use the equation:
SMODx
2
x
CLK24
TH1 =
256 -
384 x Baud Rate
You can also achieve very low serial port baud rates from Timer 1 by enabling the Timer 1
interrupt, configuring Timer 1 to mode 1, and using the Timer 1 interrupt to initiate a 16-bit
software reload. Table C-10. lists sample reload values for a variety of common serial port
baud rates.
Note that more accurate baud rates are achieved by using Timer 2 as the baud rate generator
(next section).
Table C-10. Timer 1 Reload Values for Common Serial Port Mode 1 Baud Rates
Nominal
Rate
24 MHz
Divisor
Reload
Value
Actual
Rate
Error
57600
38400
28800
19200
9600
6
10
13
20
39
78
156
FA
F6
F3
EC
D9
B2
64
62500
37500
28846
18750
9615
8.5%
-2.3%
+0.16%
-2.3%
+0.16%
+0.15%
+.13%
4800
4807
2400
2403
Settings: SMOD =1, C/T=0, Timer1 mode=2, TIM=1
Note: Using rates that are off by 2.3% or more will not work in all
systems.
To use Timer 2 as the baud rate generator, configure Timer 2 in auto-reload mode and set the
TCLK and/or RCLK bits in the T2CON SFR. TCLK selects Timer 2 as the baud rate
generator for the transmitter; RCLK selects Timer 2 as the baud rate generator for the receiver.
The 16-bit reload value for Timer 2 is stored in the RCAP2L and RCA2H SFRs, which makes
the equation for the Timer 2 baud rate:
C - 20
Appendix C: 8051 Hardware Description
EZ-USB TRM v1.9