Skip to main content

Connecting two DTE RS-232 devices

Short answer

Connecting two DTEs directly causes TXD-to-TXD and RXD-to-RXD contention, preventing communication. A null modem cable crosses TXD with RXD and handshake lines (RTS to CTS, DTR to DSR) to resolve it.

Describe the problem that occurs when you attempt to connect together two Rs.232 devices that are both configured as DTE. Draw a diagram which shows how this problem can be resolved.

The problem

RS-232 is defined for a DTE to DCE connection with a straight-through cable: the DTE transmits on TXD (pin 2) and receives on RXD (pin 3); the DCE does the opposite. If two DTEs (for example two PCs) are connected with a straight cable:

  1. TXD of one is connected to TXD of the other, so two output drivers are connected together (contention, possible damage) and neither receives data.
  2. RXD is connected to RXD, so both receivers are listening to nothing.
  3. The handshake lines clash in the same way: RTS to RTS and DTR to DTR (outputs together), and the inputs CTS, DSR and DCD get no signal, so a device waiting for CTS or DSR waits forever.
 DTE A (PC)                    DTE B (PC)
 TXD 2 ------------------------ TXD 2    (output to output)
 RXD 3 ------------------------ RXD 3    (input to input)
 RTS 4 ------------------------ RTS 4
 CTS 5 ------------------------ CTS 5
 GND 7 ------------------------ GND 7

Solution: null modem (crossover) cable

The cable makes each DTE think it is talking to a DCE by crossing the transmit/receive lines and the handshake lines. In the sketch, the number after each arrow is the pin on DTE B.

 DTE A (DB-25)                          DTE B (DB-25)
 TXD  2 ------------------------------> 3  RXD
 RXD  3 <------------------------------ 2  TXD
 RTS  4 ------------------------------> 5  CTS
 CTS  5 <------------------------------ 4  RTS
 DTR 20 ----------------------------+-> 6  DSR
                                     +-> 8  DCD
 DSR  6 <-+--------------------------- 20 DTR
 DCD  8 <-+
 GND  7 -------------------------------- 7  GND

Connections: TXD(A) -> RXD(B) and TXD(B) -> RXD(A); RTS(A) -> CTS(B) and RTS(B) -> CTS(A); DTR(A) -> DSR and DCD (B) and the reverse; signal ground straight through. The simplest null modem needs only three wires (TXD, RXD, GND), and the handshake inputs are looped back at each end (RTS to CTS, DTR to DSR and DCD) so the software never waits.

✓ Answer checked by Claude Sonnet 5.5

All Instrumentation II chapter 3 questions →