AnsweredAssumed Answered

Unable to Communicate on SPI with LIS3DH Accelerometer

Question asked by douglas.john on Sep 23, 2013
Latest reply on May 7, 2014 by manoharan.balaji.001
I am using a PIC32MX795F512H which has a number of peripherals (EEPROM, ADC, DDS, and POT) to which I communicate with via SPI. All these work.

However the Accelerometer does not.

As one reason could be the PIC setup, I've tried bit-bashing. With the scope my CS, Clock and data output match the diagrams. The LIS3DH will not reply.
I've moved the chip lines to use the eeprom lines and still no joy.
I've bought an evaluation board and that does not work.

There is probably a fundamental problem in my understanding of how the LIS3DH works, either the commands, (0x8f should read WHO_I_AM?) or some aspect of how it handles SPI.

I would be grateful if anyone could post either:

a) working bit-bashing code (preferably in C or pseudo-code) that I can use to debug/prove my code.

b) PIC32MX795F512H SPI set-up and code

Thank you