下载
![](https://oss-datasheet.aipcba.com/html/19CAA71FA2BF336DF586FA94174F4A3A/bg1.png)
Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 134
Keywords: temperature sensors, digital temperature sensors, temperature sensor IC, microcontrollers,
micro-controller, DS1620, micros
APPLICATION NOTE 134
Interfacing the DS1620 with a DS5000/8051
Microcontroller
Sep 30, 2002
Abstract: This application note introduces the user to software for interfacing a DS5000 (8051
compatible) microcontroller to the DS1620 digital temperature sensor. The DS1620 communicates via a
3-wire serial digital interface. Software code is provided that reads the DS1620 temperature register and
calculates high-resolution results based on data from the counter and slope accumulator registers.
Introduction
The DS1620 Digital Thermometer and Thermostat provides 9-bit temperature readings. It has three
alarm outputs, so the device can also act as a thermostat. The DS1620, which incorporates a 3-wire
interface can be controlled using an 8051-compatible DS5000 Secure Microcontroller. The DS1620 is
connected directly to the I/O port on the DS5000 microcontroller, and the 3-wire handshaking and
temperature readings are handled by low-level software drivers as shown in this document.
Temperature Control of the DS1620
The thermostat ouputs of the DS1620 allow it to directly control heating and cooling devices. T
HIGH
is
driven high if the device exceeds a predefined limit set within the TH Register. The output T
HIGH
can be
used to indicate that a high temperature tolerance boundary has been met or exceeded, or it can be
used as part of a closed loop system to activate a cooling system and deactivate it when the system
temperature returns to tolerance. T
LOW
is driven high when the temperature of the device falls below the
limit set in the TL Register. T
LOW
remains active until the DS1620's temperature becomes greater than
the value stored in the low temperature register, TL. T
COM
is driven high when the temperature exceeds
the limit set in the TH Register and remains high until the device temperature falls below that set in the
TL Register. In this way, any amount of user-defined temperature hysteresis can be obtained.
For typical thermostat operation, the DS1620 will operate in continuous mode. However, for applications
where only one reading is needed at certain times or to conserve power, the one-shot mode may be
used. Note that the thermostat outputs (T
HIGH
, T
LOW
, T
COM
) will remain in the state they were in after
the last valid temperature conversion cycle when operating in one-shot mode.
Hardware Configuration
The 3-wire bus is comprised of three signals. These are the active-low RST (reset) signal, the CLK
(clock) signal, and the DQ (data) signal. All data transfers are initiated by driving the active-low RST
Page 1 of 12