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

SPI collision

Hey.

We use the same SPI bus for accessing an external flash memory and gyroscope device (Bosch chip).

We encounter a problem regarding the SPI when performing the following actions at the same time (we use a mutex on the SPI to eliminate collisions):

  1. Access the external memory.
  2. Reading data from the gyroscope device.

When i perform reads from the Gyroscope without accessing the external memory, the data is correct.

But when i perform an access to the external memory right before reading the Gyroscope, the Gyroscope values are corrupted.

I verified on the oscilloscope that we don't have a collision on the bus, but i saw that i have a 1ms latency on the MISO pin.

The green is MISO

Do you have any suggestions what is the cause of the latency? How to fix it?

What else in the SPI configuration may solve the SPI issue?

Thank you,

Nir Barniv  |  Firmware Team Leader

 

UPRIGHTRegistered Technologies LTD

www.uprightpose.com

  • Hi Nir

    By 1ms latency do you mean the slow discharge on the MISO pin?

    To me this seems normal, since you don't assert any of the chip select pins. In this case none of the devices on the bus will pull the MISO line, and it will be left floating, leading to a slow discharge to ground in this case. 

    Do you have a plot that shows both the external memory access and the gyroscope access one after the other?

    Ideally also a plot showing the difference between the gyroscope transaction when the values are corrupted or not, showing the difference between the two? 

    Best regards
    Torbjørn

Related