2025-07-21 9:26 AM
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