This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI Master MISO Noise Issue

I'm trying to connect to a ST LSM6DS3 via SPI on the Nordic chip. I have used SPI on Nordic with other peripherals but couldn't seem to get it to work with this ST chip. Eventually, after debugging it from a firmware stand-point I decided to scope it out and see if the SPI signals were corresponding to what I was getting in firmware. What I discovered is the two situations:

  1. when I probe MISO when it is disconnected to the Nordic chip the response from the ST chip is correct. Nice clean crisp signal

  2. When I probe it with MISO connected to the Nordic chip I get some sort of noise.

I included the two captures below and was hoping to get an idea why the SPI interface is behaving like this. Does anyone know why it is doing this and how to make it stop? Do I have some internal pull-up/pull-down's configured incorrectly? I am a bit out of ideas... :/

Good Response with MISO Disconnected From Nordic Chip

MISO Connected to Nordic -- Noisey(?)

Zoom of Noise

ST Datasheet: www.st.com/.../DM00133076.pdf

  • Nordic SPI module is known to work correctly with many known external sensors. I would not suspect that SPI on nordic itself is misbehaving.

    from the product specification

    "To secure correct behavior in the SPI, the pins used by the SPI must be configured in the GPIO peripheral as described in Table 60 prior to enabling the SPI. The SCK must always be connected to a pin, and that pin's input buffer must always be connected for the SPI to work. This configuration must be retained in the GPIO for the selected IOs as long as the SPI is enabled.
    Only one peripheral can be assigned to drive a particular GPIO pin at a time, failing to do so may result in unpredictable behavior."
    

    I think the PULL direction on MISO conflicts on both direction (Nordic and ST). Looking at the timing on your oscilloscope, the value on MISO looks very stable on the rising edge of clock. So, if you are using SPI mode0 then even with this spurs, MISO values should have been sampled correctly.

    Are these spurs making your SPI behave in an erroneous way?

  • I know this is an old post but others, like myself, may see it as extremely useful as it is still relevant. Not going too deep into detail I had the same symptoms as displayed on your oscilloscope but different chips. It came down to unbalanced lines. Even if you have a low clock frequency the fast ns clock edges need to be respected. I found a 470 ohm resistor in series with the SPI CLK line on the Master side. Removing that resistor and implementing the solution recommended for unbalanced lines from Lattice (I could only implement half the solution from the Slave side) I was able to extend the length of my ribbon cable from 10cm to 160cm with no comms errors:

    www.latticesemi.com%2F~%2Fmedia%2FLatticeSemi%2FDocuments%2FWhitePapers%2FHM%2FImprovingNoiseImmunityforSerialInterface.pdf%3Fdocument_id%3D50728&usg=AFQjCNG00KXfdgaufV_zq0V5o_YFqEE8OQ

Related