Trying to understand | MSB << 8 + LSB | Logic analyzer from BMP180

Hey Guys,

I'm trying to understand the output of BMP180 - I2C

In the Datasheet I found this Formular:

What exactly is meant with this formular.

UT= MSB << 8 + LSB
MSB is 0xf6 - this can be found on my output of the logic analyzer.. but where is LSB and how what is <<?

Can some give me a quick overview how I can comprehand this? MY goal is to calculate the Temperature with the formular in the datasheet in combination from the logic analyzer data.

Greetings

Most Significant Byte
Least Significant Byte.
<< is the logical left shift operator.

1 Like

UT is assigned the sum of the MSB shifted left 8 places and added to LSB.

1 Like

That code is most often used when two 8 bit bytes are read (for example from an I2C device). Those two bytes are called LSB (Least significant byte) and MSB (most significant byte). Eachbyte contains half of a 16 bit integer value.

Assuming thaz MSB was binary 0000001 and LSB was binary 00000011.

MSB << 8 would get 0000000100000000, adding in LSB would get a final result of 0000000100000011 which is a 16 bit integer with the value of 256 (from MSB) plus 3 (from LSB) equalling 259.

1 Like

MSB LSB is a 16 bit binary number sent in two separate operations of 8 bits each

MSB                 LSB
01001010         10010100

<< is shift a binary number to the left. Being binary each time you shift you essentially multiply by 2 ( for decimal consider 10<<2 = 1000 ) so shifting by 8 is the same a multiplying by 256.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.