cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DSH no output data

Waller.George
Associate III

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)

7 REPLIES 7
Eleon BORLINI
ST Employee

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

Hi Eleon,

I'm using 3.3V for VDD and VDDIO.

George

Ozone
Lead II

Is the hardware ok ?

Is the CS pin pulled low properly ?

I suggest to check the SPI waveforms with a scope.

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.

Waller.George
Associate III

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

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

RNata.15
Associate II

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