The RS-232 Standard
The type of cables required for directly connecting two computers or
connecting a computer and a modem are defined by the Electrical Institute of America’s RS-232 standard. Just about every computer has one or more RS-232 connectors
(usually referred to as serial ports). However, the RS-232 standard is very
broad, so these ports are not configured identically on all systems.
RS-232 was originally designed for communications between terminals and
modems. These two types of equipment are referred to in the standard as data terminal
equipment (DTE) and data communications equipment (DCE). Most (but not all)
computers are DTE. Terminals are always DTE. Modems are always DCE. Usually, a
serial port on a DTE uses a 25-pin male connector, while a serial port on a DCE
uses a 25-pin female connector.
Most of the wires in the cable are defined as control lines. Only two of the
wires (those connected to pins 2 and 3) are actually used for data transmission.
DTE sends out data on pin 2, and DCE expects to receive it there. DCE sends
out data on pin 3, and DTE expects to receive it there.
If making a connection directly between DTE and DCE, as expected by the RS-232
standard, then use a straight-through RS-232 cable. However, to establish a
direct connection between two computers with DTE ports, then a null modem cable
must be used, in which the wires connecting pins 2 and 3 are crossed. This type
of cable forces the two DTE connections into accepting one as a DCE connection.
Both straight-through and null modem cables are widely available. These cables
should be available from the system manufacturer or at most computer or
electronics stores.
There are several complications: most computer manufacturers configure the
serial ports on their computers as DTE ports; however some configure them as DCE.
Furthermore, some manufacturers use female connectors for DTE ports, or male
connectors for DCE. In addition, to save space on crowded boards, many
manufacturers have adopted a more compact 9-pin connector in place of the standard 25-pin
connector.
As a general rule, if the system manufacturer provides standard modem cables
for use with the system, the TinyTERM Emulator will run correctly with them.
RS-232 cables consist of up to 25 wires, each with a specific function, and
each intended to carry a different signal. Only two of the wires are commonly
used for data transmission; the rest are used for various kinds of control signals.
A piece of equipment (a computer or a modem) sends a signal across the cable
by applying a small positive or negative voltage to a specific pin in the cable’s end connector. The signal is carried through the wires in the cable to the
corresponding pin at the other end, where it is detected by another piece of
equipment. The voltage may either be held high (positive) as a go-ahead signal, or
may pulse quickly to convey data, with the sequence of negative and positive
voltages being interpreted as binary codes.
Unfortunately, as it has now come to be applied, the RS-232 standard is rather
broad, and leaves a lot up to the equipment manufacturer. All that is standard
is the function of each of the 25 pins found in the connectors on each end of
a serial cable. All 25 pins are rarely used. Instead, different pieces of
equipment require different signals to operate. To make things even more
complicated, connectors with only 9 pins are becoming increasingly common.
In this section, an assumption is made of using a standard 25-pin connector.
The pin-outs for the 9-pin connector used on the IBM PC/AT are listed later in
the section.
If all of the equipment is purchased from a single manufacturer, the exact
cables needed to connect the various pieces should also be available from this
source. If the hardware is mix and match, the cables will probably have to be
built internally.
For more authoritative treatments of RS-232 and serial communications in
general, we recommend Technical Aspects of Data Communications by John McNamara
(Digital Press, 1982), and C Programmer’s Guide to Data Communications by Joe Campbell (Sams, 1987).