aioscilloscope / Learn / Find a baud rate

Find the baud rate of a serial signal with an oscilloscope

The narrowest pulse in a serial burst is one bit, and one over its width is the baud rate. Here is how to read it, a trick that makes it easy, and how close is close enough.

One bit between the cursors, the start bit: 17.3 µs, and 1 / 17.3 µs = 57.8 kHz, so 57,600 baud, the nearest standard rate. +Width and -Width average pulses of one bit and of several, so measure the narrowest pulse. The line is a Rigol DG902 Pro playing OK and a carriage return at 57,600 baud.

CH1Step by step

  1. Capture some traffic. Edge trigger, slope Falling, level at half the logic swing (1.6 V for 3.3 V logic). Press Single while the device is sending.
  2. Find the narrowest pulse. Zoom into the burst: the narrowest high or low step is one bit. Measure it with the cursors, or with the +Width and -Width measurements.
  3. Work out the rate. Baud rate = 1 / bit time. 17.4 µs gives 57,471 baud; the nearest standard rate is 57,600, 0.2 % away.
  4. Check it with the decoder. Set that rate in the serial decoder. Clean characters and no error marks mean you have it.

Measure several narrow pulses: every pulse is a whole number of bits, and the shortest one is one bit.

CH2The U trick

The letter U is 0x55, binary 01010101: sent as 8N1, the line changes level at every bit.

idlestart0D01D10D21D30D41D50D61D70stop1idle
The letter U (0x55) as 8N1: every bit differs from the one before it, so the line is a square wave at half the baud rate.

Every pulse of a U is one bit, so +Width and -Width read the bit time, and a run of U's sent back to back is a square wave: Frequency reads half the baud rate (28.8 kHz means 57,600). Paste a line of U's into the terminal rather than holding the key, which leaves gaps.

A run of U characters sent back to back, here forty of them from a Rigol DG902 Pro at 57,600 baud: a square wave. Frequency reads 28.8 kHz, half the baud rate, and +Width and -Width one bit, 17.36 µs.

CH3Standard rates and their bit times

Baud rateOne bitOne 8N1 character (10 bits)A run of U's
1,200833 µs8.33 ms600 Hz
2,400417 µs4.17 ms1.2 kHz
4,800208 µs2.08 ms2.4 kHz
9,600104 µs1.04 ms4.8 kHz
19,20052.1 µs521 µs9.6 kHz
38,40026.0 µs260 µs19.2 kHz
57,60017.4 µs174 µs28.8 kHz
115,2008.68 µs86.8 µs57.6 kHz
230,4004.34 µs43.4 µs115.2 kHz
460,8002.17 µs21.7 µs230.4 kHz
921,6001.09 µs10.9 µs460.8 kHz

CH4How close is close enough?

Real devices are rarely exactly on the rate: Digi's manual for its XBee S1 says its 115,200 setting runs at 111,111 baud, 3.5 % slow. A receiver reads the stop bit 9.5 bit times after the start edge, so it fails once the two clocks drift half a bit apart: 0.5 / 9.5 = 5.3 % at most. Keep the total under about 3 %. A measurement within 2 % of a standard rate is almost certainly that rate.

Let the scope measure it

Many serial decoders can measure the rate themselves (often called Auto). Fitting one bit time across every edge on a capture gives the rate far more closely than one pulse measured by hand.

Auto rate on, the decoder started at 9600 baud: the decode sheet reads the rate, 57.6 kb/s, and the framing, 8N1, off the capture, and the characters decode. The line is a Rigol DG902 Pro playing OK and a carriage return at 57,600 baud.

When to distrust it: with only a few characters on the capture, with too few samples a bit, and when the device changes rate partway, as some chips do after their boot messages. Check that the decoded text makes sense.

Questions

Is baud rate the same as bits per second?

For a UART, yes: 57,600 baud is 57,600 bits a second. An 8N1 character carries 8 data bits in 10, so that moves at most 5,760 bytes a second.

Can I find the baud rate without a decoder?

Yes. Measure the narrowest pulse with the cursors or the width measurement and divide one by it.

What is 74,880 baud?

The rate the ESP8266 prints its boot log at, before the program sets its own; that is why a terminal at 115,200 shows garbage at power-up. More on boot logs.

More to try

Every guide