2024-04-08 05:50 AM - edited 2024-04-08 05:55 AM
Greetings
I am running an application where I am using the LIS2DW12 accelerometer. I am using it for classical sampling of acceleration values in cont-to-fifo mode, which works fine. The FIFO is configured with the High pass filter enabled.
I now want an additional 10 samples (preferably more than 4 samples but 10 being the max) with the high pass filter disabled. I have tried running the LIS2DW12 in single-sampling mode 10 times, with the following config:
-WriteReg(CTRL6, 2G full scale, ODR/2, LOW Noise enabled, HPF disabled)
-WriteReg(Fifo_ctrl, bypass)
-WriteReg(CTRL3, I2C_Single data conversion enabled)
-WriteReg(CTRL3, Start single data conversion)
while(DRDY bit is not set)
{
Readreg(status)
}
- Read data registers(x, y, z)
-WriteReg(CTRL6, 2G full scale, ODR/2, LOW Noise disabled, HPF enabled)
-WriteReg(Fifo_ctrl, bypass mode)
-WriteReg(Fifo_ctrl, cont-to-fifo mode)
-WriteReg(CTRL3, Latched interrupts enabled)
Once the above code runs in the loop and I provide a disturbance to the sensor for it to wake up and sample, the application stops responding.
Is there something I am missing, to disable and re-enable the FIFO to run properly?
2024-04-09 06:15 AM
Hi @ZAIDS-S23 ,
The steps you need to follow to pass from bypass to continuous to FIFO mode are:
2024-04-09 06:22 AM - edited 2024-04-09 06:48 AM
Hi Federica
I am familiar with placing the accelerometer in any FIFO mode of my choice and configuring it further in terms of interrupts etc.
However, what I am unsure of, is configuring it in bypass mode AFTER I've received an interrupt and read out the FIFO. After I read out the FIFO, I want to place it in single-data conversion mode and place the FIFO in bypass mode.
From the steps I've implemented above, it doesn't seem to work consistently i.e. I can actually complete the above process uptil the point of placing it in bypass mode and then reading out 3 samples. But to do it repetitively, it cannot happen consistently. The chip stops responding to interrupts eventually.