In short: RS-232 is a single-ended serial standard that signals with bipolar voltages (a logic 1 is -3 to -15 V, a logic 0 is +3 to +15 V), so the line is inverted relative to TTL, and a DTE (the terminal or PC) always transmits on the pin that a DCE (the modem) receives on.
Every embedded engineer eventually meets a board with a DB9 connector and a UART console. Behind that connector sits RS-232, a standard from 1960s telephony that refuses to die. Interviewers like it because it tests whether you understand voltage levels, polarity, handshaking and why a line driver chip such as the MAX232 exists. This article walks through those ideas with numbers you can check on a scope.
Where RS-232 came from
The Electronic Industries Association published RS-232 so that a terminal could talk to a telephone modem. The modern revision, TIA-232-F, still describes that arrangement: a Data Terminal Equipment (DTE) on one side, Data Communication Equipment (DCE) on the other, and a cable between them. The standard defines the electrical signal levels, the connector pin functions, and the meaning of the control lines. It does not define the character format; that belongs to the UART at either end. Baud rates up to roughly 20 kbit/s over 15 m (50 ft) were the original target, though 115,200 baud over short cables is routine today.
Electrical levels: why bipolar and why wide
A UART inside an MCU speaks 0 V and 3.3 V (or 5 V). RS-232 does something different: it swings the line on both sides of ground.
- A driver must output at least +5 V and at most +15 V for a logic 0 into a 3 kΩ to 7 kΩ load, and between -5 V and -15 V for a logic 1.
- A receiver must recognise anything above +3 V as logic 0 and anything below -3 V as logic 1.
- The band between -3 V and +3 V is a transition region, and the receiver's output there is undefined.
The gap between the driver's guaranteed 5 V and the receiver's 3 V threshold leaves about 2 V of noise margin. That is generous for a single-ended link and is the reason RS-232 survives long, unshielded cables in a noisy factory. A TTL signal with a 0.4 V margin would not.
Key fact: The common "RS-232 is +/-12 V" shorthand comes from the typical rails used by drivers; the standard itself allows up to +/-25 V open-circuit and +/-15 V into a load, so a receiver must tolerate far more than it needs.
Logic inversion: mark, space and the idle line
Here is the part that trips candidates. RS-232 is negative logic: a binary 1 is a negative voltage (called MARK) and a binary 0 is a positive voltage (called SPACE). The idle state of an asynchronous line is MARK, so a quiet line sits at about -10 V. Compare that to a TTL UART, where idle is high.
A level shifter such as the MAX232 (or MAX3232 for 3.3 V) therefore does two jobs at once: it inverts, and it level-translates. Its internal charge pumps create roughly +/-10 V from a single 5 V supply using four 1 µF capacitors, which is why those little caps are on every board. The start bit is a logic 0, so it appears on the wire as a rising edge to positive voltage, which is what wakes the receiver.
DTE versus DCE: who drives which pin
The roles define pin direction. On a DB9 connector wired as DTE (a PC serial port), pin 3 is TxD (output), pin 2 is RxD (input), pin 5 is signal ground. A DCE reverses the direction, so its pin 2 is the output and pin 3 is the input. Because the two roles are opposite, a straight-through cable joins pin 2 to pin 2 and pin 3 to pin 3 and works between a PC and a modem.
Two DTEs (a PC and a router console, say) both transmit on pin 3, so the cable must cross them. That crossed cable is a null-modem cable: TxD to RxD, RTS to CTS, DTR to DSR and DCD.
| Signal | DB9 pin | Direction (from DTE) | Purpose |
|---|---|---|---|
| TxD | 3 | Out | Transmitted data |
| RxD | 2 | In | Received data |
| RTS | 7 | Out | DTE ready to send |
| CTS | 8 | In | DCE clear to receive |
| DTR | 4 | Out | DTE powered, ready |
| DSR | 6 | In | DCE ready |
| DCD | 1 | In | Carrier detected |
| GND | 5 | - | Signal reference |
Key fact: Many consumer devices (GPS modules, Arduino shields) label their pins from their own point of view, so "TX" on a datasheet may mean "my transmit pin", not "connect to the other side's TX". Always cross TX to RX, then check the voltage domain.
Flow control and handshaking
Hardware flow control uses RTS and CTS. A receiver whose buffer is nearly full drops CTS (to the negative level), and the sender stops after the current character. Software flow control sends XOFF (0x13) and XON (0x11) in-band, which is simpler on a three-wire link but breaks binary protocols that may contain those byte values. Three-wire connections (TxD, RxD, GND) with no handshaking remain the most common in practice, which is why a firmware console can overflow a slow PC terminal at 921,600 baud.
Legacy use and why it still matters
You will meet RS-232 in PLC programming ports, CNC controllers, lab instruments with SCPI over serial, point-of-sale hardware, network switch console ports, and the debug UART that every bring-up team uses. Even where the connector is USB, a bridge chip such as an FTDI FT232 or CP2102 exposes a virtual COM port, usually at TTL level. Remember that a TTL UART directly wired to a true RS-232 port will fail: the -10 V idle line can damage a 3.3 V input.
The limits are real. Single-ended signalling means a ground offset between two buildings adds directly to the signal, speed collapses with cable capacitance (the standard caps load at 2,500 pF), and there is no multidrop capability. For differential, long-distance, multi-node work engineers moved on; see our comparison in RS-232 vs RS-485, and for a faster peer-to-peer option read the UART protocol explained.
In ASIC and FPGA design, the RS-232 side never appears on silicon. You verify the UART block in simulation with Synopsys VCS, Cadence Xcelium or Siemens Questa using a bit-banged model, then rely on a board-level transceiver. If you need help turning that into a working board, the team at Avecas design services does exactly that kind of bring-up.
Common interview traps
- Saying logic 1 is positive. In RS-232 it is negative; TTL differs.
- Forgetting that a null-modem swaps TxD and RxD but must keep ground straight.
- Quoting 1.8 V or 3.3 V levels. RS-232 is never CMOS-level; a transceiver is needed.
- Assuming RS-232 specifies framing. It only specifies electrical and mechanical characteristics.
Want to go from theory to a working serial link and a verified UART in RTL? Join the embedded and protocols modules in our CourseTron courses, or explore hands-on VLSI training at ChipXpert.
FAQ
Why does RS-232 use negative voltage for logic 1?
Telegraph and teletype heritage: a current-carrying "mark" represented idle. The standard kept the idle state at negative voltage, which also means a disconnected line (floating near 0 V or pulled by the receiver's internal resistor) is easy to distinguish from a real signal.
Can I connect an MCU UART directly to a PC RS-232 port?
No. The MCU outputs 0 V and 3.3 V or 5 V in positive logic, while the PC expects bipolar levels. Use a MAX3232-style transceiver, which both inverts and shifts levels.
What is the difference between a straight and a null-modem cable?
A straight cable connects pins one-to-one for DTE-to-DCE links. A null-modem cable crosses TxD and RxD (and the handshake pairs) so that two DTEs can talk.
How far can RS-232 run?
The original specification quoted 15 m at 20 kbit/s. Low-capacitance cable at 9,600 baud commonly reaches several hundred metres, but noise immunity falls because the signal is single-ended.