Just getting started with EE, so bear with me. I've got a bare-metal STM32G474RE communicating over SPI (~5MHz) with an LSM9DS1. I've got a probe hooked up and capturing the communication and it seems to be working well. I send 0x8F and get back 0x68 from the WHO_AM_I register:

Scope pic 1

CS/CLK/MOSI/MISO, respectively. What I'm trying to understand is the "stereotyped" noise in the signal. I understand that all signals will have some kind of a noise floor, but the MISO line is both noticeably noisier than the other lines (not clear to me why?), and the noise pattern appears to follow a consistent pattern frame-to-frame i.e. I can trigger a new recording and the signal looks almost identical.

Scope annotated

Circled - I assume this dip that coincides with the first falling clock edge is due to the MOSI line dropping and affecting the VDD line (?).

Rect - The MISO line is super noisy compare to the MOSI. But it's not white-noise noisy; rather the ringing on the line is nearly identical each time I capture a new trigger. What might cause large-but-very-consistent noise like this?

Arrow - Not really noise-related, but I assume this gradual voltage rise back up to VDD is due to neither slave nor master driving the MISO line and there being an internal pull-up resistor + cap somewhere. Why would this happen only after CS goes high? Is it this "refactory period" what limits the SPI speed?

Edit: more detail

The micro is on the NUCLEO-G474RE board (pdf), and the LSM9DS1 is on the breakout board from Adafruit (link). SPI port is SPI2, with pins PB 12/13/14/15 for CS/CLK/MISO/MOSI, respectively. Connected with ~4" wires terminated with 1-pin female Dupont. Let me know if you need any more details!

Edit: Swapped probe

Swapped probes 3 and 4 on the PCB side. Noise does not follow the probe; it only appears on the MISO line.

  • \$\begingroup\$ Can you show us more details about the actual wiring (e.g. type of wire, location of any pullups)? It may be helpful to identifying stray capacitances and other issues. \$\endgroup\$
    – nanofarad
    Mar 21, 2020 at 2:06
  • 1
    \$\begingroup\$ Swap channel 3 and 4 at the PCB side. See if the noise follows the probe. \$\endgroup\$
    – user57037
    Mar 21, 2020 at 2:10
  • \$\begingroup\$ Are all your scope ground clips attached? If you want clean signals, you need to connect all 4 of them. \$\endgroup\$
    – Mattman944
    Mar 21, 2020 at 2:23
  • \$\begingroup\$ @Mattman944 Yup, all ground clips attached \$\endgroup\$
    – Tim
    Mar 21, 2020 at 2:26
  • 1
    \$\begingroup\$ The signals are probably OK, the noise is probably mostly instrumentation error. Getting clean signals on a scope can be challenging. The "ringing" may or may not really be there, if the scope connection is not very short, the scope connection can cause them. Can you post a picture of your probe attachments? \$\endgroup\$
    – Mattman944
    Mar 21, 2020 at 2:43

1 Answer 1


Measuring with a scope is an art. It is not so much if your probes are grounded but more where they are grounded.

Noise also greatly depends on PCB layout and the drive strength. Think if it like two person side by side: You hear the one better over the other if he shouts louder.

Back to your signals:

Circle : That coincides with the first data bit. Can it be that the first data bit tells the slave to read or write? If so this is is where the MISO line goes from floating to being driven. This type of behaviour is often seen with interfaces which offer a single bi-directional data line for input and output.

Rect: Yes your signal is noisy but as said, that is often caused by a bad probe ground.I would also check if you have correct decoupling of all the chips.

Arrow: The moment the chip select goes away your MISO output goes tri-state. Indeed what you see is the floating net being pulled-up somewhere. As there is no chip-select it does not matter where that line floats to. It could also go low or go random.

"stereo-typed":Getting to the core of your question: That you see the same "stereo-typed" pattern is easily explained by the fact that noise in a digital PCB is not random but caused by the switching of the circuits. The CPU is running the same program section each time and thus you get the same noise pattern each time.
You might see a difference if the driver is handled by an interrupt in which case the noise pattern depends on where the SPI interrupt occurred.
Your noise can also be caused by the SPI slave device in which case the noise pattern is more likely to be always the same.

  • \$\begingroup\$ Hah! Excellent, right on the money. Your comment got me thinking about where the signal was being generated vs where I was measuring it from. I had the probe connected/grounded to the Nucleo board, which means there was 4" worth of ribboncable jumper wire between it and the breakout board. I ended up switching the probe and ground breakout-side and presto, most of the "stereotyped" noise went away and what remains is likely due to the SPI Slave device's internal switching. And you're bang on about the circle too: the first bit is precisely the read/write signal to the slave. Cheers! \$\endgroup\$
    – Tim
    Mar 21, 2020 at 3:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.