About the RS232 and Null-Modem Cables

Although serial communication, RS232, and modem connectors are widely used in almost all computer systems, it is sometimes hard to find the proper configuration when we most need it. In my opinion this is due to a few "confusing" factors that were introduced in the attempt of making things easier--wrong-- things just got so confusing I feel I should never leave home (for a computer related event) without the basic null-modem diagrams.

Just for the fun of it, le me vent what I feel some of the confusing factors are:
there are several serial standards; of these the RS-232 is probably (but not always) the most "popular".
Signal levels should be +12V / -12V, but are often +5 / -5 and +10 / -10. Although most RS-232 devices "should" read and generate these levels correctly, it does not always happen.
RS232 connections are almost always done through DB25 connectors which can be male OR female; the original complete set of signals really required most of the 25 pins, but because the complete handshake was never really used, the whole thing was scaled down to 9 main lines. At this point the erroneously but popularly called "DB9" connector became as widely used as the DB25. [By original definition, Amphenol Series D Subminiature connectors are named: DE9S DA15S DB25S DC37S DD50S for the females (receptacles) and "P" for males (plug)].
Yet, serial RS232 connections are sometimes made through DIN5 connectors, RJ connectors (telephone/network plug-like), and virtually anything that plugs into anything else!
PCs use both DB25 and DE9 connectors, and DB25-DE9 adapters are available on the market. Beware that SOME of these adapters, especially those provided for free with some mouse do not relay all lines, but only those that are necessary for that specific device--they may not work if you try to use them with a modem. The arrangement of lines on DB25 and DE9 shows very little consistency, so have your diagrams handy. In most texts, the SAME line called RX can be interpreted as an input on a DB25 and an output on a DE9. Why? This world is ruled by a lot of crazy people that like to make things complicated thinking they'll make it easier. The original idea was: If we call input RX on one end and output RX on the other, we just need to connect them directly, same for TX. Now, wouldn't most technicians know (without this twisted trick) that inputs are to be connected to outputs and vice-versa regardless of what they are called? Maybe whoever designed this was thinking of "RS232 for dummies" and expected that EVERYONE one day would build his own RS232 cable!!! I don't know! And I will never understand (nor support) the decision to call serial lines "101","102","103" thanks to a bunch of freaks at IEEE who think "102" makes more sense than "RX"!!!
Just because two devices have similar DB25 (or DE9) connectors doesn't mean they can be connected without knowledge of what's going on: some devices are configured as DTE (Data terminal equipment)--like all standard PC serial adapters--and have input and output lines arranged according to one diagram, while other can be configured as DCE (Data Communication equipment)--most external modems--and have input and output lines "swapped" so that a direct straight through cable could be used. Of course, two DTEs would need to use a cable that "crosses" inputs and outputs, DTE+DCE should be connected with a straight through cable, and if you ever needed to connect DCEs together you would need once again a "crossed" cable.
How many lines are required to establish a correct connection depends on the chip that handles it and on the software that handles the chip! Who cares if you string 25 wires from one PC to the other when the UCIA/UART/UAART/USART (all different chips that relieve the CPU from handling serial data) only uses 3,4,5.... And forthermore, even if the chip acknowledges all the lines, what if the software does not take into consideration their status? Once again, standards have been set, but exceptions have been made just as easily for the sake of semplicity and, most of all, money.
Beyond that, once a correct electrical connection is made, software parameters can be just as sneaky to set. Remember that each byte can be sent (and received) at different speeds (from 75 bits per second to 150,300,600,1200,2400,4800,9600,19200... you name it), each byte can be ended with one, two (sometimes one and 1/2) stop bits, parity bits can also be included for error detection and correction... Just make sure that the two devices KNOW what language they are speaking to each other, or you'll never get one byte across your perfect cable.
I won't even start talking about terminal emulation.
A picture is worth a thousand words, but anytime you need to interface two serial devices, find out (either by documentation or by experiment) all you can about the two systems.
In particular be sure to know for both:

  1. What type of serial interface they use. Make sure they are both RS232 standard levels (officially between +/- 3V to +/- 12V). Watch out for those rare TTL RS232 that use 0-5V; they won't drive a standard RS232 and they will also fry from the +/-12V.
  2. What type of connector they use, what gender.
  3. On each connector, which lines are inputs and which are outputs. Not all lines labelled RX are meant to be inputs! Look for a specific indication that tells you it is an input (arrows, "I"). Remember that Output data goes to Input data, Input data comes from Output data...
  4. What type of handshaking the computer and the software use. In doubt, use the most complete connection diagram that leaves NO lines unconnected. Even DCD, which is almost always left out of the picture, should be connected (usually to the same-side DSR). If you know that the computer/software only uses RX/TX, you can economize on your wires. If all they need is a local loopback to ensure that the input lines are enabled, do so directly on the connector and use only 3-wires (enable software handshaking XON-XOFF), but if you'd rather be safe than sorry, go ahead and build a fully wired cable.

