DS18B20
DS18B20 OPERATION EXAMPLE 1
In this example there are multiple DS18B20s on the bus and they are using parasite power. The bus
master initiates a temperature conversion in a specific DS18B20 and then reads its scratchpad and
recalculates the CRC to verify the data.
MASTER MODE
DATA (LSB FIRST)
Reset
COMMENTS
Master issues reset pulse.
DS18B20s respond with presence pulse.
Master issues Match ROM command.
Master sends DS18B20 ROM code.
Master issues Convert T command.
Tx
Rx
Tx
Tx
Tx
Presence
55h
64-bit ROM code
44h
DQ line held high by
strong pullup
Reset
Master applies strong pullup to DQ for the duration of the
conversion (tCONV).
Master issues reset pulse.
DS18B20s respond with presence pulse.
Master issues Match ROM command.
Master sends DS18B20 ROM code.
Master issues Read Scratchpad command.
Master reads entire scratchpad including CRC. The master
then recalculates the CRC of the first eight data bytes from the
scratchpad and compares the calculated CRC with the read
CRC (byte 9). If they match, the master continues; if not, the
read operation is repeated.
Tx
Tx
Rx
Tx
Tx
Tx
Presence
55h
64-bit ROM code
BEh
Rx
9 data bytes
DS18B20 OPERATION EXAMPLE 2
In this example there is only one DS18B20 on the bus and it is using parasite power. The master writes to
the TH, TL, and configuration registers in the DS18B20 scratchpad and then reads the scratchpad and
recalculates the CRC to verify the data. The master then copies the scratchpad contents to EEPROM.
MASTER MODE DATA (LSB FIRST)
COMMENTS
Tx
Rx
Tx
Tx
Tx
Tx
Rx
Tx
Tx
Reset
Presence
CCh
4Eh
3 data bytes
Reset
Presence
CCh
BEh
Master issues reset pulse.
DS18B20 responds with presence pulse.
Master issues Skip ROM command.
Master issues Write Scratchpad command.
Master sends three data bytes to scratchpad (TH, TL, and config).
Master issues reset pulse.
DS18B20 responds with presence pulse.
Master issues Skip ROM command.
Master issues Read Scratchpad command.
Master reads entire scratchpad including CRC. The master then
recalculates the CRC of the first eight data bytes from the
scratchpad and compares the calculated CRC with the read CRC
(byte 9). If they match, the master continues; if not, the read
operation is repeated.
Rx
9 data bytes
Tx
Rx
Tx
Tx
Reset
Presence
CCh
Master issues reset pulse.
DS18B20 responds with presence pulse.
Master issues Skip ROM command.
48h
Master issues Copy Scratchpad command.
DQ line held high by Master applies strong pullup to DQ for at least 10ms while copy
Tx
strong pullup
operation is in progress.
18 of 22