# DS18B20 temperature interpretation

I have a problem interpretting the temperature reading of a DS18B20 chip. There is a certain situation I am not abble to resolve. This is the example temp table for the chip from the datasheet:

an example for reading of -0.5*C is shown as FFF8. Cutting off the 4 LSBits we get 0x0FFF. In signed data structure that is equal to -1, not 0. How am I abble to resolve the difference between 2 readings: -0.5*C and -1.5*C? If 0xFFF8 = -0.5 then what is the form of -1.5?

The table then shows an example for -10.125*C. Cutting off the 4 LSBits gives 0x0FF5 which really is -10, then there is no reason to think that there is some kind of a shift for reading negative values...

• When you cut off the low four bits you are losing the fractional part of the temperature reading. So -0.5 looks like -1.0 because the scale of the highest order of the low four bits that you lopped off are effectively >= 0.5 rounds up to next integer (either positive or negative). – Michael Karas Dec 29 '14 at 13:05

int16_t min5s = 0xFF5E;