Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)

Divide bit counts from a UART, SPI, I²C or CAN capture by 8 and see the byte figure your firmware buffers actually hold, framing overhead included.

Turning Bits on the Wire Into Bytes in Your Buffer

When you put a logic analyzer on a UART, SPI, I²C or CAN line, the capture is measured in bits. Your firmware, however, works in bytes: a receive buffer of 64 entries, a register map of 12 registers, a payload field limited to 8 bytes. Every time you move between the two views you are dividing by eight, and doing that in your head at 3 a.m. while a frame is failing its checksum is how off-by-one bugs get shipped.

The factor: bytes = bits ÷ 8 (the same as bits × 0.125). A 108-bit CAN 2.0A frame is 108 ÷ 8 = 13.5 bytes of raw line time — only 8 of which are your data payload.

The division is trivial. What trips people up is which bits they just counted. A byte of application data almost never occupies exactly eight bit-times on a physical link, because framing, synchronisation and error detection all borrow room on the same wire.

Line bits vs payload bits

A scope counts every transition on the wire, including start, stop, parity and stuffed bits. Divide those by eight and you get line time expressed in byte-equivalents, not a byte count your MCU will ever store.

Register widths

Datasheets describe peripherals in bits — a 12-bit ADC result, a 24-bit accumulator, a 40-bit sensor sample. Converting to bytes tells you how many buffer slots and how much padding each read really costs.

Timing budgets

Bit-time is the unit that matters for interrupt latency and DMA sizing. Convert the bits in a burst to bytes and you know whether your FIFO drains before the next frame arrives.

Converting a Capture Step by Step

1

Count the bits you actually mean

Decide first whether you are counting payload bits or every bit the analyzer saw. For an 8N1 UART byte those are 8 and 10 respectively — two different answers to the same question.

2

Type the bit count in

Enter the figure in the bits field. The byte value updates as you type, so you can walk a whole frame breakdown without pressing anything. Long decoder exports often carry spaces or a comma decimal mark — both are accepted and spaces are ignored.

3

Copy the number straight into code

The copy button on each field yields the bare number with no unit and no spacing, which is what you want when the value is going into a #define, a buffer size or a test assertion.

4

Flip the direction when you go back to the scope

Press the swap button to work from bytes back to bits — useful when you know your payload is 32 bytes and you need the bit-times it will occupy. Both unit menus are searchable, so you can also jump to kilobits or bytes per second without leaving the page.

UART Framing Overhead: Baud Rate to Effective Bytes per Second

The classic 8N1 configuration wraps each data byte in one start bit and one stop bit, so ten bit-times carry eight bits of payload — a flat 25 % tax. That is why a naive "divide the baud rate by eight" estimate always overshoots what the link can really deliver.

Baud rate (bit/s) Naive bits ÷ 8 Real payload (8N1, 10 bit/byte) Time for one byte
9 6001 200 B/s960 B/s1 042 µs
19 2002 400 B/s1 920 B/s521 µs
38 4004 800 B/s3 840 B/s260 µs
57 6007 200 B/s5 760 B/s174 µs
115 20014 400 B/s11 520 B/s86.8 µs
921 600115 200 B/s92 160 B/s10.9 µs

Add a parity bit and the frame becomes eleven bit-times, dropping 9 600 baud to roughly 873 payload bytes per second. Two stop bits cost another slot. None of that changes the ÷8 arithmetic — it changes how many bits you should feed into it.

Both fields stay live while you compare frames

Type in either box and the other follows immediately, so you can hold a payload figure in one hand and a line-time figure in the other without re-entering anything.

Readable output for long bursts

Thousands are separated with a space and very large captures switch to scientific notation, which keeps a multi-million-bit trace legible instead of a wall of digits.

Every bus unit in one dropdown

The searchable unit menus cover bits, kilobits, bytes and per-second rate units, so a CAN, SPI or UART figure can be re-expressed without hunting for another page.

Nothing leaves the bench

All arithmetic runs in the browser after the page loads, so figures pulled out of a customer's capture are never transmitted anywhere.

Serial Protocol Questions

Why does a 9 600 baud link move 960 bytes per second instead of 1 200?

Because baud counts symbols on the wire, not payload bits. On a standard binary UART one symbol is one bit, so 9 600 baud is 9 600 bit-times per second — but ten of those bit-times are consumed per data byte in 8N1 framing. Dividing by 8 gives the theoretical 1 200 B/s you would see if the line carried nothing but data; dividing by 10 gives the 960 B/s your application actually receives.

What do the start, stop and parity bits contribute to the count?

The start bit is a falling edge that tells the receiver to begin sampling; the stop bit holds the line idle long enough for the next start edge to be unambiguous. Neither carries information. Parity, when enabled, adds a ninth data-adjacent bit purely for single-bit error detection. So an 8E1 frame is 11 bit-times — 1.375 byte-equivalents of line time for one byte of payload.

Does MSB-first or LSB-first ordering change how many bytes I get?

No — the count is identical either way, only the assembled value differs. UART shifts out LSB first, while SPI and I²C conventionally shift MSB first. Mixing them up produces bit-reversed bytes that still occupy exactly the same number of bit-times, which is precisely why the symptom looks like corrupt data rather than a length mismatch.

How does CAN bit stuffing change the bits-to-bytes picture?

CAN inserts a complementary bit after five consecutive identical bits so the receivers keep clock synchronisation. A standard 11-bit-identifier frame with a full 8-byte payload is 108 bits before stuffing and can reach roughly 135 bits in the worst case. Those extra bits are pure line time: your payload stays 8 bytes no matter how many stuff bits the transceiver injected.

My decoder exports a burst length in bits — how do I compare it to my receive buffer?

Divide the exported figure by the frame length, not by eight, then compare that byte count to the buffer depth. A 12 000-bit burst at 8N1 is 1 200 frames, so it needs 1 200 bytes of space; the raw 12 000 ÷ 8 = 1 500 figure describes line occupancy instead. Feeding the wrong one into a FIFO sizing calculation is a common cause of phantom overrun flags.

b
B

Serial Frame Sizes

8 bits (payload only)=1 B
10 bits (8N1 frame)=1.25 B
11 bits (8E1 frame)=1.375 B
64 bits (CAN data field)=8 B
108 bits (CAN 2.0A frame)=13.5 B
9 600 bits (1 s at 9 600 baud)=1 200 B

Bit (b)

One bit-time on the bus. At 115 200 baud a bit lasts 8.68 µs, and everything the analyzer draws — start edges, stop levels, stuff bits — is counted in these.

Byte (B)

Eight payload bits, and the unit your MCU actually stores: one FIFO slot, one register-map entry, one element of the eight-byte CAN data field.

Enter the total bit-times from your analyzer, not just the data bits — 8N1 spends 10 bit-times per byte
The copy button on each field gives the bare number, ready to paste into a #define or buffer size
Hit swap to run the other way when you know the payload in bytes and need its length on the wire
Both unit menus are searchable, so a kilobit or bytes-per-second figure is one keystroke away
Want to learn more? Read documentation →
1/5
Start typing to search...
Searching...
No results found
Try searching with different keywords