2020-10-30 01:55 AM
HI,
In LSM3DH accelerometer sensor datasheet given output of accelerometer is 16 bit
they are divided into two 8bit registers. MSB, LSB registers. LSB register is always giving ZERO as output. only MSB register is giving output.
Why LSB register is always giving ZERO results. Please send your answer
Thank u
Solved! Go to Solution.
2020-10-30 04:15 AM
Hi @NMale.1 ,
the LIS3DH output is on 16 bit in the sense that it is divided on 2 registers of 8 bit each one, for each axis.
However, as reported in the datasheet p. 16, the dataout for each mode is defined as follows:
Can you please check which mode you have enabled?
More in detail, I suggest you to check the lis3dh_reg.c file on Github for the right conversion of the acceleration dataout.
Taking as example the +-2g full scale, you have:
float lis3dh_from_fs2_hr_to_mg(int16_t lsb)
{
return ( (float)lsb / 16.0f ) * 1.0f;
}
float lis3dh_from_fs2_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 4.0f;
}
float lis3dh_from_fs2_lp_to_mg(int16_t lsb)
{
return ( (float)lsb / 256.0f ) * 16.0f;
}
-Eleon
2020-10-30 04:15 AM
Hi @NMale.1 ,
the LIS3DH output is on 16 bit in the sense that it is divided on 2 registers of 8 bit each one, for each axis.
However, as reported in the datasheet p. 16, the dataout for each mode is defined as follows:
Can you please check which mode you have enabled?
More in detail, I suggest you to check the lis3dh_reg.c file on Github for the right conversion of the acceleration dataout.
Taking as example the +-2g full scale, you have:
float lis3dh_from_fs2_hr_to_mg(int16_t lsb)
{
return ( (float)lsb / 16.0f ) * 1.0f;
}
float lis3dh_from_fs2_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 4.0f;
}
float lis3dh_from_fs2_lp_to_mg(int16_t lsb)
{
return ( (float)lsb / 256.0f ) * 16.0f;
}
-Eleon
2020-10-30 04:29 AM
Thank you for your answer,
Can we configure it to 16 bit data mode?. What is the selection combination for 16 bit data output.
Thank you
2020-10-30 05:10 AM
Unfortunately the maximum actual "bit depth" is 12-bit in high resolution mode (this means, taking x-axis as example, 8 effective bits in OUT_X_H (29h) register and 4 effective bits in OUT_X_L (28h) register).
You can configure it by enabling the HR bit of CTRL_REG4 register.
-Eleon