EIA RS-232 serial line interface

From Computer History Wiki
Revision as of 16:14, 13 December 2018 by Jnc (talk | contribs) (+cat)
Jump to: navigation, search

The EIA RS-232 serial line interface standard (now often known simply as RS-232, or EIA) is an asynchronous serial line interface using which was commonly used to connect both terminals and modems to computers.

RS-232 uses single-ended signalling‎ at the electrical level; the closely related descendant EIA RS-422 serial line interface uses differential pairs instead. The other, older, option for such communications is 20mA current loop).

RS-232 comes in two 'sexes', the 'Data Communication Equipment' (DCE), usually properly found on modems, and the 'Data Terminal Equipment' (DTE), usually properly found on terminals and computers. The concept was that at each end of the link, a DTE would plug into a DCE; the two modems with the DCEs would communicate over a telephone line.

Connecting a terminal to a computer (both wired as DTEs) thus usually requires a so-called null modem, a small device wired on both sides as a DCE. Internally, it connects appropriate signals together, so that e.g. one side's 'Transmitted Data' signal is connected to the other side's 'Received Data'. (In theory, there could be a DCE-DCE connecting device, but in practice this combination never occurs.)

Connectors

The RS-232 standard initially specified use of DB-25 connectors: male (DB-25P) for all DTE's, and female (DB-25S) for all DCE's. That way, if one RS-232 device or cable could plug into another at all, it was guaranteed to be a correct connection.

Alas, some equipment does not correctly follow this standard, requiring use of a so-called 'gender mender' - similar to a null modem, but without the signal cross-connects found in a null modem - to convert the offending connector to the standard. Unlike null modems (which are always female-female), gender menders come in both male-male and female-female variants.

With the rise of personal computers, the DB-25 connectors were too large, and in any event many of the signals in the full RS-232 specification were not needed. PC's therefore standardized on DE-9 connectors, following the lead of the IBM PC-AT, which first used them. DE-9 connectors are now officially part of the RS-232 specification.

Signals

The following table provides an (incomplete) list of RS-232 signals and pin assignments, for the most used signals, along with a few others. Direction is given with respect to the DTE - 'In' means the signal goes to the DTE, 'Out' means it comes from the DTE; the signal names also derive from this convention.

Name Abbreviation Direction DB-25 pin DE-9 pin
Transmitted Data TxD Out 2 3
Received Data RxD In 3 2
Request To Send RTS Out 4 7
Clear To Send CTS In 5 8
Data Terminal Ready DTR Out 20 4
Data Set Ready DSR In 6 6
Data Carrier Detect DCD In 8 1
Ring Indicator RI In 22 9
Force Busy Out 25 N/A
Signal Quality In 21 N/A
Signal Rate Both 23 N/A
Serial Clock Transmit In 15 N/A
Serial Clock Receive In 17 N/A
External Clock Out 24 N/A
Signal Ground G Common 7 5
Protective Ground PG Common 1 N/A

The Request To Send (sometimes 'Ready to Send') and Clear To Send pair are for hardware flow control, but use of them is fairly rare.

The signal ground provides a voltage reference for all the other signals, and also serves as a common signal return for them.

Null modem wiring

To create a null modem, Transmitted Data is connected to Received Data, and vice versa; Request To Send to Clear To Send; and Data Terminal Ready to both Data Set Ready and Data Carrier Detect.

Electrical

The asynchronous serial line protocol requires two signal levels: idle (mark), and asserted (space). In the single-sided RS-232, the former is indicated by a voltage level in the range of -3V to -15V (with respect to the "Signal Ground" pin; the latter by a voltage level in the range of +3V to +15V.

Confusingly, these are the opposite from the original asynchronous serial line, in which idle was a high voltage (so that a break in the line, or the failure of the transmitter, was easily detectable.) Data bits are also inverted, logically - 1 is a negative voltage, and 0 is positive.

Signal voltages in the range between −3V to +3V are thus not valid RS-232 levels; the maximum slew rate is also limited. To maximize robustness, RS-232 interfaces have be able to withstand being indefinitely shorted to ground. or tied to any voltage up to 25 volts (positive or negative).

Grounds

From Wikipedia:

Because both ends of the RS-232 circuit depend on the ground pin being zero volts, problems will occur when connecting machinery and computers where the voltage between the ground pin on one end, and the ground pin on the other is not zero. This may also cause a hazardous ground loop. Use of a common ground limits RS-232 to applications with relatively short cables. If the two devices are far enough apart or on separate power systems, the local ground connections at either end of the cable will have differing voltages; this difference will reduce the noise margin of the signals. Balanced, differential serial connections such as RS-422, RS-485, and USB can tolerate larger ground voltage differences because of the differential signaling.