Data Sheet

DS18B20
14 of 27
The initialization sequence required to begin any communication with the DS18B20 is shown in
Figure 11. A reset pulse followed by a presence pulse indicates the DS18B20 is ready to send or receive
data given the correct ROM command and memory function command.
The bus master transmits (TX) a reset pulse (a low signal for a minimum of 480 µs). The bus master then
releases the line and goes into a receive mode (RX). The 1-Wire bus is pulled to a high state via the 5k
pullup resistor. After detecting the rising edge on the DQ pin, the DS18B20 waits 15-60 µs and then
transmits the presence pulse (a low signal for 60-240 µs).
MEMORY COMMAND FUNCTIONS
The following command protocols are summarized in Table 4, and by the flowchart of Figure 10.
Write Scratchpad [4Eh]
This command writes to the scratchpad of the DS18B20, starting at the TH register. The next 3 bytes
written will be saved in scratchpad memory at address locations 2 through 4. All 3 bytes must be written
before a reset is issued.
Read Scratchpad [BEh]
This command reads the contents of the scratchpad. Reading will commence at byte 0 and will continue
through the scratchpad until the ninth (byte 8, CRC) byte is read. If not all locations are to be read, the
master may issue a reset to terminate reading at any time.
Copy Scratchpad [48h]
This command copies the scratchpad into the E
2
memory of the DS18B20, storing the temperature trigger
bytes in nonvolatile memory. If the bus master issues read time slots following this command, the
DS18B20 will output 0 on the bus as long as it is busy copying the scratchpad to E
2
; it will return a 1
when the copy process is complete. If parasite-powered, the bus master has to enable a strong pullup for
at least 10 ms immediately after issuing this command. The DS18B20 EEPROM is rated for a minimum
of 50,000 writes and 10 years data retention at T=+55°C.
Convert T [44h]
This command begins a temperature conversion. No further data is required. The temperature
conversion will be performed and then the DS18B20 will remain idle. If the bus master issues read time
slots following this command, the DS18B20 will output 0 on the bus as long as it is busy making a
temperature conversion; it will return a 1 when the temperature conversion is complete. If parasite-
powered, the bus master has to enable a strong pullup for a period greater than t
conv
immediately after
issuing this command.
Recall E2 [B8h]
This command recalls the temperature trigger values and configuration register stored in E
2
to the
scratchpad. This recall operation happens automatically upon power-up to the DS18B20 as well, so valid
data is available in the scratchpad as soon as the device has power applied. With every read data time slot
issued after this command has been sent, the device will output its temperature converter busy flag:
0=busy, 1=ready.
Read Power Supply [B4h]
With every read data time slot issued after this command has been sent to the DS18B20, the device will
signal its power mode: 0=parasite power, 1=external power supply provided.