2019-10-14 08:10 AM
Hi all,
I'm trying to work with the LIS3DSH but i'm not getting any output data.
I have verified the SPI is working, I can write to and read back numbers from the registers so I know they are getting set correctly. I'm using the initialisation code below. To get the angles I read from the output registers but they are always the same (all 0 apart from the Z MSB at 33). The temperature register also doesn't change (always 0) at anytime of day.
Any advice would be great, thanks.
// Configure LIS3DSH
LIS3DSH_WriteReg(LIS3DSH_CTRL_REG4, 0x57); // 50SPS, all axes, continuous update
LIS3DSH_WriteReg(LIS3DSH_CTRL_REG5, 0xC0); // 50Hz bandwidth, +/-2g, no self test, 4 wire SPI
LIS3DSH_WriteReg(LIS3DSH_CTRL_REG6, 0x10); // No FIFO, auto increment, no interrupt outputs
LIS3DSH_WriteReg(LIS3DSH_FIFO_CTRL_REG, 0x00); // No FIFO, don't care (watermark)
2019-10-18 01:42 AM
Hi @Waller.George , your configurations seems ok. which Vdd and VddIO are you using? Regards
2019-10-18 02:47 AM
Hi Eleon,
I'm using 3.3V for VDD and VDDIO.
George
2019-10-18 02:49 AM
Is the hardware ok ?
Is the CS pin pulled low properly ?
I suggest to check the SPI waveforms with a scope.
2019-10-18 03:43 AM
I have done this, they check out fine. The SPI clock/phase settings are also correct. Also, I can write the control registers then read their value to validate to SPI is working correctly.
2019-10-18 05:24 AM
Okay so I'm not getting garbage data like this:
We have the X, Y and Z data here.
25088 25600 8768
17408 1024 1906
0 17408 24708
4 0 1088
0 0 256
68 98 116
0 16388 8196
6 29184 8516
0 0 1792
4 2 8448
0 0 17664
25088 28672 8768
17408 1024 1906
0 17408 24708
4 0 1088
0 0 256
68 98 116
0 16388 8196
6 29184 -24252
0 0 1792
4 6 8448
0 0 17664
2019-10-18 07:11 AM
you could maybe try to set the BDU bit in CTRL_REG4, meaning write 5Fh in that register. This will block the update of the data until is read, so you shouldn't read strange data... But are you fully bypassing the FIFO, right? Regards
2019-10-21 06:09 AM
Hi Waller, I am facing the same issue, can you post your code for it