cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Misaligned Accelerometer and Gyroscope Samples on LSM6DSOX FIFO

Rturo
Associate II

Hello, I am using the LSM6DSOX sensor and reading data from the FIFO, following these examples on GitHub (https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dsox_STdC/examples/lsm6dsox_fifo.c). I've set the same frequency for both the accelerometer and gyroscope, but when I read the data from the FIFO in continuous mode, the samples are not aligned. For example, I receive the first two accelerometer samples followed by one gyroscope sample, then three accelerometer samples, two gyroscope samples, and so on.

Since the frequencies are the same, shouldn't I receive one gyroscope sample and one accelerometer sample consecutively in a 1:1 ratio? Is this behavior normal? Or is it necessary to adjust the accelerometer's configuration in some way to ensure that the samples are aligned? If so, how should I do that?

Thank you!

1 REPLY 1
Federica Bossi
ST Employee

Hi @Rturo ,

If you followed that example, having set the same ODR and the same Batch Data Rate for both sensors, the stored values for accelerometer and gyroscope should have the same frequency. Make sure to check the sensor configuration so that you have matching values in both cases. 

Did you try changing the Watermark to 1 to see what is the behaviour in this case?

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.