JAJSR20 January 2024 TMP119
PRODUCTION DATA
The TMP119 temperature registers use a 16-bit format. Temperature data is represented by a 16-bit 2's complement word with a Least Significant Bit (LSB) equal to 0.0078125°C. The temperature output of the TMP119 has a range of -256°C to 255°C. The fractional values are included in the temperature readings, which can be denoted using Q notation, a simple way to represent the length of the fractional portion of the value. 2's Compliment is employed to describe negative temperatures. C code can easily convert the 2's Compliment data when the data is typecast into the correct signed data type.
Parameter | Value |
---|---|
Bits | 16 |
Q | 7 |
Resolution | 0.0078125 |
Range (+) | 255.9921875 |
Range (-) | -256 |
25˚C | 0xC80 |
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sign | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 0.5 | 0.25 | 0.125 | 0.0625 | 0.03125 | 0.015625 | 0.0078125 |
-256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 1/2 | 1/4 | 1/8 | 1/16 | 1/32 | 1/64 | 1/128 |
-28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 2-1 | 2-2 | 2-3 | 2-4 | 2-5 | 2-6 | 2-7 |
C Code Examples:
/* 16-bit format will have 0 bits discarded by right shift
q7 is 0.0078125 resolution
the following bytes represent 24.5C */
uint8_t byte1 = 0xC;
uint8_t byte2 = 0x40;
float f = ((int8_t) byte1 << 8 | byte2) * 0.0078125f;
int mC = ((int8_t) byte1 << 8 | byte2) * 1000 >> 7;
int C = ((int8_t) byte1 << 8 | byte2) >> 7;