DS18B20
Figure 2. Temperature Register Format
BIT 7
2
3
BIT 15
MS BYTE
S = SIGN
LS BYTE
BIT 6
2
2
BIT 14
S
BIT 5
2
1
BIT 13
S
BIT 4
2
0
BIT 12
S
BIT 3
2
-1
BIT 11
S
BIT 2
2
-2
BIT 10
2
6
BIT 1
2
-3
BIT 9
2
5
BIT 0
2
-4
BIT 8
2
4
S
Table 1. Temperature/Data Relationship
TEMPERATURE (°C)
+125
+85*
+25.0625
+10.125
+0.5
0
-0.5
-10.125
-25.0625
-55
DIGITAL OUTPUT
(BINARY)
0000 0111 1101 0000
0000 0101 0101 0000
0000 0001 1001 0001
0000 0000 1010 0010
0000 0000 0000 1000
0000 0000 0000 0000
1111 1111 1111 1000
1111 1111 0101 1110
1111 1110 0110 1111
1111 1100 1001 0000
DIGITAL OUTPUT
(HEX)
07D0h
0550h
0191h
00A2h
0008h
0000h
FFF8h
FF5Eh
FE6Fh
FC90h
*The
power-on reset value of the temperature register is +85°C.
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 3).
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.
Figure 3. T
H
and T
L
Register Format
BIT 7
S
BIT 6
2
6
BIT 5
2
5
BIT 4
2
5
BIT 3
2
5
BIT 2
2
2
BIT 1
2
1
BIT 0
2
0
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 or equal to T
L
or higher than or equal to T
H
,
an alarm condition exists and an alarm flag is set inside the DS18B20. This flag is updated after every
temperature measurement; therefore, if the alarm condition goes away, the flag will be turned off after the
next temperature conversion.
4 of 22