JAJSHZ0A April 2013 – September 2019 TMP108
PRODUCTION DATA.
The temperature register is configured as a 12-bit, read-only register that stores the output of the most recent conversion. Two bytes must be read to obtain data, as shown in Table 5 and Table 6. Note that byte 1 is the most significant byte, followed by byte 2, the least significant byte. The first 12 bits are used to indicate temperature. There is no requirement to read the least significant byte if that information is not needed (for example, for resolution lower than 1°C). Table 7 summarizes the temperature data format. One LSB equals 0.0625°C. Negative numbers are represented in binary twos complement format. Following power-up or reset, the temperature register reads 0°C until the first conversion is complete. The unused bits in the temperature register always read 0.
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
---|---|---|---|---|---|---|---|
T11 | T10 | T9 | T8 | T7 | T6 | T5 | T4 |
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
---|---|---|---|---|---|---|---|
T3 | T2 | T1 | T0 | 0 | 0 | 0 | 0 |
TEMPERATURE (°C) | DIGITAL OUTPUT | |
---|---|---|
BINARY | HEX | |
128 | 0111 1111 1111 | 7FF |
127.9375 | 0111 1111 1111 | 7FF |
100 | 0110 0100 0000 | 640 |
80 | 0101 0000 0000 | 500 |
75 | 0100 1011 0000 | 4B0 |
50 | 0011 0010 0000 | 320 |
25 | 0001 1001 0000 | 190 |
0.25 | 0000 0000 0100 | 004 |
0 | 0000 0000 0000 | 000 |
–0.25 | 1111 1111 1100 | FFC |
–25 | 1110 0111 0000 | E70 |
–55 | 1100 1001 0000 | C90 |
Table 7 does not supply a full list of all temperatures. Use the following rules to obtain the digital data format for a given temperature.
To convert positive temperatures to a digital data format:
Divide the temperature by the resolution. Then, convert the result to binary code with a 12-bit, left-justified format, and MSB = 0 to denote a positive sign.
Example: (+50°C)/(0.0625°C/count) = 800 = 320h = 0011 0010 0000
To convert negative temperatures to a digital data format:
Divide the absolute value of the temperature by the resolution, and convert the result to binary code with a 12-bit, left-justified format. Then, generate the twos complement of the result by complementing the binary number and adding one. Denote a negative number with MSB = 1.
Example: (|–25°C|)/(0.0625°C/count) = 400 = 190h = 0001 1001 0000
Twos complement format: 1110 0110 1111 + 1 = 1110 0111 0000