Digital Logic & Microprocessor — Microprocessor System, NEC licence examination syllabus (Nepal Engineering Council).
Serial Interface Standards: RS-232 and its successors
A 1962 standard with backwards voltage levels that refuses to die.
Agreeing on framing isn't enough — the two ends must also agree on voltages, connectors and which wire does what. RS-232 was that agreement, and although it's slow and bulky by modern standards, its logic survives in every USB-to-serial adapter, every industrial controller and every router console port you'll ever plug into.
RS-232 electrical characteristics
Voltage levels — note they are INVERTED and BIPOLAR:
Logic 1 (MARK) = −3 V to −25 V (typically −12 V)
Logic 0 (SPACE) = +3 V to +25 V (typically +12 V)
−3 V to +3 V = undefined (dead zone for noise immunity)
Other specifications:
Maximum cable length : 15 m (50 feet) at 20 kbps
Maximum data rate : 20 kbps officially
(115.2 kbps common in practice)
Signalling : single-ended (referenced to ground)
Connector : DB-25 originally, DB-9 in practice
Why the inverted, bipolar levels? A ±12 V swing gives a
24 V difference between logic states, versus TTL's 5 V —
far more noise immunity over a long cable. The inversion is
a historical artefact of teleprinter current loops.
The level inversion is why you cannot connect an RS-232 port directly to a microcontroller. A MAX232 chip (or similar) is required: it converts TTL 0/5 V to RS-232 ±12 V and back, and inverts. Connecting them directly means the −12 V will damage the TTL input. Exam questions about "why is a level converter needed" want both reasons: voltage magnitude and polarity.
The important signals
DB-9 pinout (DTE, i.e. the computer end):
Pin 1 DCD — Data Carrier Detect
Pin 2 RxD — Receive Data ← data in
Pin 3 TxD — Transmit Data ← data out
Pin 4 DTR — Data Terminal Ready
Pin 5 GND — Signal Ground
Pin 6 DSR — Data Set Ready
Pin 7 RTS — Request To Send ← flow control
Pin 8 CTS — Clear To Send ← flow control
Pin 9 RI — Ring Indicator
Minimum working connection: TxD, RxD, GND (3 wires)
With hardware flow control: add RTS and CTS (5 wires)
DTE vs DCE:
DTE (Data Terminal Equipment) = computer, terminal
DCE (Data Communication Equip.) = modem
A DTE-to-DTE connection needs a NULL MODEM cable, which
swaps TxD/RxD (and RTS/CTS) so each end's output reaches
the other's input.
Comparison with the other standards
Standard Signalling Max rate Max length Devices
──────────────────────────────────────────────────────────
RS-232 single-ended 20 kbps 15 m 1:1
RS-422 differential 10 Mbps 1200 m 1:10
RS-485 differential 10 Mbps 1200 m 32:32
USB 2.0 differential 480 Mbps 5 m 127
I²C open-drain 3.4 Mbps ~1 m many
SPI single-ended 50+ Mbps ~0.3 m 1:many
The key technical difference: RS-422/485 use DIFFERENTIAL
signalling — the data is the VOLTAGE DIFFERENCE between two
wires. Noise picked up affects both wires equally and
cancels out in the subtraction, so much longer cables and
higher speeds become possible.
Worked numerical 1 — cable length and data rate
Why is RS-232 limited to 15 m, and how does differential signalling in RS-485 extend that to 1200 m?
RS-232 limit — cable CAPACITANCE:
Specification caps total load at 2500 pF.
Typical cable: ~50 pF per metre (conductor to ground)
Maximum length = 2500/50 = 50 metres of raw capacitance
budget, derated to 15 m for reliable edges.
The RC time constant of the driver resistance and cable
capacitance rounds off the edges. Longer cable → slower
edges → the receiver can't find the transitions.
RS-485 differential advantage:
Signal = V(A) − V(B), two wires twisted together.
Noise induced on the pair appears on BOTH wires equally
(common mode), so the subtraction cancels it:
(V_A + noise) − (V_B + noise) = V_A − V_B ✔
Common-mode rejection typically 60+ dB.
Also uses smaller swings (±200 mV threshold instead of
±3 V), so less current and faster edges.
Result: 80× the cable length at 500× the data rate. That
is why industrial systems (Modbus, DMX lighting, building
automation) standardised on RS-485.
Worked numerical 2 — flow control
A device receives data at 115 200 baud but can only process 5000 bytes/second. Explain how flow control prevents data loss and compute the buffer needed for a 1-second burst.
Incoming rate at 115 200 baud (8N1):
115 200/10 = 11 520 bytes/second
Processing rate: 5000 bytes/second
Excess: 11 520 − 5000 = 6520 bytes/second accumulating
For a 1-second burst:
buffer needed = 6520 bytes → use 8 KB
HARDWARE flow control (RTS/CTS):
When the buffer reaches a high-water mark (say 75% full),
the receiver de-asserts RTS. The sender sees CTS drop and
stops after the current character. When the buffer drains
to a low-water mark, RTS reasserts.
SOFTWARE flow control (XON/XOFF):
Receiver sends XOFF (13H) to pause, XON (11H) to resume.
Advantage: works with only 3 wires.
Disadvantage: those two byte values can't appear in the
data, so it is unusable for binary transfers.
Without flow control the buffer overflows and bytes are
silently lost — which is the classic cause of corrupted
serial data in the field.
💡 Exam angle: the RS-232 voltage levels with their inversion are direct recall marks, and so is the reason a MAX232 is needed. The comparison table (RS-232 vs RS-422 vs RS-485) with the differential-signalling explanation is the highest-value part. Know the minimum 3-wire connection and what a null modem does.
Syllabus points
RS-232 and other standards
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.