cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion about LSM6DSM and lis3mdl integration

Purvesh
Associate

 

Hi everyone,

I am working with the  LSM6DSM and an external LIS3MDL magnetometer and have the FIFO ODR set to 208 Hz, with no decimation configured.

I am trying to understand exactly how the FIFO handles data in the following four scenarios. Could someone clarify what happens to the samples in the FIFO for each case?

  1. The Accelerometer or Gyroscope ODR is set higher than 208 Hz.

  2. The Accelerometer or Gyroscope ODR is set lower than 208 Hz.

  3. The external Magnetometer ODR is set higher than 208 Hz.

  4. The external Magnetometer ODR is set lower than 208 Hz.

Any clear explanations on how the samples are handled (e.g., are they dropped, duplicated?) in these specific situations would be greatly appreciated.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Purvesh ,

When the sensor hub I²C read rate is higher than the external LIS3MDL ODR, the sensor hub reads the output registers at each trigger, and if the LIS3MDL has not updated its data, the same value is read and stored in the FIFO multiple times. There is no automatic duplication by the FIFO; rather, the same register value is read repeatedly until the LIS3MDL updates its output.

So, 

The correct behavior is: b) The sensor hub continues to read the output registers at the trigger rate (~104 Hz in your case), but the registers are not updated until the sensor ODR, so the same data is read multiple times.

The FIFO will contain repeated samples if the sensor hub reads faster than the LIS3MDL updates its data.

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.

View solution in original post

3 REPLIES 3
Federica Bossi
ST Employee

Hi @Purvesh ,

For the LSM6DSM FIFO with an external LIS3MDL and FIFO ODR set to 208 Hz (no decimation):

  • If a sensor's ODR is higher than the FIFO ODR, only samples at the FIFO ODR are stored; extra samples are dropped.
  • If a sensor's ODR is lower than the FIFO ODR, the last available sample is duplicated in the FIFO until a new sample is available.
  • This behavior applies to both the internal sensors (accelerometer, gyroscope) and the external magnetometer.
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,

Just to confirm my understanding regarding the case when the sensor ODR is lower than the FIFO ODR:

In my setup:

  • FIFO ODR = 208 Hz

  • External magnetometer (LIS3MDL) ODR = 80 Hz

  • START_CONFIG = 0

From my logic analyzer, I observe that the sensor hub performs I²C reads at ~104 Hz.

Do you mean:

a) The sensor hub reads the external sensor only when new data is available, and the FIFO duplicates the last sample internally to match the FIFO ODR

or

b) The sensor hub continues to read the output registers at the trigger rate (~104 Hz in my case), but the registers are not updated until the sensor ODR, so the same data is read multiple times

Could you please confirm which behavior is correct in this scenario?

Thanks,
Purvesh

Hi @Purvesh ,

When the sensor hub I²C read rate is higher than the external LIS3MDL ODR, the sensor hub reads the output registers at each trigger, and if the LIS3MDL has not updated its data, the same value is read and stored in the FIFO multiple times. There is no automatic duplication by the FIFO; rather, the same register value is read repeatedly until the LIS3MDL updates its output.

So, 

The correct behavior is: b) The sensor hub continues to read the output registers at the trigger rate (~104 Hz in your case), but the registers are not updated until the sensor ODR, so the same data is read multiple times.

The FIFO will contain repeated samples if the sensor hub reads faster than the LIS3MDL updates its data.

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.