cancel
Showing results for 
Search instead for 
Did you mean: 

LSM303DLHC accelerometer - is data register left justified?

hariprasad
Associate III
Posted on November 26, 2014 at 06:40

Hi

I configured the LSM303DLHC accelerometer as follows.

CTRL_REG1_A with 0x77  //400hz data

CTRL_REG4_A with 0x00 //Little endian

And started reading the data from the OUT_X / Y/ Z_L / H_A registers.

But I could find something that the lower nibble was found to be zero all the time in the

 

OUT_X_L_A, OUT_Y_L_A, OUT_Z_L_A registers.

So is the data in LSM303 12bit left justified or am I missing something?

Note: In datasheet i found it is 16bit but in some driver samples the values of the data registers are combined and right shifted by 4 bits (I assume this is to compensate the left justified data)

Regards

HpC

#lsm303dlhc-data-format #lsm303dlhc
3 REPLIES 3
jjonethal
Associate II
Posted on December 27, 2014 at 19:04

maybe spec of LSM303DLH is more informative regarding that issue.

hariprasad
Associate III
Posted on January 18, 2015 at 08:29

Thanks

But I have gone through the spec, but nothing is mentioned threre regarding this...

Posted on January 22, 2015 at 12:49

Yes, they are left justified 16 bits wide.  You can also verify this by looking at your output and using gravity as a reference.  For example, if you set the range for +-2G (the default) you will see that when you have the accelerometer horizontal you will have a reading of about 16k (+- depending on which end is up) on the Z axis and close to 0 on the other 2 axes.  +- 32k would be Full Scale if left justified and 1G is half full scale.