cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DS12 is not filling FIFO with samples in continuous mode while reading the FIFO in I2C interface

RHalo
Associate

Hi, i'm using LIS2DS12 accelerometer in FIFO continuous mode connected to my MCU using the I2C interface. i'm setting the FIFO threshold to 80 samples and using the maximum ODR of 6400Hz so it takes ~12.5ms for the FIFO interrupt to read it. reading the 80 samples takes ~4ms using I2C in 1MHz speed. all data is read in one I2C transaction.

examine the received data, it seems that some of the samples data is missing which fits the time it was reading the FIFO, 4ms that are 25 samples. it looks that new samples are not entering the FIFO while reading the FIFO.

is the LIS2DS12 supporting filling new samples to the FIFO while reading the FIFO?

is it a configuration issue?

Thanks,

Roei.

1 REPLY 1
Eleon BORLINI
ST Employee

Hi Roei @RHalo​ ,

yes, you are probably missing some samples during the I2C reading of the samples batch stored in the FIFO. How did you configured the FIFO mode? For example, form datasheet, setting the Continuous mode through FIFO_CTRL (25h) (FMODE[2:0] = 110) you'll get a continuous FIFO update: when N unread samples are stored in memory, as new data arrives the oldest data is discarded and overwritten by the newer. You can set N as the FIFO threshold FIFO_THS (2Eh) (FTH[7:0]). A flag FIFO_CTRL (25h) (FIFO_FTH) is asserted when the number of unread samples in FIFO is greater than or equal to N.

And did you try to decrease the ODR filling the FIFO to validate your theory?

-Eleon