Raspberry Pi serial port: Ribbon or no ribbon?
The interest in an RS-232 serial port for the Raspberry Pi has LAVA considering making a simple GPIO-to-RS-232 DB-9 serial port board. This little item would plug onto the Raspberry Pi’s GPIO pin header, take the Raspi’s UART signals up to RS-232 levels, and present them on a conventional DB-9 (aka DE-9) connector. It would save a lot of people the trouble of individually sourcing components and parts, futzing around with pinouts, line drivers, and soldering, and ending up with a messy bread-boarded product at the end of it all.
So the question for all you out there thinking about using the Raspberry Pi to connect to an RS-232 peripheral is this: if you could have a tidy single-board serial port that would plug onto the GPIO of the Raspberry Pi, would you want it to plug directly onto the GPIO pins or would you want it led off the Raspberry Pi’s board with a ribbon cable? Reply to this post to let me know!
RS-232 Serial Crossover Cables
The range of serial cabling includes crossover cables, sometimes called null modem cables. This post fills out the information on crossover cables, as at times confusion about them can cause systems not to work.
When two pieces of Data Terminal Equipment (terminals, or DTEs) need to be connected to each other, or two pieces of Data Circuit-terminating Equipment (modems, or DCEs) need to be connected to each other, a serial crossover or null modem cable is used. These cables align incoming signals with the corresponding outgoing signals on the other side of the connection. At a minimum, the Transmit Data (TD) line of a serial link needs to be paired with the corresponding Receive Data (RD) line on the other device.
Why would one need such a cable?
- It can be a way of connecting two PCs without networking interfaces such as Ethernet, making direct file transfers between systems possible.
- It can be a method for technically-minded users to debug systems with minimal software overhead (that is, as little code and as few drivers as possible).
- It can provide access to a serial console when problems make the local monitor and keyboard of a computer unavailable, or when a computer is being remotely operated or operated “headless” (that is, without a monitor, keyboard and mouse).
Not all null modem cables are the same however, and some cables will not work in specific applications. The three standard types of null modem cables are described here, for DB-9 to DB-9 and DB-25 to DB-25 connections, making six variations. I haven’t shown the three DB-9 to DB-25 versions, which in any case are just the DB-9 side at one end and the DB-25 side at the other (see below, “9-Pin to 25-Pin Connection”). The bottom line is: there are nine variants of RS-232 crossover cables.
The first, “No Handshaking,” swaps the complementary data transmit and receive lines. This is the minimum needed for a crossover connection. This cable will work as a crossover cable when control lines are not needed for the link. It cannot be used when hardware handshaking is required. It can be used when hardware flow control has been turned off on the serial ports involved, but doing so will simply bypass the control lines regardless of their state.
The second, “Full Handshaking,” swaps the data lines as well as the control lines needed for handshaking/flow control. The pairs of lines needed for handshaking are DTR/DSR and RTS/CTS This cable crosses these pairs between the two ends of the cable. This cable will work as a crossover cable when control lines are not needed for the link, or when hardware handshaking is required. It can be used when hardware flow control has been turned off on the serial ports involved, but doing so will simply bypass the control lines regardless of their state.
The third, “Loopback Handshaking,” swaps the data transmit and receive lines, but the DTR/DSR and RTS/CTS pairs are not swapped with their complements. Instead, the DTR line on one side of the link is looped back to the DSR line on the same side of the link, and the RTS line on one side of the link is looped back to the CTS on the same side of the link. This cable will work as a crossover cable when control lines are not needed for the link. It can be used regardless of the on/off state of hardware flow control on the serial ports involved, but will “fool” the link into accepting that hardware handshaking has been completed. It cannot be used when true hardware handshaking is required.
If one side of a serial crossover cable uses a 9-pin connector and the other side uses a 25-pin connector, the lines map between these two connectors as follows:
Aside: Payment Processing Terminals and Serial Crossover (Null Modem) Cables
LAVA’s experience connecting modem-based payment terminals with serial device servers is relevant to this discussion of crossover cables. This scenario uses a null modem cable between the serial device server and the payment terminal. While some payment terminals require only RX and TX lines, LAVA recommends using a “Full Handshaking” cable with the line signaling unless you are certain that control signals are not used. LAVA does NOT recommend a cable that uses “Loopback Handshaking”. Care should be taken when purchasing null modem cables as not all packages indicate clearly what type of null modem cable is being sold.
DNC Machining Control
Controlink Systems makes software designed for controlling machining and manufacturing equipment, over RS-232 (the standard interface). Direct Numerical Control (DNC) is used to control machining equipment when the machine itself does not issue the processing commands.
Controlink Systems software meshes nicely with LAVA’s serial interfaces, whether PCI, PCIe, or Ethernet-to-Serial device servers.
Plasma Cutter Control
Tiba Restaurant Equipment makes high-end consumer and commercial kitchen and restaurant equipment, including hot tables, counters, refrigerators, sinks, and barbeques. Their work consists largely of metalwork design and fabrication, primarily in stainless steel for pieces of equipment, and in galvanized metal for ductwork for installations in restaurants, hotels, banquet halls, kitchens, and residential homes.
Tiba’s metal cutting designs are created on a computer that has patterns and templates, and specialized software for ductwork design. When Tiba is ready to cut material, these designs are sent to Tiba’s Cybermation plasma cutting table, where much of their metal cutting is carried out. The connection between computer and cutting table is RS-232 serial, handled by a LAVA SSerial-PCI card.
Their metal cutting capability is critical to Tiba’s business, and the reliability that comes with a LAVA card is key to their success.









