RS232 is one of the oldest and most well-known serial communication standards. It was widely used for communication between computers, modems, industrial equipment and embedded systems long before modern interfaces like USB became common.
Even today, RS232 is still used in industrial equipment, laboratory instruments, POS systems, serial consoles and legacy devices where simple point-to-point communication is required.
What Is RS232?
RS232 is an electrical standard for serial communication. It defines voltage levels, signal behavior and connector conventions.
RS232 is often used together with UART communication, but RS232 and UART are not the same thing.
- UART defines the data format, such as start bit, data bits and stop bit
- RS232 defines the electrical voltage levels and signal behavior
A microcontroller UART pin cannot be connected directly to a real RS232 port without a level converter.
RS232 Voltage Levels
RS232 uses voltage levels that are very different from normal microcontroller logic.
Typical RS232 behavior:
- Logic 1, also called mark or idle: negative voltage
- Logic 0, also called space: positive voltage
This is different from 3.3V or 5V logic, where LOW is near 0V and HIGH is a positive voltage.
Why a Level Converter Is Required
Because RS232 uses positive and negative voltages, a microcontroller cannot safely connect directly to an RS232 port.
Common converter chips include:
- MAX232 or compatible chips for 5V systems
- MAX3232 or compatible chips for 3.3V systems
These chips convert logic-level UART signals to RS232 voltage levels and convert incoming RS232 signals back to logic-level UART.
DTE and DCE
RS232 uses the terms DTE and DCE.
- DTE: Data Terminal Equipment, typically a computer, controller or host
- DCE: Data Communication Equipment, typically a modem, peripheral or device
This distinction matters because transmit and receive directions are defined from the point of view of the device type.
A pin that is transmit on the DTE side is receive on the DCE side. This is one of the main reasons RS232 wiring can be confusing.
Sub-D9 / DB9 Pin Assignment
The most common RS232 connector is the 9-pin Sub-D connector, often called DB9.
The table below shows the common DB9 assignment for a DTE host and the matching DCE device side. The important point is that TX and RX are opposite directions on the two sides.
| Pin | DTE Host Side | Direction on DTE | DCE Device Side | Direction on DCE |
|---|---|---|---|---|
| 1 | DCD input | Input | DCD output | Output |
| 2 | RXD input | Input | TXD output | Output |
| 3 | TXD output | Output | RXD input | Input |
| 4 | DTR output | Output | DSR input | Input |
| 5 | Signal Ground | Ground | Signal Ground | Ground |
| 6 | DSR input | Input | DTR output | Output |
| 7 | RTS output | Output | CTS input | Input |
| 8 | CTS input | Input | RTS output | Output |
| 9 | RI input | Input | RI output | Output |
In many embedded applications, only three signals are used:
- TX
- RX
- GND
However, it is important to check whether the connector is wired as DTE or DCE before deciding whether TX and RX must be crossed.
Straight Cable vs Null Modem Cable
A straight RS232 cable is normally used between a DTE device and a DCE device. In this case, pin 2 goes to pin 2 and pin 3 goes to pin 3, because the signal direction is already opposite on both sides.
A null modem cable is used when connecting two DTE devices together, such as two computers or a computer and a controller that is also wired as DTE.
- DTE to DCE: normally straight cable
- DTE to DTE: normally null modem cable
- DCE to DCE: also requires crossed wiring
This is why RS232 wiring cannot be judged only by pin numbers. The device type matters.
Communication Parameters
RS232 communication uses the same basic serial settings as UART.
Common parameters:
- Baud rate
- Data bits
- Parity
- Stop bits
A very common setting is 9600 baud, 8 data bits, no parity and 1 stop bit, often written as 9600 8N1.
Hardware Handshaking
RS232 can use additional handshaking signals to control data flow.
Common handshake signals:
- RTS: Request To Send
- CTS: Clear To Send
- DTR: Data Terminal Ready
- DSR: Data Set Ready
Many simple embedded systems do not use hardware handshaking and only connect TX, RX and GND.
Some older equipment, however, may require handshake lines to be connected or tied to the correct state before communication works.
RS232 Compared with TTL UART
| Feature | TTL UART | RS232 |
|---|---|---|
| Voltage levels | 0V / 3.3V or 0V / 5V | Positive and negative voltages |
| Signal polarity | Normal logic polarity | Inverted compared with TTL logic |
| Cable distance | Short | Moderate |
| Direct MCU connection | Yes | No, converter required |
| Typical use | Board-level serial communication | External serial ports and legacy equipment |
RS232 Compared with RS485
| Feature | RS232 | RS485 |
|---|---|---|
| Communication type | Point-to-point | Multi-device bus |
| Signaling | Single-ended | Differential |
| Noise immunity | Moderate | High |
| Cable length | Limited | Much longer possible |
| Typical use | Legacy serial devices | Industrial networks |
Typical RS232 Devices
RS232 is still found in:
- Industrial machines
- Laboratory instruments
- Barcode scanners
- POS systems
- Serial consoles on routers, switches and servers
- Older GPS receivers and measurement devices
- PLC and automation equipment
Many devices still include RS232 because it is simple, reliable and well understood.
Cable Length and Noise
RS232 can work over longer distances than direct TTL UART, but it is not ideal for very long cables or electrically noisy environments.
Important points:
- Lower baud rates usually allow longer cable runs
- Shielded cable can improve reliability
- RS232 is less robust than RS485
- Ground reference still matters
For long-distance industrial wiring, RS485 is usually the better choice.
Common RS232 Problems
Typical RS232 issues include:
- No RS232 level converter used
- TX and RX connected incorrectly
- Wrong assumption about DTE or DCE wiring
- Wrong cable type: straight cable vs null modem cable
- Wrong baud rate or serial format
- Missing signal ground
- Handshake lines required but not connected
If communication does not work, checking whether the two devices are DTE or DCE is often just as important as checking the baud rate.
Debugging RS232
Useful debugging steps:
- Confirm whether the port is real RS232 or TTL UART
- Check the baud rate and serial format
- Check whether a straight or null modem cable is required
- Confirm that signal ground is connected
- Use a USB-to-RS232 adapter for testing
- Use a logic analyzer only on the TTL side of the converter
Do not connect a low-voltage logic analyzer directly to RS232 voltage levels unless the analyzer is specifically designed for that.
When to Use RS232
RS232 is useful when:
- You need to communicate with existing RS232 equipment
- The connection is point-to-point
- The cable distance is moderate
- The data rate is not extremely high
- Compatibility with legacy devices matters
When Not to Use RS232
RS232 may not be the best choice when:
- You need multiple devices on one bus
- You need long cable distances
- The environment is electrically noisy
- You are designing a new industrial multi-device network
In these cases, RS485, CAN Bus, Ethernet or another interface may be more appropriate.
Conclusion
RS232 is an old but still important serial communication standard. It remains useful because many industrial, laboratory and legacy devices still rely on it.
The most important practical detail is that RS232 pin names depend on whether the device is wired as DTE or DCE. Pin 2 and pin 3 are not universally “RX” and “TX” in every situation. The device type and cable type must always be considered.
For simple point-to-point communication with existing equipment, RS232 is still very useful. For longer distances, noisy environments or multiple devices on one cable, RS485 is usually the better choice.
