cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DSH Duplicate Acceleration Data at 800HZ and 1600HZ ODR

AAn.1
Associate

We are using the LIS3DSH to sample acceleration data on all three axes at 800HZ. No state machine or advanced features are used. The following registers are set on initialization:

CTRL_REG4 = 0x87 // 800Hz, all axes enabled
CTRL_REG6 = 0x50 // fifo and watermark enabled, auto increment when doing multiple reads
CTRL_REG5 = 0x08 // 4G sensing

Then the FIFO_CTRL register is set to start collecting data in streaming mode:

FIFO_CTRL = 0x40 //stream mode 

The FIFO_SRC register is read periodically and the FSS value is used to determine the number of samples in the FIFO. FSS number of samples are read out of the FIFO by doing an initial read of the Status Register at 0x27 to position the next read at OUT_X, and then reading FSS * 6 bytes to get data for all the channels using the automatic address increment feature of the sensor. In theory it seems like this should leave at least one sample in the FIFO, since FSS is “number of samples stored in the FIFO - 1�? and have no risk of reading out data that hasn’t been updated.

However, randomly, data is being duplicated from a value 32 samples previous, which is the exact length of the FIFO. It seems like the sensor is skipping over certain FIFO indexes at times or failing to update the FIFO entries correctly, as can be seen in the graph below. The spikey outlier data is actually duplicate data. Sometimes a single read of three samples will have a duplicate data point in the middle with new data points on either side of it, so it seems to be an issue internal to the way the sensor is updating the FIFO and not related to the beginning or end of a read. I have attached the data used to create the chart.

0690X00000BvrtWQAR.png

When duplicate data occurs it always affects all three channels and is a duplicate of the sample 32 samples previous. This duplicate data shows up at sample rates of 800Hz and 1600Hz in streaming mode regardless of whether I read the data on an interrupt or setup a watermark. It is not present at lower sample rates.

Has anyone else experienced duplicate data with the LIS3DSH, or had success using stream mode at the higher data rates?

Thanks in advance for your help.

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @AAn.1​ , thank you for the detailed explanation of the issue. I'm wondering if it could be related to some kind of synchronization issue between data reading process and FIFO filling. Are you using SPI interface? If so, at which data speed? Did you try to enable also the BDU bit in CTRL_REG4 (20h) register (value 0x8F)? Regards