Now the ball is to Ron Wiesen, Neil Morrison, and Leonard Erickson who so nicely answered the question on how to build an RS232 cable for the Tandy portables. Most info is just as precious for most interfaces. Also, don't forget to link to this INCREDIBLE database of connectors and cables from Joakim Ogren.

By Ron Wiesen
        Null-modem Cable
The laptop has a DB25 female connector, so it mates to a male connector
of the cable.  Typically the PC has a male connector, so it mates to a
female connector of the cable.  The connector at the PC is either a
type DB9, or a DB25 -- pin numbers for both types are shown in the
following diagrams.
A simple 3-wire type of null-modem cable is sufficient for use of
TEENY.EXE with Tandy laptop Models 100 and 102 -- no control lines
matter (none end to end, and none looped back at any end).  This is
shown below.
                                pin 07 DB25F
DB25M pin 07 ----- common ----- pin 05 DB9F    own & other reference
                                pin 03 DB25F
DB25M pin 02 TXD ---->>---- RXD pin 02 DB9F    own Xmt is other Rcv
                                pin 02 DB25F
DB25M pin 03 RXD ----<<---- TXD pin 03 DB9F    own Rcv is other Xmt
The null-modem cable that is shown above is not sufficient for use of
TEENY.EXE with Tandy laptop Model 200.  Wiring of control lines at the
laptop end is added so that the RTS control line loops back to the CTS
control line.  One connector end-conductor is added as shown below.
DB25M pin 04 RTS --->>---+                     own Request is
DB25M pin 05 CTS ---<<---+                     seen as Clear
A null-modem cable is also needed where the slave disk device is a PC
operating during a session of DeskLink.  The null-modem cable that is
shown above is not sufficient for use by DeskLink.  Although the three
cable through-conductors and the connector end-conductor are essential,
some additional wiring of control lines is required.
The RTS control line is looped back to the CTS control line at the PC
end.  One connector end-conductor is added as shown below.
                                pin 04 DB25F
                  +---<<--- RTS pin 07 DB9F    other Request is
                  |             pin 05 DB25F
                  +--->>--- CTS pin 08 DB9F    seen as Clear
There are two possible wiring arrangements for the DTR and DSR control
o  Typical    -- connector end-conductors for DTR looped back to DSR
o  Preferred  -- cable through-conductors for DTR and DSR
The typical arrangement is used in commercially made null-modem cables,
such as the "CompLink" cable that is sold by Club 100.  This
arrangement is shown below.
DB25M pin 20 DTR --->>---+                     own Ready is
DB25M pin 06 DSR ---<<---+                     seen as Ready
                                pin 20 DB25F
                  +---<<--- DTR pin 04 DB9F    other Ready is
                  |             pin 06 DB25F
                  +--->>--- DSR pin 06 DB9F    seen as Ready
The preferred arrangement gives more precise error response by TEENY.CO
for faults involving the null-modem cable.  This arrangement is shown
                                pin 06 DB25F
DB25M pin 20 DTR ---->>---- DSR pin 06 DB9F    own Ready for other
                                pin 20 DB25F
DB25M pin 06 DSR ----<<---- DTR pin 04 DB9F    other Ready for own

