2017-02-28 11:30 PM
Hi,
In the 'Examples of output data' section of the LSM6DS33 application note AN4682, there are tables showing examples of the output register values and the corresponding acceleration and angular rate values for a given scale. Can you please elaborate how the values are calculated?
Regards,
Prachi
#lsm6ds33 #accelerometer #gyroscope2017-03-02 01:04 AM
First of all it is necessary to be familiar with terms Big Endian, Little Endian (check chapter 4.5.1 in AN4682 or
https://en.wikipedia.org/wiki/Endianness
) andhttps://en.wikipedia.org/wiki/Two's_complement
.Than what you need to do is convert two bytes from output registers into one number and multiply this number by sensitivity.
Example 1 (2nd line of the table):
16h = +22, 69h = 105 ... MSB is 0 -> it is possitive value
22*256+105 = 5737 ... 5737 * 0.061 LSB/mg (sensitivity for FS=2g from Table 3 in datasheet) = 350mgExample 2 (4th line of the table):
E9h = -105, 97h = 151 ... MSB is 1 -> it is negative value
-(105*256 + 151) + 32768 = -5737 ... -5737 * 0.061 LSB/mg (sensitivity
for FS=2g
from Table 3 in datasheet) = -350mg