RS232 Serial Cable Wiring

How should cables between different types of RS232 ports be wired?


Example cables for connection from a PC to various Lantronix products with DB connectors are provided near the end of this FAQ
 

Background:
 

When RS232 was developed the idea was that there would be 2 kinds of devices, DTE (Data Terminal Equipment) and DCE (Data Communications Equipment).  Everything would use DB25 connectors and everyone would always connect a DTE to a DCE using a straight-through cable and everything would be easy.

However, as time went by folks wanted to connect two DTEs (or two DCEs) to each other, and DB9* connectors started being used, so alternative cable wirings were required.

There are no hard and fast rules but in general a DTE will have a male DB25 or possibly a male DB9 connector and a DCE will have a female DB25 or DB9.  Other connectors may be used but these are the most common. 

A typical DTE is a serial port on a terminal,  a Com port on a PC or the serial port on an EDS2100.

A typical DCE is the serial port on a modem or on a UDS-10, UDS100 or UDS1100.

If you're connecting a DB25M DTE to a DB25F DCE you can use a straight-through cable, i.e. pin 1 wired to pin 1, pin 2 wired to pin 2, etc.  Because of this DTE connectors are labeled according to the signal on the pin, DCEs are labeled according to the signal that should be coming from the DTE.

In other words a DCE and DTE are labeled identically even though the direction of their signals are opposite.

The most common DB25 pinout is:

1 Protective ground
2 Transmitted data (Out) (TD or TXD)
3 Received data (In) (RD or RXD)
4 Request to send (Out) (RTS)
5 Clear to send (In) (CTS)
6 Data set ready (In) (DSR)
7 Signal ground (SG)
8 Carrier detect (In) (CD or DCD)
20 Data terminal ready (Out) (DTR)

Originally all 25 pins of a DB25 were used but today the above pins are usually the only ones used. The most common pinout for DB9 serial connectors is:

1 Carrier detect (In) (CD or DCD)
2 Received data (In) (RD or RXD)
3 Transmitted data (Out) (TD or TXD)
4 Data terminal ready (Out) (DTR)
5 Signal ground (SG)
6 Data set ready (In) (DSR)
7 Request to send (Out) (RTS)
8 Clear to send (In) (CTS)

"Straight-through" cable

So a cable for a connection from a DB25 DTE to a DB25 DCE is wired:

DTE                   DCE
DB25M DB25F       DB25M DB25F
TXD   2>------------>2  TXD
RXD   3<------------<3  RXD
RTS   4>------------>4  RTS
CTS   5<------------<5  CTS
DSR   6<------------<6  DSR
SG    7--------------7  SG
DCD   8<------------<8  DCD
DTR   20>---------->20  DTR


To connect a DB9M DTE (e.g. the Com Port on a PC) to a DB25F DCE (e.g. a modem) you would wire your cable like this:

DTE   500-163 Cable   DCE
DB9M DB9F       DB25M DB25F
DCD  1<------------<8  DCD
RXD  2<------------<3  RXD
TXD  3>------------>2  TXD
DTR  4>----------->20  DTR
SG   5--------------7  SG
DSR  6<------------<6  DSR
RTS  7>------------>4  RTS
CTS  8<------------<5  CTS

Null Modems

If all anyone ever wanted to do was connect DTEs to DCEs all you would need are the above "straight-through" cables. But what if you want to connect a DTE serial port to a PC's DB25 DTE Com port? That's when you need a null modem.

The simplest null modem is the 3 wire connection. On a DB25-DB25 connection it would look like:

DB25            DB25
TXD 2----------3 RXD
RXD 3----------2 TXD
SG  7----------7 SG

Connecting 2 DB9s you'd wire up a null modem this way:

DB9              DB9
RXD 2----------3 TXD
TXD 3----------2 RXD
SG  5----------5 SG

If you're using Xon/Xoff (software) flow control or no flow control this is all you need.

A "full handshake" DB25 null modem cable is often wired like this:

