LIS2DW12 - Changing FIFO mode from bypass to cont-to-fifo
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?
