cancel
Showing results for 
Search instead for 
Did you mean: 

I am attempting to use the LIS3DH in SPI mode The data coming back is always the same regardless of orientation of the device I have tired 2 devices and they are both behaving the same

Jprab.1
Associate

I am bit-banging since my CPU doesn't have native SPI compatible with the LIS3DH.

  1. To initialize the chip, I write:
    1. 0x57 to Control Register 1 (DATARATE_100HZ, XYZEN) {see pic CR1Write.jpg}
    2. 0x80 to Control Register 4 (BLOCKDATAUPDATE, SCALE_2G) { see pic CR4Write.jpg}
  2. I then poll STATUS_REG_AUX to see if the ZYXDA (0x08) bit is set.
    1. The data ALWAYS comes back 0xFF, so my code proceeds to read 3 axis data since the test for 0x08 always comes back true {see pic AuxStatusRegRead.jpg}
  3. I then read the OUT_X_L register with the M/S bit SET, so that the address will increment with every additional 8 clocks I send out (total of 40 clocks beyond the initial 16). {see pic 3AxisDataRead.jpg}
  4. The data ALWAYS comes back the same no matter what the orientation of the device!

I am at a loss, having spent WAY too much time trying to get this to make sense....

Please help!

1 REPLY 1
Jprab.1
Associate

ANY help with this issue, folks??