Skip to main content
Visitor II
October 14, 2019
Question

LIS3DSH no output data

  • October 14, 2019
  • 4 replies
  • 1678 views

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)

    This topic has been closed for replies.

    4 replies

    ST Employee
    October 18, 2019

    Hi @Waller.George​ , your configurations seems ok. which Vdd and VddIO are you using? Regards

    Visitor II
    October 18, 2019

    Hi Eleon,

    I'm using 3.3V for VDD and VDDIO.

    George

    Explorer
    October 18, 2019

    Is the hardware ok ?

    Is the CS pin pulled low properly ?

    I suggest to check the SPI waveforms with a scope.

    Visitor II
    October 18, 2019

    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.

    Visitor II
    October 18, 2019

    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

    ST Employee
    October 18, 2019

    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

    Visitor II
    October 21, 2019

    Hi Waller, I am facing the same issue, can you post your code for it