cancel
Showing results for 
Search instead for 
Did you mean: 

Does LSM6DSR need to discard sample(s) when XLDA bit / GDA bit read value is b'1?

E-John
Associate III

Dear SIR,

I have found a polling mode reference code in the following link

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dsr_STdC/examples/lsm6dsr_read_data_polling.c

The code demonstrates that after reading b'1 of XLDA bit or GDA bit,

it is OK to read XL data or Gyro data.

But on page 20(Fig.1 below) and 25(Fig.2 below) of AN5358 "LSM6DSR: always-on 3D accelerometer and 3D gyroscope", it tells us that user needs to discard the data number, which depends on the LPF2 or HP filter setting or ODR.

My question is if polling mode is used, read the STATUS_REG and get the data ready bit is b'1 for XLDA or GDA,

Do we still need to handle discard samples? or We do NOT discard any samples when read data ready bit value is b'1

Thanks,

E-John

0693W00000SvoP2QAJ.png 

0693W00000SvoP7QAJ.png

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @E-John​ ,

Usually, the datasheet/application note should be preferred to the online code samples. But you might consider this as a trade off between accuracy and speed.

If the maximum achievable accuracy is not mandatory in your application, you can consider also the first samples after register configuration. On the other hand, if you are not interested in the acquisition latency, it's warmly suggested to follow the AN dispositions.

-Eleon