2023-06-27 01:50 AM
Did anyone have success configuring the LSM6DSL to use FIFO and threshold to trigger the interrupt pin?
2023-06-27 06:53 AM
Ciao @MLuis.1 ,
Have you already looked at our example on Github? LSM6DSM FIFO works as LSM6DSL one so you can adapt this code to your case.
To set the threshold, you need to write the bits FTH_[10:0] in the FIFO_CTRL1 and FIFO_CTRL2 registers that contain the threshold level and then write in the register INT1_CTRL = 0x08 to route signal on INT1 pin and enable gyroscope and accelerometer in FIFO writing to FIFO_CTRL3 register.
If this helps you, please mark my answer as "Best Answer" by clicking on the "Accept as Solution" button, this can be helpful for Community users to find this solution faster.
2023-06-28 07:37 AM
Hi @Federica Bossi ,
I tried following the same sequence as the code in the github_example you suggested with no success.
I have my code working using X_DRDY on Int1 and I'm able to get both the accelerometer and gyroscope raw values.
It seems that only when trying to use the FIFO functionalities it doesn't work. I checked the number of FIFO entries; it is always at 0, and the threshold status flag is also off.
When using the FIFO functionalities if I read the raw data registers they are still being updated even though the FIFO remains empty.
2023-06-29 12:59 AM
Hi @MLuis.1 ,
Can you share the values of registers: 0Dh,06h,07h and 08h?
Thanks
2023-06-29 07:20 AM
For 06h and 07h, I'm writing these bits so that I have a 12-byte threshold.
For 08h, i'm writting these bits so that i have no decimation for the gyroscope and the accelerometer.
For 0Dh, I'm writing bit 3 so that i have only interrupt in INT1 at FIFO threshold.
2023-07-03 05:26 AM
Hi @MLuis.1 ,
These registers are correctly set. Can you share with me the other writings you are doing? If there are...
2023-07-04 02:32 AM
@Federica Bossi , when I what to acquire, I write the desired ODR on the gyroscope, accelerometer and FIFO registers. I'm using the same ODR value for all three.