User`s guide

LZ87010 Advance User’s Guide UARTs
1/15/03 10-9
10.1.3.3 Mode 2
In Mode 2, both UARTs use a fixed baud rate of PCLK/64.
10.1.3.4 Crystal Selection for RS-232 Baud Rates
Modes 1 and 3 can be used to generate standard RS-232 baud rates. Some readily avail-
able crystal frequencies are ideal for RS-232 baud-rate generation because they are an
exact integer multiple of all the desired RS-232 data rates. For example, a 22.184 MHz
crystal will provide bit rates with a nominal frequency error of zero between 2,400 and
76,800 baud on UART 0, and between 110 baud and 115,200 baud on UART 1. Other
standard crystals are not exact multiples of standard baud rates, and only an approxima-
tion to the desired rate will be possible. Crystal frequencies of 20 MHz or 40 MHz will give
frequency errors in excess of 1% for several baud rates in these ranges. This is shown in
Table 10-1 and Table 10-2.
The maximum theoretical timing error margin (from all causes) in RS-232 communications
occurs when the cumulative error adds up to one-half of a bit period across the entire char-
acter of 10-11 bits, or roughly 5%. This is reduced by the start-bit synchronization granu-
larity of 1/16 bit period, with an addition 1/16 bit period in either direction caused by triple-
sampling, which reduces the theoretical tolerance to 3/8 of a bit period, or roughly 3.75%.
Communications will be more reliable if the frequency error on each end is kept well below
this value, which is the total combined error of both the sending and receiving devices.
Errors such as the 1.4% to 1.7% errors shown in Table 10-1 and Table 10-2 are not advis-
able when connecting to unknown serial devices, but can be tolerated under favorable cir-
cumstances, such as debugging, where cable lengths are short and the other device is a
standard PC serial port, which is known to have zero nominal error at normal baud rates.
Table 10-1. UART 0 Baud Rate Example, Modes 1 and 3
BAUD
RATE,
SMOD = 0
BAUD
RATE,
SMOD = 1
20 MHz XTAL 22.1184 MHz XTAL 40 MHz XTAL
TH1 Error TH1 Error TH1 Error
1,200
2,400
0-1.7%
2,400 4,800 126 -0.2% 112 0.0% 0 -1.7%
4,800 9,600 191 -0.2% 184 0.0% 126 -0.2%
9,600 19,200 223 1.4% 220 0.0% 191 -0.2%
19,200 38,400 240 -1.7% 238 0.0% 223 1.4%
38,400 76,800 248 -1.7% 247 0.0% 240 -1.7%