cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH Stream FIFO

Anusuya Nallathambi
Associate II
Posted on May 16, 2017 at 01:47

I configured the LIS3DH in stream FIFO mode. Then I set the WATERMARK level as 8 bytes and I poll the FIFO_SRC_REG to see if the WTM bit is 1 and then I collect the 8 bytes of data accumulated in FIFO. Now my problem is, in the code, for debug purposes, I display the data I collected and this reduces the number of data points I read when the program is run for n seconds. That is, when I run the code without displaying for the same n seconds, almost double the amount of data points is being read. Why is this ? 

In the program I check the overrun flag in FIFO_SRC_REG too. But it is never set during the run of the code. So I should not be losing any data while reading and printing it. 

My questions :

1. Does the overrun flag not work in Stream mode ? i.e when new data is overwritten does it not stay high ?

2. Does the FIFO stops accepting data when data is being read from it ?

#lis3dh-fifo #lis3dh #lis3dh-spi
1 REPLY 1
Miroslav BATEK
ST Employee
Posted on May 19, 2017 at 15:55

1. Does the overrun flag not work in Stream mode ? i.e when new data is overwritten does it not stay high ?

The overrun flag works in Stream mode.

2. Does the FIFO stops accepting data when data is being read from it ?

In Stream mode FIFO continues filling, when the buffer is full, the FIFO index restarts from the beginning and older data is replaced by the current. The oldest values continue to be overwritten until a read operation frees FIFO slots.

For details please check chapter 8.3 in the application note

http://www.st.com/resource/en/application_note/cd00290365.pdf

.