What decoding adds
A serial bus transmits information as a sequence of levels. The oscilloscope samples the signal, applies a threshold to decide what is a one and what is a zero, and uses the protocol rules to group bits into frames. The result is drawn as labels over the trace. The advantage over a protocol analyzer is that, when the message is wrong, you can also see the electrical cause: a slow edge, ringing, or a level that does not reach the threshold.
Preparation
- Connect a probe to each line needed: clock and data on I2C; clock, data and chip select on SPI; a single line on UART.
- Configure the protocol in the decoding menu and assign each channel to its line.
- Set the threshold to the midpoint between the actual logic levels, not the theoretical value. A badly placed threshold produces erroneous bits even when the signal is correct.
- Set the baud rate on UART, the polarity and the bit order, and on SPI the clock mode and word length.
Triggering on content
The most useful option is to trigger on a protocol event: a start condition, a specific address, a data value, a missing acknowledge or a frame error. This way you capture exactly the problematic message instead of searching for it among thousands. With deep memory you can record many frames and navigate through them.
What to check when decoding fails
- Insufficient sample rate: you need several samples per bit to locate the edges clearly.
- Threshold outside the actual levels, especially on open-collector lines with a weak pull-up and slow rising edges.
- Protocol parameters that do not match those of the device.
- Noise or ringing on the edges that generates spurious transitions.
An example
An I2C master receives no response from a slave. Decoding shows the address sent and the absence of an acknowledge bit. On inspecting the trace, the slave’s low level does not go low enough. The cause is not software but the electrical level or the power supply, and it was found because the decoding and the signal were seen together.