2013-09-23 04:20 AM
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 John #lis3dh-spi2013-09-24 10:00 AM
Hello,
In order to solve your issue,I suggest that you check the attached file with the STM32 low level driver, this canactually aid yourquestionas a reference. Would you be able to provide waveforms sowe can better understand your situation? Thank you, Thiago ________________ Attachments : LIS3DH.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzKc&d=%2Fa%2F0X0000000bK0%2F.sGvMiXomB_h5COxWpvDM_ZuUPxGxpjRry2wtZACHmU&asPdf=false2013-09-30 02:18 PM
I have the problem with LIS3DH in SPI mode too.
Whichever register I try to read, the answer of LIS3DH is 0xFF. The line SDO is everytime in high state.Here is a picture with try to read register WHO_AM_I on adress 0x0FWhat am i do wrong ?2013-10-02 11:28 PM
The problem was in bed soldering of IC. The same way on two board, that led me astray.
2013-10-09 05:59 AM
Hello Mikhail,
that is great news, please do let me know if there is anything that I can do to support you. Thank you very much, Thiago2013-12-23 08:49 PM
hi mikhail, i am also getting the same problem while reading data through SPI, every time i am getting 0xff only, what may be the cause, and what is the problem of bed shouldering as you mentioned? could you elaborate it? and how to overcome it?
2014-05-06 11:26 PM
Hi,
I too face same problem, any update on this issue?