In telecommunications, RS-232 is a standard for serial binary data interconnection between a DTE (Data terminal equipment) and a DCE (Data communication equipment). It is commonly used in computer serial ports. A similar ITU-T standard is V.24. RS is an abbreviation for "Recommended Standard".
The standard does not define such elements as character encoding (for example, ASCII, Baudot or EBCDIC), or the framing of characters in the data stream (bits per character, start/stop bits, parity). The standard does not define bit rates for transmission, although the standard says it is intended for bit rates less than 20,000 bits per second. Many modern devices can exceed this speed (38,400 and 57,600 bit/s being common, and 115,200 and 230,400 bit/s making occasional appearances) while still using RS-232 compatible signal levels.
Since application to such devices as computers, printers, digitizer tables, test instruments, and so on were not envisioned in the standard, designers implementing an RS-232 compatible interface on their equipment often interpreted the requirements idiosyncratically . Common problems were non-standard pin assignment of circuits on connectors, and incorrect or missing control signals. The lack of adherence to the standards produced a thriving industry of breakout boxes, patch boxes, test equipment, books, and other aids for the connection of disparate equipment.
Later personal computers (and other devices) started to make use of the standard so that they could connect to existing equipment. For many years, a RS-232-compatible port was a standard feature for serial communications, such as modem connections, on many computers. It remained in widespread use into the late 1990s, and while it has largely been supplanted by other interface standards in computer products, it is still used to connect legacy peripherals, industrial equipment (such as based on PLCs), and console ports. The standard has been renamed several times during its history as the sponsoring organization changed its name, and has been variously known as EIA RS 232, EIA 232, and most recently as TIA 232. The standard continues to be revised and updated by the EIA and since 1988 the Telecommunications Industry Association (TIA*). Revision C was issued in a document dated August 1969. Revision D was issued in 1986. The current revision is TIA-232-F Interface Between Data Terminal Equipment and Data Circuit-Terminating Equipment Employing Serial Binary Data Interchange, issued in 1997. Changes since Revision C have been in timing and details intended to improve harmonization with the CCITT standard V.24, but equipment built to the current standard will interoperate with older versions.
Many personal computers intended for office use ship with "legacy-free" motherboards without any RS-232 serial ports. However, RS-232 is still quite common in point-of-sale (cash drawers, barcode and magnetic stripe readers), amateur electronics and industrial measurement and remote-control devices, so computers made for such applications are still equipped with RS-232 ports. RS-232 was standard for so long that the circuits needed to control a serial port became very cheap and often exist on a single small microchip, sometimes together with circuitry for a parallel port. Many motherboards and desktop systems provide these ports even though they may not be used, simply because it costs the manufacturer very little to include them. Small-form-factor systems and laptops, however, often do not include them in order to conserve space. As an alternative, USB docking ports are available which can provide connectors for a keyboard, mouse, one or more serial ports, and one or more parallel ports. Corresponding device drivers are required for each USB-connected device to allow programs to access these USB-connected devices as if they were the original directly-connected peripherals.
Network equipment such as manageable switches and routers usually have an RS-232 port to be used for configuration of the device. It's a problem for some network administrators that most new laptops don't have an RS-232 port (though one can of course use a USB-to-serial dongle).
It is also possible to connect RS-232 devices via ethernet and WLAN device drivers, that act as network servers. Some manufacturers even have virtual serial port drivers available
The most common arrangement, nearly universal in personal computers, is an asynchronous link sending seven or eight bits. When used in this way, the bit order consists of a start bit, seven or eight data bits sent least significant bit first, an optional parity bit, and a stop bit. The steady state of the line is called the Marking state. The start of a new character is signaled by a change to the Space state. The digital ones and zeros are then transmitted serially onto the line by switching between the Mark and Space state ending with a final stop bit which is a transition back to the Marking state. Mechanical teleprinters often required extra time to ready themselves for the next character, so many systems could be arranged to send two stop bits.
Historically, teleprinter and related devices used ASCII in the US, or various character codes elsewhere. Some very old teleprinters and Telex systems use Baudot code.
Presence of a 25 pin D-sub connector does not necessarily indicate an RS-232C compliant interface. For example, on the original IBM PC, a male D-sub was an RS-232C DTE port (with a non-standard current loop interface on reserved pins), but the female D-sub connector was used for a parallel Centronics printer port. Some personal computers put non-standard voltages or signals on their serial ports.
The standard specifies 20 different signal connections. Since most devices use only a few signals, smaller connectors can be used. For example, the 9 pin DE-9 connector was used by most IBM-compatible PCs since the IBM PC AT, and has been standardized as TIA-574. More recently, modular connectors have been used. Most common are 8 pin RJ-45 connectors. Standard EIA/TIA 561 specifies a pin assignment, but the "Yost Serial Device Wiring Standard" invented by Dave Yost is common on Unix computers and newer devices from Cisco Systems. Many devices don't use either of these standards. 10 pin RJ-50 connectors can be found on some devices as well. Digital Equipment Corporation defined their own DECconnect connection system which was based on the Modified Modular Jack connector. This is a 6 pin modular jack where the key is offset from the center position. As with the Yost standard, DECconnect uses a symmetrical pin layout which enables the direct connection between two DTEs.
The following table lists the commonly used RS-232 signals and common pin assignments (see also RS-485 for different standard with the same connectors):
| Signal | DB-25 | DE-9 (TIA-574) | EIA/TIA 561 | Yost | RJ-50 | MMJ |
|---|---|---|---|---|---|---|
| Common Ground | 7 | 5 | 4 | 4,5 | 6 | 3,4 |
| Transmitted Data (TD) | 2 | 3 | 6 | 3 | 8 | 2 |
| Received Data (RD) | 3 | 2 | 5 | 6 | 9 | 5 |
| Data Terminal Ready (DTR) | 20 | 4 | 3 | 2 | 7 | 1 |
| Data Set Ready (DSR) | 6 | 6 | 1 | 7 | 5 | 6 |
| Request To Send (RTS) | 4 | 7 | 8 | 1 | 4 | - |
| Clear To Send (CTS) | 5 | 8 | 7 | 8 | 3 | - |
| Carrier Detect (DCD) | 8 | 1 | 2 | 7 | 10 | - |
| Ring Indicator (RI) | 22 | 9 | 1 | - | 2 | - |
The signals are labeled from the standpoint of the DTE device; TD, DTR, and RTS are generated by the DTE and RD, DSR, CTS, DCD, and RI are generated by the DCE. The ground signal is a common return for the other connections; it appears on two pins in the Yost standard but is the same signal. Connection of pin 1 (protective ground) and pin 7 (signal reference ground) is a common practice but not recommended. Use of a common ground is one weakness of RS-232. If the two pieces of equipment are far enough apart or on separate power systems, the ground will degrade between them and communications will fail; this is a difficult condition to trace.
Note that EIA/TIA 561 combines DSR and RI, and the Yost standard combines DSR and DCD.
Connecting two DTE devices together requires a null modem that acts as a DCE between the devices by swapping the corresponding signals (TD-RD, DTR-DSR, and RTS-CTS). This can be done with a separate device and two cables, or using a cable wired to do this. One feature of the Yost standard is that a null modem cable is a "rollover cable" that just reverses pins 1 through 8 on one end to 8 through 1 on the other end.
For configuring and diagnosing problems with RS-232 cables, a "breakout box" may be used. This device normally has a female and male RS-232 connector and is meant to attach in-line; it then has lights for each pin and provisions for interconnecting pins in different configurations.
RS-232 cables may be built with connectors commonly available at electronics stores. The cables may be between 3 and 25 pins; typically 4 or 6 wires are used. Flat RJ (phone-style) cables may be used with special RJ-RS232 connectors, which are the easiest to configure.
The reason that a minimal two-way interface can be created with only 3 wires is that all the RS-232 signals share a common ground return. The use of unbalanced circuits makes RS-232 susceptible to problems due to ground potential shifts between the two devices. RS-232 also has relatively poor control of signal rise and fall times, leading to potential crosstalk problems. RS-232 was recommended for short connections (15 meters or less). RS-232 interface cables are not usually constructed with twisted pair because of the unbalanced circuits.
While the control lines of the RS 232 interface were originally intended for call setup and takedown, other "handshakes" may be required by one or the other device. These are used for flow control, for example, to prevent loss of data sent to a serial printer. For example, DTR is commonly used to indicate "device ready". Pins may also be "jumpered" or routed back within the connector. For example a pin saying "are you ready?" from device A might be wired to the pin saying "I'm ready" on device A if device B did not transmit such a signal. Common handshake pins are DTR, DSR, DCD, and RTS/CTS.
A commonly used version of loopback testing doesn't involve any special capability of either end. A hardware loopback is simply a wire connecting complementary pins together in the same connector. See loopback.
Loopback testing is often performed with a specialized DTE called a Bit Error Rate Tester (BERT).
Alternatively, the DTE can provide a clock signal on pin 24 for both transmitted and received data. Again, data is changed when the clock transitions from OFF to ON and read during the ON to OFF transition.
| Signal | Pin |
|---|---|
| Common Ground | 7 (same as primary) |
| Secondary Transmitted Data (STD) | 14 |
| Secondary Received Data (SRD) | 16 |
| Secondary Request To Send (SRTS) | 19 |
| Secondary Clear To Send (SCTS) | 13 |
| Secondary Carrier Detect (SDCD) | 12 |
Other serial interfaces similar to RS-232:
EIA-232 | RS-232 | RS-232 | RS-232 | RS-232 | RS-232 | RS-232 | RS-232 | RS-232C | RS-232 | Port szeregowy | RS-232 | RS-232 | RS232 | RS-232 | RS-232 | RS-232