Core Networking · Study deck
UART and RS-232 Protocols
A sensor console prints nonsense when connected to a legacy instrument.
Packet Pete is your guide for this deck.
After studying this chapter
Learning objectives
You will be able to:
- Explain: The scale on the left of Figure: RS-232 uses inverted high-voltage signaling runs from plus fifteen volts to minus fifteen, and the two logic bands sit at its extremes.
- Explain: A serial record should preserve connector gender, viewpoint, pin numbers, signal direction, and cable type, because a continuity test can pass while a mirrored interpretation still swaps TX and RX.
- Explain: The serial-link record below must name each endpoint, the viewed side of the pinout, voltage standard, and any flow-control wires, then verify them on the actual link.
Major section
Start With Two Devices Sending Bytes
A microcontroller means a small computer on one chip that reads inputs and controls a device.
- UART is the simplest useful story for many devices: one side sends timed bits, the other samples them, and both must agree on framing and speed.
- That simplicity is why UART is common for consoles, sensors, modules, and debugging.
- It also means the evidence must be practical: voltage level, ground reference, baud rate, framing, and what each received byte is supposed to mean.
Major section
Overview: UART Sends Bytes Without A Clock Wire
The line rests high while nothing is being sent.
- The start bit is a single low, and it exists only to mark the moment the receiver should begin counting.
- An optional parity bit sits after them, then one or two stop bits return the line to its idle level, ready for the next byte.
- The whole of Figure: UART frame diagram moves from idle-high line to is therefore an agreement made in advance.
Major section
Overview: UART Sends Bytes Without A Clock Wire (continued)
Both ends must already share the bit rate and the frame shape, or the bits are counted in the wrong places.
- The line begins idle, then the falling start bit gives the receiver a timing reference.
- It samples the data bits near their centres using its own baud-rate clock, optionally checks parity, and expects a stop bit at the idle level.
- For an 8-N-1 frame, eight data bits plus start and stop make 10 bits; at 9600 bit/s, one frame takes 10 / 9600 s = 1.04 ms.
Major section
Practitioner: Keep A Serial Link Record
Positive means zero here and negative means one, the reverse of the convention a microcontroller pin uses.
- The photo shows several DB9/RJ45 adapter pieces beside a handwritten pinout note.
- A connector shape and a handwritten note do not prove which pins the installed peer uses.
- Two results follow, and both belong in the link record.

Major section
Practitioner: Keep A Serial Link Record (continued)
The serial-link record below must name each endpoint, the viewed side of the pinout, voltage standard, and any flow-control wires, then verify them on the actual link.
- That single fact settles what each end can mate with, and it is not visible in any wiring diagram.
- Contact gender, retention and installed length are three entries the link record needs, and the name RS-232 supplies none of them.
- The scale on the left of Figure: RS-232 uses inverted high-voltage signaling runs from plus fifteen volts to minus fifteen, and the two logic bands sit at its extremes.

Major section
Practitioner: Keep A Serial Link Record (continued)
Between them lies a band around zero that decodes to nothing at all, so noise landing there is simply undefined.
- A level shifter is needed before any 3.3 or 5 volt pin, and the wide swing is what buys this link its noise tolerance over roughly fifteen metres.
- Handshake lines must be crossed or intentionally omitted according to the configured flow control.
- A serial record should preserve connector gender, viewpoint, pin numbers, signal direction, and cable type, because a continuity test can pass while a mirrored interpretation still swaps TX and RX.
Major section
Under The Hood: Timing Error Accumulates Across The Frame
A start bit tells the receiver when to sample the data bits, and stop bits check the end of the frame.
- USB adds a host, device setup, named end points, framed moves, and error checks.
- An adapter links the two systems, but it does not make their voltage, pins, flow control, or UART settings the same.
- No protocol is named and no property is scored.
Major section
Separate a Framing Error from a Voltage Mismatch
At 19,200 bits per second, one bit lasts about 52.08 microseconds and a full frame takes about 520.8 microseconds.
- A 64-byte record takes about 33.33 ms without gaps.
- Its nominal bit period is about 104.17 microseconds, twice the transmitter's.
- Timing and wiring are separate checks.
Major section
Separate a Framing Error from a Voltage Mismatch (continued)
The next byte needs space or an explicit overflow policy.
- It samples the incoming signal on the wrong time scale, so clean voltage transitions cannot produce the intended byte stream.
- The receiver uses that transition to establish timing for one frame.
- This module makes serial troubleshooting a sequence of measurable boundaries.
Major section
Separate a Framing Error from a Voltage Mismatch (continued)
The wiring figure at Figure: UART frame diagram moves from idle-high line to then connects transmit to receive with the required reference.
- RS-232 signalling needs the appropriate electrical interface; direct connection to a low-voltage UART pin can be unsafe for the component.
- For example, an incoming 64-byte burst fills a 64-byte receive buffer completely if nothing is removed during that interval.
- Adding a shared clock is not the remedy; servicing the buffer or controlling the source rate addresses the observed failure.

Deck summary
Key takeaways
A microcontroller means a small computer on one chip that reads inputs and controls a device.
- The line rests high while nothing is being sent.
- Both ends must already share the bit rate and the frame shape, or the bits are counted in the wrong places.
- Positive means zero here and negative means one, the reverse of the convention a microcontroller pin uses.
- The serial-link record below must name each endpoint, the viewed side of the pinout, voltage standard, and any flow-control wires, then verify them on the actual link.
Retrieval practice
Recall check 1 of 3

Packet Pete says: answer from memory, then check your reasoning.
Q1A 3.3 V irrigation controller must read a water-meter module whose data sheet says 9600 baud, 8N1, TTL UART over a short harness. What must the release record prove before the field board is approved?
Show answer
Answer: C A working UART link requires matching timing, framing, electrical compatibility, physical wiring, and the actual installed harness.
Retrieval practice
Recall check 2 of 3

Packet Pete says: answer from memory, then check your reasoning.
Q2A 3.3 V microcontroller must read a legacy device with a DB9 connector labeled RS-232. What is the safest next step?
Show answer
Answer: D RS-232 and TTL UART can carry similar serial data, but they need a translator because their electrical levels differ.
Retrieval practice
Recall check 3 of 3

Packet Pete says: answer from memory, then check your reasoning.
Q3A pump-house UART debug link works at 9600 baud but drops bytes intermittently at 115200 baud on the production cable. Which review question is most useful?
Show answer
Answer: D UART failures at higher baud rates often expose timing, voltage, cable, edge-rate, or oscillator margin problems that were hidden at slower rates.
Print reference
Answers
Answer key.
- C · A working UART link requires matching timing, framing, electrical compatibility, physical wiring, and the actual installed harness.
- D · RS-232 and TTL UART can carry similar serial data, but they need a translator because their electrical levels differ.
- D · UART failures at higher baud rates often expose timing, voltage, cable, edge-rate, or oscillator margin problems that were hidden at slower rates.