ศิลปะ
ความงามและสุขภาพ
งานฝีมือ
วัฒนธรรมและประวัติศาสตร์
ความบันเทิง
สิ่งแวดล้อม
อาหารและเครื่องดื่ม
วิศวกรรมย้อนรอย
วิทยาศาสตร์
กีฬา
เทคโนโลยี
อุปกรณ์สวมใส่

The UART and Start-Stop Framing
Two machines, one wire, and no shared clock. That is the whole problem, and everything else in this batch is built on the answer to it.
A human telegraphist needed no convention: Morse has rhythm, and a listener locks onto it without being told. A machine has an oscillator that is a percent or two off, drifting with temperature, and it cannot hear rhythm. It needs to be told exactly when a character starts.
The answer came from teleprinters and it is almost embarrassingly simple. Hold the line at MARK when idle. Drop it to SPACE for exactly one bit time — that is the start bit, and its falling edge is the only timing reference in the entire system. Send the data bits, least significant first. Then return to MARK for at least one bit time, the stop bit, so the line is guaranteed back at idle and the next falling edge is unambiguous.
It costs two bits in every ten, a flat twenty percent, and it buys a clock tolerance of about five percent split between the two ends — which a cheap RC oscillator can hold. That trade is the whole design. Resynchronise often and you may use a bad clock; resynchronise rarely and you need a crystal, which is the road that leads to Ethernet's preamble seven blueprints later.
FULLY BUILDABLE. Bit-bang a frame, look at it on a scope, then walk the receiver's baud rate off by a percent at a time and find where it breaks. The stop bit fails before the data does, every time, and that is not a coincidence — it is the last bit sampled and it carries the most accumulated error.
เริ่มต้น
3 hours
คำแนะนำ
1
1
Where the framing came from
Where the framing came from
Work the Baudot blueprint first. It gives you the fixed-length character code — five bits, always five, unlike Morse's variable lengths — that makes machine reception possible at all.
What Baudot does NOT settle is when a character begins. A teleprinter's mechanism solved it with a start pulse that released a rotating distributor and a longer stop pulse that let it come to rest, which is where the odd 1.5-bit stop length comes from.
The UART is that mechanism in silicon: same start bit, same idle-at-mark, same least-significant-bit-first order. Nothing was invented. It was electrified.
เครื่องมือที่ต้องใช้:
Notebook and Pencil2
2
Bit-bang a frame and break it deliberately
Bit-bang a frame and break it deliberately
Join GPIO17 to GPIO16 with one jumper and flash the sketch. Put the scope on GPIO17 first and send 0x55: alternating bits give the clearest possible picture of the frame, and you can measure one bit time directly with the cursors.
Then let the sweep run. It walks the receiver's baud rate from ten percent slow to ten percent fast and counts, at each step, how many bytes arrived correctly, how many raised a FRAMING error, and how many arrived as the wrong value.
Framing errors appear BEFORE wrong data. That is the whole lesson: the stop bit is the last thing sampled, so it carries the most accumulated error and fails first — which is exactly why a UART reports framing errors rather than silently handing you rubbish.
bitbang_uart.inocpp
วัสดุสำหรับขั้นตอนนี้:
Jumper Wire Set1 ชิ้นเครื่องมือที่ต้องใช้:
ESP32 Development Board
Digital Oscilloscope
Desktop Computer
Breadboard - Classic3
3
The line driver and the null modem
The line driver and the null modem
Build the MAX232 stage if you want to talk to anything with a nine-pin D connector. It does two jobs: it INVERTS, because RS-232's mark is negative, and it swings to about plus and minus ten volts, which is what let the standard drive fifteen metres of unshielded cable in 1960.
The charge-pump capacitors make those rails from a single five-volt supply. Reversing one is the commonest fault on this circuit and the symptom is a chip that gets hot.
Then read the crossover at the bottom of the schematic. RS-232 assumed a terminal talking to a modem, so transmit and receive are named from opposite ends and a straight cable works. Two computers are both terminals, both transmit on pin 3, and neither hears anything — which is why the null-modem cable had to be invented and had to have a name.
Loading KiCanvas viewer...
Professional PCB Design Viewer
วัสดุสำหรับขั้นตอนนี้:
MAX232 Level Shifter IC1 ชิ้น
Capacitor Kit1 ชิ้น
Resistor Kit (1/4W, E12 Series)1 ชิ้น
DB9 Connector1 ชิ้นเครื่องมือที่ต้องใช้:
Breadboard - Classic
Jumper Wire Set
Digital Multimeter (Lab Grade)
Digital Oscilloscope4
4
Clock tolerance and the awkward crystal
Clock tolerance and the awkward crystal
Loading Jupyter Notebook...
เครื่องมือที่ต้องใช้:
Desktop Computer5
5
Compendium: the cost of having no clock
Compendium: the cost of having no clock
THE TRADE, IN ONE LINE. Two framing bits per eight data bits is twenty percent of the wire spent on saying nothing, and it buys a five percent clock tolerance. Every synchronous protocol after this one spends less on framing and demands a better clock: Ethernet's preamble is 64 bits ONCE per frame rather than two bits per byte, which is far cheaper for a 1500-byte frame and impossible without a crystal.
BREAK, AND WHY IDLE IS MARK. Holding the line at SPACE for longer than a whole frame is a BREAK condition — impossible in normal traffic, because a stop bit must always arrive. It is a signal outside the alphabet, and it exists precisely because idle is mark: a cut wire with a pull-up reads as idle, while a shorted one reads as a permanent break. The choice of which state is idle is what makes those two faults distinguishable.
AGAINST THE DISC. Blueprint 90-3's MFM code solves the same problem — a receiver with no clock — and solves it oppositely, by constraining the DATA so transitions can never be far apart. That works on a disc because the medium is yours to encode. On a wire shared with other equipment you cannot constrain what the other end sends, so you add framing around arbitrary data instead. Same problem, and the answer depends entirely on whether you own the alphabet.
เครื่องมือที่ต้องใช้:
Notebook and Pencilวัสดุ
5- Jumper Wire Setค่าคอมมิชชัน 10%1 ชิ้นตัวยึดตำแหน่ง
- MAX232 Level Shifter ICค่าคอมมิชชัน 100%1 ชิ้นตัวยึดตำแหน่ง
- Capacitor Kitค่าคอมมิชชัน 10%1 ชิ้นตัวยึดตำแหน่ง
- ตัวยึดตำแหน่ง
- DB9 Connectorค่าคอมมิชชัน 100%1 ชิ้นตัวยึดตำแหน่ง
เครื่องมือที่จำเป็น
7- Notebook and Pencilค่าคอมมิชชัน 10%ตัวยึดตำแหน่ง
- ESP32 Development Boardค่าคอมมิชชัน 10%ตัวยึดตำแหน่ง
- ตัวยึดตำแหน่ง
- Desktop Computerค่าคอมมิชชัน 100%ตัวยึดตำแหน่ง
- Breadboard - Classicค่าคอมมิชชัน 10%$10.00
- Jumper Wire Setค่าคอมมิชชัน 10%ตัวยึดตำแหน่ง
- Digital Multimeter - Lab Gradeค่าคอมมิชชัน 10%ตัวยึดตำแหน่ง
บลูพริ้นท์ที่เกี่ยวข้อง
บลูพริ้นท์เหล่านี้แบ่งปันความรู้ — เทคนิค วัสดุ หรือหลักการ
CC0 สาธารณสมบัติ
พิมพ์เขียวนี้เผยแพร่ภายใต้ CC0 คุณสามารถคัดลอก แก้ไข แจกจ่าย และใช้งานผลงานนี้เพื่อวัตถุประสงค์ใดก็ได้ โดยไม่ต้องขออนุญาต
สนับสนุนเมกเกอร์โดยซื้อสินค้าผ่านพิมพ์เขียวของพวกเขา ซึ่งพวกเขาจะได้รับ ค่าคอมมิชชันเมกเกอร์ ที่ผู้ขายกำหนด หรือสร้างเวอร์ชันใหม่ของพิมพ์เขียวนี้และรวมเป็นการเชื่อมต่อในพิมพ์เขียวของคุณเพื่อแบ่งรายได้