DB25          DB25
TXD 2----------3 RXD
RXD 3----------2 TXD
RTS 4----------5 CTS
CTS 5----------4 RTS
DSR 6---|-----20 DTR
DCD 8---|
SG  7----------7 SG
DTR 20-----|---6 DSR
           |---8 DCD

This assures that all flow control (handshaking) signals are passed from one side of the connection to the other. You should be able to buy a null modem adapter or cable wired this way at any well-stocked electronics or computer store.

The DB9 version of this may be wired like this:

DB9 500-164-R Cable DB9
DCD 1---|---------4 DTR
DSR 6---|
RXD 2-------------3 TXD
TXD 3-------------2 RXD
DTR 4---------|---1 DCD
              |---6 DSR
SG  5-------------5 SG
RTS 7-------------8 CTS
CTS 8-------------7 RTS

Finally, a full handshake DB9-to-DB25 Null Modem is wired like this:

DB9              DB25
RXD 2----------2 TXD
TXD 3----------3 RXD
DTR 4------|---6 DSR
           |---8 DCD
SG  5----------7 SG
DSR 6---|-----20 DTR
DCD 1---|
RTS 7----------5 CTS
CTS 8----------4 RTS

 

PC to DTE DB25:

To connect a PC's DB9M to a DB25M DTE device use a Null Modem cable:

DB-9F(female)                    DB-25F(female)
RXD 2<---------------------------<2  TXD
TXD 3>--------------------------->3  RXD
DTR 4>--------------------------->6  DSR
GND 5-----------------------------7  GND
DSR 6<---------------------------<20 DTR
RTS 7>--------------------------->5  CTS
CTS 8<---------------------------<4  RTS
 

If your PC has a DB25M connector for it's serial port the Null Modem cable to connect DB25 DTE device or similar product is wired like this:
 

DB-25F(female)                   DB-25F(female)
TXD 2>--------------------------->3  RXD
RXD 3<---------------------------<2  TXD
RTS 4>--------------------------->5  CTS
CTS 5<---------------------------<4  RTS
DSR 6<---------------------------<20 DTR
GND 7-----------------------------7  GND
DTR 20>-------------------------->6  DSR

 

PC to EDS4100 or other DTE DB9:

The Lantronix part number for this cable is 500-164-R

DB-9F(female)                    DB-9F(female)
RXD 2<---------------------------<3 TXD
TXD 3>--------------------------->2 RXD
DTR 4>--------------------------->6 DSR
GND 5-----------------------------5 GND
DSR 6<---------------------------<4 DTR
RTS 7>--------------------------->8 CTS
CTS 8<---------------------------<7 RTS

If your PC has a DB25M connector for it's serial port the Null Modem cable to connect an EDS4100 or similar product is wired like this:

DB-25F(female)                   DB-9F(female)
TXD 2>--------------------------->2 RXD
RXD 3<---------------------------<3 TXD
RTS 4>--------------------------->8 CTS
CTS 5<---------------------------<7 RTS
DSR 6<---------------------------<4 DTR
GND 7-----------------------------5 GND
DTR 20>-------------------------->6 DSR


 

PC to UDS1100 or other DCE DB25:

Use a standard "straight-through" serial cable, often sold as a "Modem Cable".  The Lantronix part number for this cable is 500-163-R:

DTE                    DCE
DB9M DB9F       DB25M DB25F
DCD  1<------------<8  DCD
RXD  2<------------<3  RXD
TXD  3>------------>2  TXD
DTR  4>------------>20 DTR
SG   5--------------7  SG
DSR  6<------------<6  DSR
RTS  7>------------>4  RTS
CTS  8<------------<5  CTS

*Note: For decades a 9 pin D-subminiature connector has been referred to as a DB9. Recently there has been a movement to use the more accurate DE9 designation. For consistency in our documentation, and to avoid confusion, Lantronix will continue to use the term DB9 to describe a 9-pin D-subminiature serial port for the forseeable future.

For more infomation on why DE9 is considered to be more accurate see:
http://en.wikipedia.org/wiki/D-subminiature

 



[Originally Published On: 06/29/1999 09:15 AM]