DS18B20 temperature interpretation


#1

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 of ds18b20

an example for reading of -0.5C 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.5C 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…


#2

I can’t say I’ve ever tried to read a negative C value yet, but I would assume that whatever library you are using should handle it fine. What device/library are you using?