
4
Assume that system X is configured to transmit and receive
at 1200bps. The system we are communicating with is
running slightly faster as stated above (1244bps). Our
sampling rate will still be based upon 1200bps, but the
sampling of the incoming signal will be off by a short time
period. With each sample this error accumulates. Thus, the
skewing to the right becomes greater over time. By the time
we normally would be sampling the parity bit (S9), the stop
bit(s) would be coming in over the SDI pin (see Figure 2A).
In this case, the 82C52 thinks it is sampling the parity bit
when in fact, what it is seeing is really the stop bit. This could
cause a parity error to be flagged.
Conversely, if data is being received at a baud rate slightly
less than our specified baud rate, we would get a skewing of
the received data in the opposite direction. From Figure 2C,
we see that at S10 we are checking the stop bit, but system
Y is still transmitting the parity bit. Therefore, the Framing
error will be flagged.
1.11 Request To Send (RTS):
This signal is an output of the 82C52. It is used to inform a
modem or remote system that it wishes to transmit data. The
modem (remote system) would then respond by activating
the CTS signal. As with the CTS, this signal is of most value
in half-duplex communications.
2.0 Control Registers
In order for the 82C52 to properly operate in a system, it
must be configured for the desired form of operation. The
user must decide how the device will be used in the system,
and know the communications protocol of the device it will
be communicating with. For example, in a system communi-
cating with a modem we would need to utilize the modem
control lines. When using the 82C52 in a local area network
these modem control lines may be of no use to us.
The 82C52 is initialized and configured by writing a series of
control words from the CPU to various control registers in
the device. These registers include the UART Control Regis-
ter (UCR), the Baud Rate Selector Register(BRSR), and the
Modem Control Register (MCR).
UCR: Defines the format of characters being transmitted.
The format of the characters includes the number of
data bits, parity control, and the number of stop bits.
BRSR: Used in setting up the internal baud rate generator in
the 82C52 for a specific baud rate. It will also be
used to specify what the CO output is to be.
MCR: Defines which interrupts will be enabled, and will
also set the modem control output lines (RTS and
DTR). In addition, the MCR allows the user to select
one of four modes of communications (normal mode,
echo mode, transmit break, and loop test mode).
2.1 UART Control Register
The UART Control Register (UCR) is a write-only register.
Writing a command word to the UCR configures the trans-
mission and reception circuitry of the 82C52. The command
word essentially describes the format of characters that are
to be transmitted or received. The format of these characters
are made up of (1) a specific word length, (2) parity informa-
tion, and (3) a selected number of stop bits, used to indicate
transmission of that character is completed.
D0 – Stop Bit Select. This bit is used to select the number
of stop bits that the 82C52 will insert into a character to be
transmitted, and the number to look for in received charac-
ters. The stop bit(s) denote where the end of a character
occurs. The external device must be configured with the
same number of stop bits as the 82C52. The setting(s) for
this bit are as follows:
0 – If this bit is set to zero, then a single stop bit will be gen-
erated and checked for.
1 – Setting this bit to a one will cause either of two configura-
tions. If we select a character length of 5 data bits, the
82C52 will generate 1.5 stop bits during transmission,
and will look for a single stop bit when receiving data. If a
character length of 6, 7, or 8 data bits is selected, then
two (2) stop bits will be generated and checked for.
D3, D2 and D1 – Parity Control. These three bits are used
to control the generation and checking of the parity bit. The
82C52 can be configured to perform this function one of
seven ways. These are:
000 – Even parity is generated for transmitting data, and
will be checked for when receiving data.
001 – Odd parity is generated for transmitting data, and
checked for during data reception.
010 – Even parity is generated for data transmission, and
odd parity will be checked for during data reception.
011 – Odd parity is generated for data transmission, and
even parity will be checked for during data reception.
100 –Even parity is generated for data transmission, how-
ever, the 82C52 will do no parity checking on data that has
been received.
D7
PARITY
D6 D5 D4 D3 D2 D1 D0
STOP BIT 0 =
1 = 1.5 STOP BITS (TX) AND
1 STOP BIT (RX) IF 5 DATA
BITS SELECTED
1 STOP BIT
000 =
001 =
010 =
011 =
100 =
101 =
11X =
TX AND RX EVEN
TX AND RX ODD
TX EVEN, RX ODD
TX ODD, RX EVEN
TX EVEN, RX CHECK
DISABLED
TX ODD, RX CHECK
DISABLED
GENERATION AND
CHECK DISABLED
00 = 5-BITS
01 = 6-BITS
10 = 7-BITS
11 = 8-BITS
SET TO 00 FOR FUTURE
WORD
RESERVED
CONTROL
SELECT
LENGTH
SELECT
PRODUCT UPGRADE
COMPATIBILITY
FIGURE 3. UCR FORMAT
Application Note 108