Datasheet
The DS18S20 output data is calibrated in degrees cen-
tigrade; for Fahrenheit applications, a lookup table or
conversion routine must be used. The temperature data is
stored as a 16-bit sign-extended two’s complement num-
ber 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. Table 1 gives examples of digital output data and the
corresponding temperature reading.
Resolutions greater than 9 bits can be calculated using the
data from the temperature, COUNT REMAIN and COUNT
PER °C registers in the scratchpad. Note that the COUNT
PER °C register is hard-wired to 16 (10h). After reading
the scratchpad, the TEMP_READ value is obtained by
truncating the 0.5°C bit (bit 0) from the temperature data
(see Figure 4). The extended resolution temperature can
then be calculated using the following equation:
TEMPERATURE TEMP_READ 0.25
COUNT_PER_C COUNT_REMAIN
COUNT_PER_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 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 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.
Table 1. Temperature/Data Relationship
*The power-on reset value of the temperature register is +85°C.
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
Figure 4. Temperature Register Format
Figure 5. T
H
and T
L
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
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
DS18S20 High-Precision 1-Wire Digital Thermometer
www.maximintegrated.com
Maxim Integrated
│
6