cancel
Showing results for 
Search instead for 
Did you mean: 

SPI with LIS3DH Accelerometer is not working

Zahme.1
Associate

I am using a PIC32MX250F128B . I am trying to communicate with LIS3DH through SPI connection. I have several other devices like ADC, DAC working with SPI protocol perfectly fine. However the Accelerometer does not.

With the scope my CS, Clock and SDA matches the diagram from datasheet (its sending the correct address of WHO_AM_I register ) but SDO output remains silent. Cant see anything coming out of accelerometer.

I am trying to get the who_am_i register value but the output i am getting is zero.

I have attached a scoped picture of my SPI. I have tried rest of the 3 mode other than the mode mentioned in the datasheet.

Any suggestions or solution from the community would be much appreciated. I have gone through several posts with the same problem but with no solution.

I hope I can get one.

N.B: All my connections are perfectly fine and other SPI connections are also working fine (ADC, DAC). I've also purchased several breakout boards (Adafruit, seedstudio) but that does not work either.

Here in this picture

yellow line : CLK

Pink waveform : SDO

Cyan waveform: SDA

CS is working fine.

0693W00000AOzvGQAT.jpg 

23 REPLIES 23

Hi @Ffdhb.1​ ,

are you using the same setup as @Community member​ ?

Niccolò

I have had both response , we have exactly the same problem.

My CS is not tied to ground also

My setup is different but i am using the PIC32 though. maybe its a compatibility issue ?

Hi @CDuru.1​ ,

I worked with a PIC32 some years ago with another ST sensor, and I didn't have any problems.

but now I'm not able to replicate your issue, I'm sorry.

Last thing I can suggest is to try to read with I2C communication, but I don't expect that the problem is in the SPI.

Niccolò