I've just started experimenting with the MPL115A2 Digital Barometer.

Maybe I’m having a bad day – but I can’t understand how to convert the Coefficient integers / binary values into numbers.

The data sheet doesn’t seem to make sense. For example a0 is defined as

a0 Signed, Integer Bits = 12, Fractional Bits = 3 : Coeff a0 = S I11 I10 I9 I8 I7 I6 I5 I4 I3 I2 I1 I0 . F2 F1 F0

Later the data sheet uses the example a0 = 0x3ECE = 2009.75

Maskign out - bits I11 to I0 gives 2009 - but the last 3 bits (the fractional bits) are 0x06 - I can't see how that taken to be 0.75?

Are there any examples of how to take these Coefficients in binary/hex form and convert them into actual numbers?

Hi Ben,

As for the fractional part, F2 = 0.5, F1 = 0.25 and F0 = 0.125.

Considering our example, the fractional part is 0b110 = 1 x 0.5 + 1 x 0.25 + 0 x 0.125 = 0.75

You may find useful David's example project, have a look at MPL115A1.c file.

I hope it helps.

Best regards,

Tomas