cancel
Showing results for 
Search instead for 
Did you mean: 

L3GD20H raw value conversion

timothy0508
Associate II

How does one convert:

  1. Raw angular rotation data to DPS
  2. Raw temperature sensor readings to degrees

Thanks :grinning_face:

1 ACCEPTED SOLUTION

Accepted Solutions

​you're welcome timothy, you can get temperature value in a similar way: read the OUT_TEMP (26h) reg value (e.g. 15h), transform in decimal value through two's complement (e.g. decimal 21) and apply the  -1 LSB/°C conversion factor, obtaining -21°C

Regards

Eleon

View solution in original post

6 REPLIES 6
Eleon BORLINI
ST Employee

​hi timothy,

  1. Raw angular rotation data to DPS --> taking X axis as example, you have to concatenate OUT_X_L (28h) and OUT_X_H (29h) in a 16 bit's word and convert the value in two's complement. Finally, multiply it for the dps/digit of page 10 of the ds (the conversion depends on the selected FS).

0690X0000088NlrQAE.png

  1. Raw temperature sensor readings to degrees --> similar for the temperature sensor, -1LSB/deg on 8 bit (OUT_TEMP (26h)). Also in this case the value is expressed as two’s complement.

0690X0000088NmBQAU.png

regards

Okay, so you mean, for example, that if my full scale is 500, I just take the concatenated 16 bit value and multiply by 500?

Eleon BORLINI
ST Employee

​Suppose you get value E2h on OUT_X_L (28h) register and value 55h on OUT_X_H (29h). You concatenate 55h and E2h obtaining 55E2h, then you apply two's complement conversion obtaining decimal 21986 and finally you multiply it for 17.50 mdps (= 0.0175 dps) obtaining 384.755 dps, if your FS is 500dps.

Regards

Got it! Thanks so much.

Could you also give a similar example with temperature conversion?

Regards,

Timothy

​you're welcome timothy, you can get temperature value in a similar way: read the OUT_TEMP (26h) reg value (e.g. 15h), transform in decimal value through two's complement (e.g. decimal 21) and apply the  -1 LSB/°C conversion factor, obtaining -21°C

Regards

Eleon

You rock! Thanks! It works!