Datasheet

Hardware Conguration
The 1-Wire bus has by definition only a single data line.
Each device (master or slave) interfaces to the data line via
an open drain or 3-state port. This allows each device to
“release” the data line when the device is not transmitting
data so the bus is available for use by another device. The
1-Wire port of the DS18S20 (the DQ pin) is open drain with
an internal circuit equivalent to that shown in Figure 11.
The 1-Wire bus requires an external pullup resistor of
approximately 5kΩ; thus, the idle state for the 1-Wire
bus is high. If for any reason a transaction needs to be
suspended, the bus MUST be left in the idle state if the
transaction is to resume. Infinite recovery time can occur
between bits so long as the 1-Wire bus is in the inactive
(high) state during the recovery period. If the bus is held
low for more than 480µs, all components on the bus will
be reset.
Transaction Sequence
The transaction sequence for accessing the DS18S20 is
as follows:
Step 1. Initialization
Step 2. ROM Command (followed by any required data
exchange)
Step 3. DS18S20 Function Command (followed by any
required data exchange)
It is very important to follow this sequence every time the
DS18S20 is accessed, as the DS18S20 will not respond
if any steps in the sequence are missing or out of order.
Exceptions to this rule are the Search ROM [F0h] and
Alarm Search [ECh] commands. After issuing either of
these ROM commands, the master must return to Step 1
in the sequence.
Initialization
All transactions on the 1-Wire bus begin with an initializa-
tion sequence. The initialization sequence consists of a
reset pulse transmitted by the bus master followed by
presence pulse(s) transmitted by the slave(s). The pres-
ence pulse lets the bus master know that slave devices
(such as the DS18S20) are on the bus and are ready
to operate. Timing for the reset and presence pulses is
detailed in the 1-Wire Signaling section.
ROM Commands
After the bus master has detected a presence pulse, it
can issue a ROM command. These commands operate
on the unique 64-bit ROM codes of each slave device and
allow the master to single out a specific device if many
are present on the 1-Wire bus. These commands also
allow the master to determine how many and what types
of devices are present on the bus or if any device has
experienced an alarm condition. There are five ROM com-
mands, and each command is 8 bits long. The master
device must issue an appropriate ROM command before
issuing a DS18S20 function command. A flowchart for
operation of the ROM commands is shown in Figure 16.
Search Rom [F0h]
When a system is initially powered up, the master must
identify the ROM codes of all slave devices on the bus,
which allows the master to determine the number of
slaves and their device types. The master learns the ROM
codes through a process of elimination that requires the
master to perform a Search ROM cycle (i.e., Search ROM
command followed by data exchange) as many times as
necessary to identify all of the slave devices. If there is
only one slave on the bus, the simpler Read ROM com-
mand (see below) can be used in place of the Search
ROM process. For a detailed explanation of the Search
ROM procedure, refer to the ịButton
®
Book of Standards
at www.maximintegrated.com/ibuttonbook. After every
Search ROM cycle, the bus master must return to Step 1
(Initialization) in the transaction sequence.
Read ROM [33h]
This command can only be used when there is one slave
on the bus. It allows the bus master to read the slave’s
64-bit ROM code without using the Search ROM proce-
dure. If this command is used when there is more than
one slave present on the bus, a data collision will occur
when all the slaves attempt to respond at the same time.
ịButton is a registered trademark of Maxim Integrated Products, Inc.
Figure 11. Hardware Configuration
DQ
V
PU
4.7kΩ
DS18S20
1-Wire PORT
Rx
Tx
100
MOSFET
5µA
TYP
1-Wire BUS
Rx
Tx
Rx = RECEIVE
Tx = TRANSMIT
DS18S20 High-Precision 1-Wire Digital Thermometer
www.maximintegrated.com
Maxim Integrated
10