我在流FIFO模式下配置了LIS3DH。然后我将WATERMARK级别设置为8个字节,并且我轮询FIFO_SRC_REG以查看WTM位是否为1,然后我收集FIFO中累积的8个字节的数据。现在我的问题是,在代码中,出于调试目的,我显示了我收集的数据,这减少了我在程序运行n秒时读取的数据点数。也就是说,当我运行代码而不显示相同的n秒时,几乎是正在读取的数据点的两倍。为什么是这样 ?
在程序中,我也检查FIFO_SRC_REG中的溢出标志。但它在代码运行期间从未设置过。所以我不应该在阅读和打印时丢失任何数据。
我的问题:
1.溢出标志是否在Stream模式下不起作用?即当新数据被覆盖时,它是否会保持高位?
2.当从中读取数据时,FIFO是否停止接受数据?
#lis3dh-fifo#lis3dh#lis3dh-spi
以上来自于谷歌翻译
以下为原文
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 prin
ting 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