Datasheet
The DS18B20 output temperature data is calibrated in
degrees Celsius; for Fahrenheit applications, a lookup
table or conversion routine must be used. The tempera-
ture data is stored as a 16-bit sign-extended two’s comple-
ment number in the temperature register (see Figure 4).
The sign bits (S) indicate if the temperature is positive
or negative: for positive numbers S = 0 and for negative
numbers S = 1. If the DS18B20 is configured for 12-bit
resolution, all bits in the temperature register will contain
valid data. For 11-bit resolution, bit 0 is undefined. For
10-bit resolution, bits 1 and 0 are undefined, and for 9-bit
resolution bits 2, 1, and 0 are undefined. Table 1 gives
examples of digital output data and the corresponding
temperature reading for 12-bit resolution conversions.
Operation—Alarm Signaling
After the DS18B20 performs a temperature conversion,
the temperature value is compared to the user-defined
two’s complement alarm trigger values stored in the
1-byte T
H
and T
L
registers (see Figure 5). The sign bit (S)
indicates if the value is positive or negative: for positive
numbers S = 0 and for negative numbers S = 1. The T
H
and T
L
registers are nonvolatile (EEPROM) so they will
retain data when the device is powered down. T
H
and T
L
can be accessed through bytes 2 and 3 of the scratchpad
as explained in the Memory section.
Only bits 11 through 4 of the temperature register are
used in the T
H
and T
L
comparison since T
H
and T
L
are
8-bit registers. If the measured temperature is lower than
Figure 4. Temperature Register Format
Figure 5. T
H
and T
L
Register Format
Table 1. Temperature/Data Relationship
*The power-on reset value of the temperature register is +85°C.
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
LS BYTE 2
3
2
2
2
1
2
0
2
-1
2
-2
2
-3
2
-4
BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8
MS BYTE S S S S S 2
6
2
5
2
4
S = SIGN
TEMPERATURE (°C)
DIGITAL OUTPUT
(BINARY)
DIGITAL OUTPUT
(HEX)
+125 0000 0111 1101 0000 07D0h
+85* 0000 0101 0101 0000 0550h
+25.0625 0000 0001 1001 0001 0191h
+10.125 0000 0000 1010 0010 00A2h
+0.5 0000 0000 0000 1000 0008h
0 0000 0000 0000 0000 0000h
-0.5 1111 1111 1111 1000 FFF8h
-10.125 1111 1111 0101 1110 FF5Eh
-25.0625 1111 1110 0110 1111 FE6Fh
-55 1111 1100 1001 0000 FC90h
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
S 2
6
2
5
2
4
2
3
2
2
2
1
2
0
DS18B20 Programmable Resolution
1-Wire Digital Thermometer
www.maximintegrated.com
Maxim Integrated
│
6