By: Neil S. Morrison I hope this is readable - my emailer shows this as a diagram. My reading is, for the first example:- 2 is jumpered across to 3 and vice versa, 7 is jumpered to 7. 4 and 5 are jumpered inside each cable end, as are 6 and 20. Does this help??????? Laptop Desktop N C D25 D25 U A 1 1 L B 2------3 L L 3------2 | E /-4 4-\ M \-5 5-/ O D25 /---6 6---\ D T | 7------7 | E O | 8 8 | M D25 \--20 20--/ N C D25 D9 U A 1 1 L B 2------2 L L 3------3 | E /-4 4---\ M \-5 /--5 | O D25 /---6 | 6---/ D T | 7---/ 7-\ E O | 8 8-/ M D9 \--20 9 Desktop WP-2 N C D9 D9 U A 1 1 L B 2------3 L L 3------2 | E /---4 4---\ M | 5------5 | O D9 \---6 6---/ D T /-7 7-\ E O \-8 8-/ M D9 9 9 N C D25 D9 U A 1 1 L B 2------2 L L 3------3 | E /-4 4---\ M \-5 /--5 | O D25 /---6 | 6---/ D T | 7---/ 7-\ E O | 8 8-/ M D9 \--20 9
By: Leonard Erickson (aka Shadow) So, let's start from scratch. A DB-25 connector is the sort that the PC uses for parallel (and some serial) ports. It has 25 pins in two rows, like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 * * * * * * * * * * * * * 14 15 16 17 18 19 20 21 22 23 24 25 * * * * * * * * * * * * A male DB-25 connector has pins sticking out, a female connector has holes for the pins to fit into. The numbering above is for a male connector. A 9-pin D connector (*not* "DB-9", in spite of what far too many folks say, the "B" indicates a 25-pin connector!) is what older PC video connectors used, and also what many serial ports use. It looks like this: 1 2 3 4 5 * * * * * 6 7 8 9 * * * * So here's the cable diagram redone: On the DB-25, connect pin 4 to pin 5. connect pin 6 to pin 20. On the D-9, connect pin 4 to pin 6. connect pin 7 to pin 8. Connect DB-25 pin 2 to D9 pin 2. DB-25 pin 3 to D9 pin 3. DB-25 pin 7 to D9 pin 5. BTW, this diagram is for a rather non-standard null modem cable. It's pretty close to a "loopback" null modem cable, except that it is ignoring the CD line on both sides. A "handshaking" null modem cable is wired rather differently. Loopback cable: M100 PC signal pin D25 D9 signal ------ --- --- -- ------ TD 2 -------- 3 2 RD RD 3 -------- 2 3 TD RTS 4 --+ +-- 5 8 CTS CTS 5 --+ +-- 4 7 RTS SG 7 -------- 7 5 SG DSR 6 --+ CD 8 --+ +-- 20 4 DTR DTR 20 --+ +-- 6 6 DSR +-- 8 1 CD Handshake Cable M100 PC signal pin D25 D9 signal ------ --- --- -- ------ TD 2 -------- 3 2 RD RD 3 -------- 2 3 TD RTS 4 -------- 5 8 CTS CTS 5 -------- 4 7 RTS SG 7 -------- 7 5 SG DSR 6 --+ CD 8 --+----- 20 4 DTR DTR 20 -----+-- 6 6 DSR +-- 8 1 CD In both diagrams "+" indicates wires connecting to each other. Thus RTS 4 --+ +-- 5 8 CTS CTS 5 --+ +-- 4 7 RTS Means that the RTS & CTS signals are tied together at each *end* of the cable, buut aren't run *down* the cable (there's that gap between the + marks). Whereas: DSR 6 --+ CD 8 --+----- 20 4 DTR Means that the DSR nd CD signals are tied together at one end of the cable and then connected to the DTR signalk at the *other* end of the cable. On the PC end, I gave pin numbers for both 9 and 25 pin connectors, so as to make it easier to wire up whichever sort you need. BTW, most "null modem" cables that you buy in stores will be the handshake type, *not* the loopback type.