An RS-232 cable consists of wires, or lines, that join two connectors. The connectors plug into the serial ports of each device to form a communications link over which data and control signals flow. Each serial port consists of numbered pins that have the meanings shown in the following table:
Pin | Meaning |
---|---|
2 | TxDTransmit Data * |
3 | RxDReceive Data |
4 | RTSRequest to Send * |
5 | CTSClear to Send |
6 | DSRData Set Ready |
20 | DTRData Terminal Ready * |
7 | Common |
All serial devices are either Data Communication Equipment (DCE) type devices or Data Transmission Equipment (DTE) type devices. IBM-compatible PCs are DTE type devices. The difference between the two types is in the meaning assigned to the pins. A DCE device reverses the meaning of pins 2 and 3, 4 and 5, and 6 and 20. In the simplest scenario, a DTE device attaches to a DCE device, such as a modem. The following table shows the cable required to connect a PC (or DTE) to a DCE device.
(PC) | Connect pins as indicated: |
(Device) |
---|---|---|
TxD* | 2____________2 | RxD |
RxD | 3____________3 | TxD* |
RTS* | 4____________4 | CTS |
CTS | 5____________5 | RTS* |
DSR | 6____________6 | DTR |
DTR* | 20___________20 | DSR* |
common | 7____________7 | common |
(PC) | Connect pins as indicated: |
(Device) | |
---|---|---|---|
TxD* | 2_____________3 | RxD | |
RxD | 3_____________2 | TxD* | |
RTS* | 4_____________5 | CTS | |
CTS | 5_____________4 | RTS* | |
DSR | 6____________20 | DTR | |
DTR* | 20____________6 | DSR* | |
common | 7_____________7 | common |
For more information about the meaning of DTE and DCE, refer to a reference book on RS-232 communication.
In the simplest case, a serial cable needs lines 2, 3, and 7 for basic communication to take place. Hardware handshaking and modem control can require other lines, depending on the application. Refer to the Hardware Handshaking section for more information about using lines 4, 5, 6, and 20.
You also must consider the gender of the connectors of your serial cable. The serial cable plugs into sockets in the PC and the serial device, just as a lamp cord plugs into a wall socket. Both the connector and the socket can be male, with pins (like a lamp plug), or female, with holes (like an outlet). If your serial cable connector and PC socket are the same gender, you cannot plug the cable into the socket. You can resolve this issue by attaching a small device called a gender changer to your cable. One type of gender changer converts a female connector to a male connector, and the other type converts a male connector to a female connector.
The size of the connector on your serial cable also can differ from the size of the socket. Most serial ports require a 25-pin connector. However, some serial ports require a 9-pin connector. To resolve this incompatibility, you must either change the connector on your serial cable or attach a small device that converts a 25-pin connector to a 9-pin connector.