ZHCSE08D May 2015 – January 2020 TMP107
PRODUCTION DATA.
The 14-bit digital output from each temperature measurement conversion is stored in the temperature register. Read two bytes to obtain the data. Table 1 summarizes the temperature data format. Negative numbers are represented in binary twos complement format. The temperature sensor resolution is 0.015625ºC/LSB.
TEMPERATURE (°C) | DIGITAL OUTPUT | |
---|---|---|
BINARY | HEX | |
127.984 | 01 1111 1111 1111 | 1FFF |
100 | 01 1001 0000 0000 | 1900 |
80 | 01 0100 0000 1000 | 1408 |
75 | 01 0010 1100 0000 | 12C0 |
50 | 00 1100 1000 0000 | C80 |
25 | 00 0110 0100 0000 | 640 |
0.25 | 00 0000 0001 0000 | 10 |
0 | 00 0000 0000 0000 | 0 |
–0.25 | 11 1111 1111 0000 | 3FF0 |
–25 | 11 1001 1100 0000 | 39C0 |
–55 | 11 0010 0100 0000 | 3240 |
Use the following rules to obtain the data for a given temperature, and vice versa.
Divide the temperature by the resolution. Then, convert the result to binary code with a 14-bit, left-justified format.
Example: (50°C) / (0.015625°C / LSB) = 3200 = C80h = 00 1100 1000 0000 = C80h
Convert the 14-bit, left-justified, binary temperature result to a decimal number. Then, multiply the decimal number by the resolution to obtain the positive temperature.
Example: 00 1100 1000 0000 = C80h = 3200 × (0.015625°C / LSB) = 50°C
Divide the absolute value of the temperature by the resolution and convert the result to binary code with a 14-bit, left-justified format. Then, generate the twos complement of the result by complementing the binary number and adding one.
Example: (|–25°C|) / (0.015625°C / LSB) = 1600 = 640h = 00 0110 0100 0000
Twos complement format: 11 1001 1011 1111 + 1 = 11 1001 1100 0000 = 39C0h
Generate the twos complement of the 14-bit, left-justified binary number of the temperature result by complementing the binary number and adding one. This number is the binary representation of the absolute value of the temperature. Convert to a decimal number and multiply by the resolution to obtain the absolute temperature, then multiply by –1 for the negative sign.
Example: 11 1001 1100 0000 has a twos complement of 00 0110 0011 1111 + 1 = 00 0110 0100 0000
Convert to temperature: 00 0110 0100 0000 = 640h = 1600; 1600 × (0.015625°C / LSB) = 25°C = (|–25°C|); (|–25°C|) × (–1) = –25°C