2018-04-24 06:31 PM
Quote the datasheet:
'Temperature data is stored inside TEMP_OUT_L (05h), TEMP_OUT_H (06h) as two’s complement data in 12-bit format, right-justified.'
So if the sensor value is reading 0 and the temperature drops by 1/8th of a degree, I would expect the value to be 0xffff or 0x0fff - that is 0bxxxx111111111111. Since 111111111111 is 12 bit two's complement for -1, and the x bits are ignored.
However this is not the case. The value I actually read is 0xefff / 0b1111111011111111 / -257. The value continues to count down by 1 per 1/8 degree from here.
Can anyone explain what is going on here please?
Solved! Go to Solution.
2018-04-25 02:16 AM
Didn't you swat the High and Low byte?
Morevover 0b1111111011111111 is not 0xEFFF so I don't know which value do you read.
2018-04-25 02:16 AM
Didn't you swat the High and Low byte?
Morevover 0b1111111011111111 is not 0xEFFF so I don't know which value do you read.
2018-04-25 04:24 AM
Yes you are right. It is 0b1110111111111111 which is 12 1s, so it makes sense.