Skip to main content

Dual RS-232 Adapter

Serial ports are old tech, but old tech is meant to be hacked. Here's an adapter that handy to have around if you work with vintage hardware or industrial equipment. We'll also sift through some common serial port accessories that can save the day when you're in a pinch.

Dual RS-232 adapter for the Bus Pirate with male (Data Terminal Equipment) and female (Data Communications Equipment) connectors. This adapter allows the Bus Pirate UART (0-5volts) to communicate with true RS-232 devices (generally +/-13volts).

Microcontrollers typically have a TTL serial UART where a 0 is represented by 0 volts and a 1 is represented by 3.3volts or 5volts. RS-232 uses a different voltage range, a 0 is represented by +3 to +15volts and a 1 is represented by -3 to -15volts. The Bus Pirate can't directly communicate with RS-232 devices because it's voltage range is too low. This adapter converts the Bus Pirate UART to RS-232 voltage levels.

danger

Dual RS-232 Adapter is "in development". If hardware is available it has passed basic functionality tests, but there isn't full documentation or support just yet. At this stage, it's best suited for developers who are comfortable with hardware and firmware development. Or for those who want to follow along.

DTE and DCE connectors

SignalDTE pinDCE pinDescription
TX23Transmit data
RX32Receive data
RTS78Request to send
CTS87Clear to send
GND55Signal ground

The adapter has two connectors, male for DTE (Data Terminal Equipment) and female for DCE (Data Communications Equipment). The DTE connector is typically used on a computer or terminal, and the DCE connector is typically used on a modem or other device. The adapter level-shifts 4 UART signals: TX, RX, RTS and CTS. The Bus Pirate UART supports hardware flow control using the RTS and CTS pins.

Transceiver IC

PlankTransceiver Chip
Dual RS232 "Deluxe"Maxim/ADI MAX3232CSE+
Dual RS232 "Basic"HGSemi MAX3232EIM

Genuine Maxim/ADI MAX3232CSE+ transceiver ICs are expensive. This is old tech so there's plenty of cheaper drop in replacements that will work just as well 99.9% of the time.

With this adapter board we're trying a little experiment. The HQ version has a Maxim/ADI MAX3232CSE+ chip. The Budget version has a HGSemi MAX3232EIM chip. Both versions are functionally identical, but the HQ version uses more expensive components.

What are the pros and cons of using the "off brand" part?

Cons

  • The "off brand" part may not meet the same specifications as the Maxim part
  • In volume production the "off brand" part could potentially have a higher failure rate or more corner case issues
  • It may be harder to source the "off brand" part in the future or outside of China

Pros

  • Counter intuitively, the "off brand" part may have better specs than the Maxim part. The Maxim part has been around for ages, and as old tech it's unlikely they've updated the design in decades. The "off brand" part could be a more modern design fabricated with newer processes and materials
  • The "off brand" part is much cheaper, which makes small niche projects more doable. Consider small volume production: for 100 adapter boards we need 200 ICs. The Maxim part is $1.50 each, so $300 for the ICs alone. The "off brand" part is $0.30 each, so $60 for the ICs. That's a lot less up front investment and inventory to carry for a niche project that may only sell a few pieces.

Serial Port Accessories

TypeConnector 0Connector 1Wiring
Straight through cableMaleFemale1:1
Crossover cableFemaleFemaleRX/TX, CTS/RTS, DTR/DSR swapped
M:M Gender changerMaleMale1:1
F:F Gender changerFemaleFemale1:1
F:F crossover adapterFemaleFemaleRX/TX, CTS/RTS, DTR/DSR swapped, DTR...
Female breakoutFemaleScrew terminal-
Male breakoutMaleScrew terminal-

The adapter is designed with the most common serial port pinout, but there are endless permutations out there. Hobby projects and industrial tools, where serial ports were common until very recently, are notorious for funky pinouts.

Let's see what cheap and useful serial port accessories are available in the market.

Straight Through Cable

The most common serial cable. Connects a male (usually PC/terminal/DTE) to female (usually equipment/DCE). Straight through 1 to 1 wiring.

info

Use this cable to connect the adapter DTE and DCE ports. Then use the monitor command in UART mode to test data transmission and flow control.

Crossover Cable

Also called a null modem cable. Connects two male (usually PC/terminal/DTE) ports.

Signal 0Pin 0DirectionPin 1Signal 1
DCD1<->1DCD
RX2<-3TX
TX3->2RX
DTR4->6DSR
GND5-5GND
DSR6<-4DTR
RTS7->8CTS
CTS8<-7RTS
RI9<->9RI

RX/TX, CTS/RTS, DTR/DSR are swapped so that two normally master devices can communicate.

info

Using a null modem cable you can connect the serial ports of two PCs, open a terminal on each, and chat between them.

Gender Changer Adapters

Female to female, and male to male gender changers. Used with a common cable to interface odd devices, or with odd cables to save the day.

Male Cross Over Adapter

Turns a common straight through cable into a null modem cable that connects two normally master (PC/terminal/DTE) devices.

Signal 0Pin 0DirectionPin 1Signal 1
RX2<-3TX
TX3->2RX
DTR4->6&1DSR/DCD
GND5-5GND
DSR/DCD6&1<-4DTR
RTS7->8CTS
CTS8<-7RTS
RI9removed9RI

RX/TX, CTS/RTS and DSR/DTR are swapped. Swapped, but in this case DSR and DCD are connected together. This is a common hack for old equipment that ....

Breakouts

Screenshot_20240717_115008|200x141 Screenshot_20240717_115018|200x140

Breakout male and female connectors to screw terminals. Super handy to have, inexpensive and useful for hacking.

Schematic

Dual RS-232 adapter schematic and PCB are available in the Bus Pirate 5 hardware repository.

BOM

ItemQuantityReferenceValuePackage
14C1, C2, C6, C70.1uFCapacitor_SMD:C_0805_2012Metric
26C3, C4, C5, C8, C9, C100.47uFCapacitor_SMD:C_0805_2012Metric
31D2LEDLED_SMD:LED_0805_2012Metric
41J1COM1Connector_Dsub:DSUB-9_Male_Horizontal
61J3Conn_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_Vertical
71J4COM2Connector_Dsub:DSUB-9_Female_Horizontal
81R22KResistor_SMD:R_0805_2012Metric
92U1, U2MAX3232Package_SO:SOP-16_3.9x9.9mm_P1.27mm

Resources

Get Bus Pirate 5

Community

Documentation

Bus Pirate 5 documentation is broken into hardware and firmware sections. Here's some other fun stuff you might enjoy.