Skip to main content
Visitor II
July 21, 2025
Question

lsm303agr accelerometer problem fifo stream mode, period not at 1/odr

  • July 21, 2025
  • 2 replies
  • 580 views

Hello

I have a problem with the accelerometer lsm303agr and the Fifo Stream mode, I have a time offset between 2 watermark interrupts.


Configuration :
- accelerometer only
- watermark interrupt enable on int1
- bdu enable
- Stream mode enable
- Fifo enable
- Don't used any gesture recognition, or filter.
- i use the spi mode at 500khz

Description of the problem :
I used the accelerometer in Fifo Stream mode, the watermark to fire the interrupt on pin int1 when a certain number of data in the Fifo is reached.

The odr is at 1hz, i used the rtc of the stm32 (from a homemade board) to collect the timestamp when INT1 trigger.

I have notice a time offset for every sample in addition of the ODR configured.

I measured it to be around 25ms/samples on top of my 1seconds period (odr 1hz).

I checked the timing at the oscilloscope which confirmed that the problem Don't come from the reading of the rtc but from the lsm303agr.

for example :
With a watermark to store/collect 2 samples from the Fifo, in theory i should have the interruption triggering every 2sec But This is not the case, i have 2sec+(25ms*2samples) = 2.050sec.

With 30samples watermark, I'm at 750msec offset.

I checked and rechecked the configuration of the registers, can't see anything wrong. I tried different ODR, the offset is still there but smaller, look like is proportional to the odr. 

 

Does someone have any ideas what the problem can be?

 

Thanks

 

 

 

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    July 23, 2025

    Hi @max34900 ,

    Ensure that after reading the FIFO data, you properly clear the interrupt flag by reading the FIFO level or the interrupt source register. If the interrupt is not cleared promptly, the timing of subsequent interrupts may be affected.

    Did you follow section 4.8.3 of the application note?

    max34900Author
    Visitor II
    July 23, 2025

    hi

    Thanks for the reply, I'm in "Stream mode" not in "Stream-to-FIFO mode", but anyway I tried both cleaning methods (of the "Stream-to-FIFO mode") and it doesn't work.

    cheers

    Technical Moderator
    July 28, 2025

    Hi @max34900 ,

    Can you share your settings?

    Thanks

    max34900Author
    Visitor II
    September 12, 2025

    After a month in the quest to make it work, i reach the conclusion that the lsm303agr is not good at doing accelerometer measurement at 1hz. It's to wonder if their test it at this frequency!

    I'm done my tests on 2 homemade boards plus one arduino with the STEVAL-MKI172V1 (which is the test board of ST).

    Here below is the graph showing the time different between 2 consecutive samples, the board used is the STEVAL-MKI172V1: the configuration is simple (no fifo used) ODR 1hz, DRDY1 interrupt on INT1 pin. The dc constante of 1sec is remove, the plot is in msec.

     

    max34900_0-1757666878760.png

    as you can see if the odr was almost perfect i should have all the datapoints center close to 0msec but it not the case!