cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSL FIFO threshold Interrupt

MLuis.1
Associate III

Did anyone have success configuring the LSM6DSL to use FIFO and threshold to trigger the interrupt pin?

6 REPLIES 6
Federica Bossi
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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.

Hi @MLuis.1 ,

Can you share the values of registers: 0Dh,06h,07h and 08h?

Thanks

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

For 06h and 07h, I'm writing these bits so that I have a 12-byte threshold.

MLuis1_0-1688048135368.png

For 08h, i'm writting these bits so that i have no decimation for the gyroscope and the accelerometer.

MLuis1_1-1688048243247.png

For 0Dh, I'm writing bit 3 so that i have only interrupt in INT1 at FIFO threshold.

MLuis1_2-1688048402819.png

 

 

Federica Bossi
ST Employee

Hi @MLuis.1 ,

These registers are correctly set. Can you share with me the other writings you are doing? If there are...

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
MLuis.1
Associate III

@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.