I am bit-banging since my CPU doesn't have native SPI compatible with the LIS3DH.
- To initialize the chip, I write:
- 0x57 to Control Register 1 (DATARATE_100HZ, XYZEN) {see pic CR1Write.jpg}
- 0x80 to Control Register 4 (BLOCKDATAUPDATE, SCALE_2G) { see pic CR4Write.jpg}
- I then poll STATUS_REG_AUX to see if the ZYXDA (0x08) bit is set.
- 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}
- 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}
- 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!