Datasheet
DS18S20
4 of 23
Figure 2. Temperature Register Format
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
LS BYTE
2
6
2
5
2
4
2
3
2
2
2
1
2
0
2
-1
BIT 15
BIT 14
BIT 13
BIT 12
BIT 11
BIT 10
BIT 9
BIT 8
MS BYTE
S S S S S S S S
S = SIGN
Table 1. Temperature/Data Relationship
TEMPERATURE
(
°
C)
DIGITAL OUTPUT
(BINARY)
DIGITAL OUTPUT
(HEX)
+85.0*
0000 0000 1010 1010
00AAh
+25.0 0000 0000 0011 0010 0032h
+0.5
0000 0000 0000 0001
0001h
0
0000 0000 0000 0000
0000h
-0.5
1111 1111 1111 1111
FFFFh
-25.0
1111 1111 1100 1110
FFCEh
-55.0
1111 1111 1001 0010
FF92h
*The power-on reset value of the temperature register is +85°C.
OPERATION—ALARM SIGNALING
After the DS18S20 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
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
S 2
6
2
5
2
5
2
5
2
2
2
1
2
0
Only bits 8 through 1 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 T
H
, an alarm
condition exists and an alarm flag is set inside the DS18S20. 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.
The master device can check the alarm flag status of all DS18S20s on the bus by issuing an Alarm Search
[ECh] command. Any DS18S20s with a set alarm flag will respond to the command, so the master can
determine exactly which DS18S20s have experienced an alarm condition. If an alarm condition exists and
the T
H
or T
L
settings have changed, another temperature conversion should be done to validate the alarm
condition.