24/7 emergencies 814 777 6921812 230 6079WhatsApp 811 786 0768
Electrónica MonterreyElectrónica MonterreyLaboratorios Creativeit Talk to an engineer
Menu

How do you debug a serial bus with decoding?

To debug a serial bus with decoding, the oscilloscope interprets the signal levels as bits according to the protocol and displays addresses and data over the waveform, which makes it possible to relate the content to the electrical signal.

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

  1. Connect a probe to each line needed: clock and data on I2C; clock, data and chip select on SPI; a single line on UART.
  2. Configure the protocol in the decoding menu and assign each channel to its line.
  3. 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.
  4. 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.

We do real tests, on video! Watch them on our YouTube channel →

Do you have a problem nobody has been able to measure?

Talk directly to the engineer in charge, with no middlemen.

Talk to an engineer