0% found this document useful (0 votes)
52 views

Serial Interfaces: RS-232 Interface

Serial interfaces such as RS-232 are used to connect computers to low-speed peripherals like modems and printers. RS-232 uses transmit and receive lines to send data serially, with additional control lines for handshaking. It operates by sending a start bit, then data bits least to most significant, followed by an optional parity bit and stop bit to mark the end of the character.

Uploaded by

jkmaro
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Serial Interfaces: RS-232 Interface

Serial interfaces such as RS-232 are used to connect computers to low-speed peripherals like modems and printers. RS-232 uses transmit and receive lines to send data serially, with additional control lines for handshaking. It operates by sending a start bit, then data bits least to most significant, followed by an optional parity bit and stop bit to mark the end of the character.

Uploaded by

jkmaro
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

APSC 380 : I NTRODUCTION TO M ICROCOMPUTERS

1997/98 W INTER S ESSION T ERM 2

Serial Interfaces
Serial interfaces are typically used to connect computer systems and low-speed external peripherals such as modems
and printers.
You should be able to describe the operation and format of data and handshaking signals on an RS-232 interface.
RS-232 Interface these, the most useful are called RTS (Request To
Send) and CTS (Clear To Send). The CTS pin is a
The most widely used peripheral interface is the DCE output and is used by the DCE to indicate that
“RS-232” serial interface. This interface is available it can accept data on the TxD line. The RTS line is an
on most general-purpose microcomputers. output on a DTE and is used to indicate that the DTE
wants to send (RTS was originally used to control
half-duplex modems – these are rarely seen today).
DTE and DCE Since these signals are used to control the flow of
data from the DTE (and optionally from the DCE)
The serial interface was originally designed to con-
these pins are called [hardware] “flow control” sig-
nect modems (Data Communications Equipment -
nals.
DCE) to computer terminals (Data Terminal Equip- DTE DCE
ment - DTE). In its simplest form the interface has
RTS RTS
two signal lines, Transmit Data (TxD or TD) and
Receive Data (RxD or RD), and a ground reference. CTS CTS
The TxD signal is an output on a DTE device and an DTR DTR
input on a DCE device. Similarly, RxD is an output DSR DSR
on a DCE device and input on a DTE device.
DTE DCE ("terminal") (modem)

The second set of control signals are DTR (Data


TxD TxD
Terminal Ready) and DSR (Data Set Ready). These
RxD RxD signals indicate that the DTE and DCE devices re-
spectively are connected and operational (typically,
("terminal") (modem) simply that the power is turned on). Some modems
Exercise: Is the “Transmit Data” (TxD) signal an input or an
can use DTR to force a reset and DSR as a replace-
output? How about “Receive Data” (RxD)? Is a computer a ‘mo-
ment for CD (see below).
dem’ or a ‘terminal’? A number of other handshaking signals are avail-
The standard RS-232 connector is a 25-pin D-style able but are less widely used. Carrier Detect (CD)
connector called a ”DB-25”. Pin 2 is TxD, pin 3 is is asserted by modem-type DCEs when a carrier sig-
RxD and pin 7 is signal ground. When two serial de- nal is present. This signal is typically used by system
vices are connected together they are connected pin- software to indicate the start and end of a dial-up ses-
to-pin (RxD is connected to RxD and TxD is con- sion. Another signal pin is Ring Indicator (RI) which
nected to TxD). This means that RxD must be an in- is used by modem-type DCEs to indicates that the at-
put on one device and an output on the other device. tached phone is ringing. This signal is seldom used.
Thus the terms RxD and TxD do not say whether a The RS-232 specification defines a number of other
pin is an input or output but are instead names for signals (e.g. a secondary serial interface) but they are
pins on the connector. Typically DTE connectors are almost never used.
male and DCE connectors are female. In addition to the standard DB-25 serial con-
In addition to the two data lines, most RS-232 de- nector, there are a number of smaller connectors
vices implement additional handshaking pins. Of that are widely used. These connectors are physi-

lec8.tex 1
cally smaller and carry a subset of the RS-232 pins. or odd) can be sent, followed by a one “stop” bit.
The most common are the DB-9 connectors popu-
lar on IBM PC-AT clones, the round DIN connectors
(popular on Apple computers), and the inexpensive
telephone-style “RJ-11” (6-pin) and “RJ-45” (8-pin)
connectors (popular on devices with many serial in-
terfaces).
Exercise: Draw the waveform used to send the ASCII char-
Adapters are often used not only to convert be-
acter ’e’ (hex 65) at 9600 bps with no parity.
tween different styles of connectors but also to con-
The start bit allows a receiver to re-synchronize
vert between male and female connectors (a “gender
itself at the start of each character. This allows
adapter” which allows two males or two females to for small variations between transmitter and receiver
be connected together) and to switch between DCE
timing.
and DTE pinouts (a “null modem” which allows two
Exercise: What happens if the receiver’s clock is running
DCEs or two DTEs to be connected together).
faster than the transmitter clock?
The stop bit guarantees that there will be a tran-
sition at the start of each character. It also allows
Interface Voltages a receiver to re-synchronize to a character boundary
in the middle of a continuous data stream. If the re-
The serial interface voltage levels are bipolar with ceiver does not see a ’one’ stop bit (called a “framing
respect to ground. The table below summarizes the error”) it knows it is unsynchronized and treats that
relationship between voltage level, logical meaning bit as a start bit. Eventually the receiver will syn-
on handshaking lines and data bit value (values on chronize to an actual start bit.
TxD and RxD lines). Exercise: What would happen if the receiver was expecting 8-
bit characters and the transmitter was sending 7-bit characters?

Signal Line For For What about the reverse case?

Level State Handshaking Data There are a number of standard bit rates, typically
negative mark false 1 powers of two times 1200 bps (1200, 2400, 4800 bps
positive space true 0 etc). The RS-232 standard specifies maximum bit
rates, distances, etc but these are usually ignored in
practical applications. For short distances it’s possi-
The received signal must be greater than +3 volts ble to send in excess of 100 kbps.
to be considered positive and less than -3 volts for
negative. Intermediate values are considered invalid.
This allows disconnected pins to be detected. Other Serial Interfaces
Note: The data lines (TxD and RxD) are asserted
The RS-422 serial interface specification uses a simi-
when negative. The control lines (e.g. CTS) are as-
lar signaling scheme but uses differential signals (op-
serted when positive.
posite voltages on two signal lines) to increase im-
munity to noise and increase maximum transmission
distance. Data rates up to 1 Mbps are common. RS-
Character Format 422 is common in industrial applications because of
its improved noise immunity.
Data is transferred over the serial interface one bit at There are also two relatively new high-speed serial
a time. A positive (zero) bit (the “start bit”) is sent interfaces: USB and IEEE 1394.
to indicate the start of the character being sent. This The Universal Serial Bus (USB) serial interface is
is followed by the bits in the character, from LS to designed to connect desktop PC peripherals such as
MS bit. After sending the 7 (for plain ASCII) or 8 keyboards and printers and runs around 10 Mbps. It
(for arbitrary bytes) bits, an optional parity bit (even supports multiple devices on each bus. Each device

2
has a socket and a plug and the devices are daisy-
chained.
IEEE 1394 (“Firewire”) is a high-speed (100 to
400 Mbps) serial interface designed to connect high-
speed devices such as digital video cameras, digital
video disks and hard disks. The network consists of a
“tree” of short (4.5 m maximum) point-to-point links
between devices.
It remains to be seen whether either of these two
interfaces will become popular enough to displace
the traditional RS-232 and SCSI standards.

You might also like