RS232 DB9 Connector Wiring Tip

Thread Starter

keiichicom

Joined Apr 26, 2022
65
Remember when making your RS232 circuits, the pin order is reversed between male and female DB9 connectors. I got caught by this(embarrasingly) and wasted 2 hours trying to debug a 3-wire (RxD,TxD,Gnd) TTL->RS232 circuit with a MAX232 chip and an Arduino.

Reference:

rs232.png
 

MrChips

Joined Oct 2, 2009
30,706
I didn't think that DB9 RS-232 interface is in vogue these days.
The last time I needed this information must have been 25 years ago.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
DB9-RS232 is still in use widely in existing manufacturing operations that use CNC machines that go back to the 60's-70's-80's etc.
The method for upload/downloading programs is carried out this way for many decades.
The original DB connector was the DB25
 

Thread Starter

keiichicom

Joined Apr 26, 2022
65
DB9-RS232 is still in use widely in existing manufacturing operations that use CNC machines that go back to the 60's-70's-80's etc.
The method for upload/downloading programs is carried out this way for many decades.
The original DB connector was the DB25
Thanks. Also, I didn't know that used to be db25; did it used to be a parallel instead of a serial interface?
 

MrChips

Joined Oct 2, 2009
30,706
Thanks. Also, I didn't know that used to be db25; did it used to be a parallel instead of a serial interface?
DB25 male and female connectors was the standard used to connect DTE (data terminal equipment) to DCE (data communication equipment aka modems) long before the IBM PC made its appearance.

Centronics parallel interface also used DB25 on its printers.

When the IBM PC came along in 1981 it used DB25 for both serial and parallel interfaces. Of course this laid the grounds for a lot of confusion. And to further confuscate the matter, IBM in its infinite authority and wisdom deemed the PC to be DTE, in other words it was a data terminal and not a computer.

Apple used DE9 connectors on its Macintosh in 1984.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
Thanks. Also, I didn't know that used to be db25; did it used to be a parallel instead of a serial interface?
No. Serial RS232.
I'm not sure of the equipment the DB25 was originally used with, but it had secondary number of the handshake control connections in the pin ID list.
.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,167
The problem described in post #1 is why I include a map of the pin locations as seen from the back of the connector, with a note telling them this is a rear, solder side view of the connector. It is a pain to get a small connector wrong, it is a big waste of time for a 32 pin connector to be done wrong. Plus it makes the cable an inch too short when it is repaired.
 

Jon Chandler

Joined Jun 12, 2008
1,029
I used to have a book on RS-232 interfacing. Its advice was "throw away the documentation – it's probably wrong." Devices may have the wrong sex of DB9 connector for the expected application, or may have transmit and receive lines swapped.

One of the handy features of a true RS-232 interface is that the idle state of the transmit line is a negative voltage of between –5 to –12 volts. The receive line will be close to zero when it's disconnected.

In a DB9 connector, pin 5 is common, and transmit & receive are on pins 2 & 3 depending on how the connector is wired. To connect two unknown devices, measure the voltage between pin 2 and 5 and between pin 3 and 5 on each device. On each device, the pin with the negative voltage is the transmit line, and the pin with near zero volts is the the receive line. Connect the pin with a negative voltage on one side to the pin with no voltage on the other. With a little luck, the two DB9 connectors will line up with the correct sex pins. Chances are it's not going to be that simple and you'll need some jumpers to get the connections made.

Once the connections are made, next is getting the baud rates set and figuring out handshaking between the devices.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
Many devices did away with Hardware handshake and use XON XOFF software code instead.
Just three wires required with the H.S. jumpered out.
 

MrChips

Joined Oct 2, 2009
30,706
Many devices did away with Hardware handshake and use XON XOFF software code instead.
Just three wires required with the H.S. jumpered out.
Just three wires required with the H.S. jumpered out.

Minor technical detail which the uninitiated doesn't know and will stump them.

Do you still have your RS-232 Breakout Box?
I still have mine.

1651014855825.png
 

MrChips

Joined Oct 2, 2009
30,706
I bought my Breakout Box as a kit at the Dayton HamVention.
I never got around to assembling it into a box. So it is just a Breakout (BO and not a BOB) ?
Now that I have a 3D printer I suppose I can print a custom designed box. But what's the point now?

breakoutbox.jpg
 

MisterBill2

Joined Jan 23, 2018
18,167
I bought my Breakout Box as a kit at the Dayton HamVention.
I never got around to assembling it into a box. So it is just a Breakout (BO and not a BOB) ?
Now that I have a 3D printer I suppose I can print a custom designed box. But what's the point now?

View attachment 266008
The lack of adequate understanding of how RS232 actually should be implemented, and all of the resulting problems, was a major push towards the development of USB, which "works" but has some nasty down sides.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
I worked with it for many years with no problem, as long as you understood it and respected the protocol.
As per post #4, many of the CNC M/C's of the last century are still producing today and use it.
.
 
Top