Instrumentation & Automation
Application for Windows ⁄ Android
Alexander Bratsuk, Kiev.

RS232 interface


RS232 - the standard of the asynchronous interface (serial port), was at one time the most popular interface for digital devices for various purposes. In the first computers, his physical presence was mandatory. Even now, the Windows operating system is capable of emulating a number of virtual COMs without having their physical implementations. Some probably remember computer mice, printers, scanners and other peripherals connected to the computer through this port.

Now the situation has changed, the computer peripherals are connected to the PC using faster USB ports. But in instrumentation, RS232 takes the rightful place, it is rare to see a digital device that can be configured by a computer without this interface. Quite often RS232 port serves as a transition link to the RS485 interface, connected via a miniature adapter.

The information in RS232 is transmitted in duplex mode

Due to the design features, the length of the communication line is small, usually no more than 10 meters.

Initially, the interface RS232 connector was designed as a 25-pin connector. In this DB25 connector, a secondary RS232 serial channel was also provided. But in practice, only one channel was realized. Computers in which both channels were presented were very rare, for example Sun SparcStation 10/20 and Dec Alpha Multia. Also on some modems there was a secondary channel, it signaled the status of the modem, while the primary one was busy with data transmission. In our time, the more 9-pin DB9 version of RS232 has taken root.

Pinout of the RS232 connector

9-pin RS232 connector
9-pin (DB9) RS232 connector
25-pin RS232 connector
25-pin (DB25) RS232 connector

On the diagram of the 25-pin RS232 connector, the black color indicates the pins common to both types of connectors. The figure and the table below show how to connect the adapter from the 25-pin connector to the 9-pin connector.

Adapter cable from 25 pin RS232 to 9 pin

Adapter cable from 25 pin RS232 to 9 pin
18Data carrier detect
23Receive data
32Transmit data
420Data terminal ready
57Signal ground
66Data set ready
74Request to send
85Clear to send
922Ring indicator

Plug for RS232

Below is the RS232 connector pinout for testing computer serial port. Data and handshake lines connected. In this case, the sent data is immediately returned back and analyzed by the standard serial port verification software.

1 + 4 + 66 + 8 + 20DTR -> CD + DSR
2 + 32 + 3Tx -> Rx
7 + 84 + 5RTS -> CTS

Plug for 9 pin RS232
Plug for 25 pin RS232

Null-modem cables for RS232

The simplest way to connect two computers together is to use a null modem RS232 cable. For a simple solution, a three-wire RS232 scheme is sufficient, where one wire is the signal ground, the second is the receiver, and the third is the transmitter. But depending on the type of software, some kind of handshake may be required. Below are the most popular types of null modem cables for RS232.

Simple null-modem cable without handshaking

Simple null-modem cable without handshaking

This simple pinout of the cable does not allow monitoring of data transmission and reception at the «hardware level», but at the software level, monitoring is possible using XOFF analysis and XON symbols. Not all programs are able to work with such a cable. This is more a theoretical concept. There are also cables with a handshaking simulation on a «stub» and partial handshaking without the ability to control the data transmission at the «hardware level». The following is the RS232 cable wiring with full handshaking recommended by Microsoft.

RS232 null modem cable with full handshaking

RS232 null modem cable with full handshaking

Here, seven wires are used, and this RS232 pinout has become essentially standard.