Hello everyone. I'm trying to interface a microcontroller with TMP100 (when add0->float and add1->gnd).
In i2c bus I put 10kohm resistors, and it's communicating with the sensor.
Well I'm sending to the configuration register the resolution 12 bits (0x60) and shutdown (0x01) ok? After put this in the tmp100 I try to read back the configuration register and I got the value that i put + OS/ALERT bit, so it's E1 ok (0x80 + 0x60 + 0x01). OK fine. If I'm never read the temperature registers, I always get E1 in the configuration register. If i read the temperature registers the configuration register automatically goes to 0x81 (the resolution goes to 9bits), I have to always reconfigure it after read a temperature? what is wrong?
About the temperature data. After read the 2 bytes (assuming I'm using 9bits resolution ok) I do this:
value = ((I2CSlaveBuffer[0] << 8) | I2CSlaveBuffer[1]) >> 7; (shift to create a properly integer).
// Sign extend negative numbers
if (I2CSlaveBuffer[0] & 0x80)
{
// Negative number
*value |= 0xFE00;
}
But after this. HOW i convert the integer to temperature in ºC?? In the datasheet there is a "resolution" different for 9bit, 10, 11 and 12bits. The integer i need to multiply to the resolution? Only this? I didn't understand how I convert the temperature.