
DS1821
062498 3/15
OPERATION
Temperature Measurement
The DS1821 measures temperatures through the use of
an on–board proprietary temperature measurement
technique. The temperature reading is provided in an
8–bit, two’s complement reading. Table 1 describes the
exact relationship of output data to measured tempera-
ture. The data is transmitted serially over the 1–Wire
interface. The DS1821 can measure temperature over
the range of –55
°
C to +125
°
C in 1
°
C increments. For
Fahrenheit usage, a lookup table or conversion factor
must be used. Please refer to Application Note 105 for
the method to increase the resolution of the DS1821.
TEMPERATURE/DATA RELATIONSHIPS
Table 1
TEMPERATURE
DIGITAL
OUTPUT
(Binary)
DIGITAL
OUTPUT
(Hex)
+125
°
C
01111101
7Dh
+25
°
C
00011001
19h
0
°
C
00000000
00h
–1
°
C
11111111
FFh
–25
°
C
11100111
E7h
–55
°
C
11001001
C9h
Thermostat Controls
In its thermostat mode, the DS1821 functions as a ther-
mostat with programmable hysteresis, as shown in
Figure 2. Temperature conversions begin as soon as
V
DD
is applied to the device, and are continually made,
so that the thermostat output updates as soon as a tem-
perature conversion is complete. This is approximately
once every second.
When the DS1821’s temperature meets or exceeds the
value stored in the high temperature trip register (TH),
the output becomes active, and will stay active until the
temperature falls below the temperature stored in the
low temperature trigger register (TL). In this way, any
amount of hysteresis may be obtained.
The active state for the output is programmable by the
user, so that an active state may either be a logic 1 (+5V,
output transistor off) or a logic 0 (0V, output
transistor on).
THERMOSTAT OUTPUT OPERATION
Figure 2
TL
TH
T (
°
C)
DQ (Thermostat output, Active=High) V
DD
=5 volts
PROGRAMMING THE DS1821
To program the DS1821, it must be placed in 1–Wire
mode. This mode is active when the device arrives from
the factory. Once the part has been programmed, and if
the user has set the power–up state to thermostat
mode, 1–Wire mode may only be achieved by bringing
the V
DD
pin low while holding the DQ line high, then
clocking the DQ line 16 times.
The DS1821 has four internal registers that may be
accessed through the DQ pin when the device is in
1–Wire mode. These registers are the high temperature
trigger (TH), low temperature trigger (TL), the actual
measured temperature result, and the status register.
The TH,TL, and status registers are all nonvolatile.
The DS1821 must have temperature settings resident in
the TH and TL registers for thermostatic operation. The
temperature result register and the thermostat limit reg-
isters (TH and TL) hold an eight bit number in the two’s
complement format described in Table 1.
A status register is also present, indicating the status of
the thermostatic control, and allowing configuration of
the output polarity as either active high or active low, and
establishes the power–up state of the device.
The status register is defined as follows:
where,
POL 1SHOT
NVB
DONE
1
THF
TLF
T/R
DONE = Conversion Done bit. “1” = Conversion com-
plete, “0” = conversion in progress.
THF =
Temperature High Flag. This bit will normally
be “0”, but will be set to “1” when the tempera-
ture exceeds the value of TH. It will remain “1”