link to page 6 link to page 12 link to page 14 link to page 7 DS18B20 Programmable Resolution 1-Wire Digital Thermometer If there is only one slave on the bus, the simpler Read master must return to Step 1 (Initialization) in the transac- ROM [33h] command can be used in place of the Search tion sequence. See the Operation—Alarm Signaling sec- ROM process. For a detailed explanation of the Search tion for an explanation of alarm flag operation. ROM procedure, refer to Application Note 937: Book of iButton® Standards. After every Search ROM cycle, the DS18B20 Function Commands bus master must return to Step 1 (Initialization) in the After the bus master has used a ROM command to transaction sequence. address the DS18B20 with which it wishes to communi- Read Rom [33h] cate, the master can issue one of the DS18B20 function commands. These commands allow the master to write This command can only be used when there is one slave to and read from the DS18B20’s scratchpad memory, on the bus. It allows the bus master to read the slave’s initiate temperature conversions and determine the power 64-bit ROM code without using the Search ROM proce- supply mode. The DS18B20 function commands, which dure. If this command is used when there is more than are described below, are summarized in Table 3 and illus- one slave present on the bus, a data collision will occur trated by the flowchart in Figure 14. when all the slaves attempt to respond at the same time. Convert T [44h]Match Rom [55H] This command initiates a single temperature conversion. The match ROM command followed by a 64-bit ROM Following the conversion, the resulting thermal data is code sequence allows the bus master to address a stored in the 2-byte temperature register in the scratch- specific slave device on a multidrop or single-drop bus. pad memory and the DS18B20 returns to its low-power Only the slave that exactly matches the 64-bit ROM code idle state. If the device is being used in parasite power sequence will respond to the function command issued mode, within 10µs (max) after this command is issued by the master; all other slaves on the bus will wait for a the master must enable a strong pullup on the 1-Wire bus reset pulse. for the duration of the conversion (tCONV) as described Skip Rom [CCh] in the Powering the DS18B20 section. If the DS18B20 is The master can use this command to address all devices powered by an external supply, the master can issue read on the bus simultaneously without sending out any ROM time slots after the Convert T command and the DS18B20 code information. For example, the master can make all will respond by transmitting a 0 while the temperature DS18B20s on the bus perform simultaneous temperature conversion is in progress and a 1 when the conversion is conversions by issuing a Skip ROM command followed by done. In parasite power mode this notification technique a Convert T [44h] command. cannot be used since the bus is pulled high by the strong pullup during the conversion. Note that the Read Scratchpad [BEh] command can follow the Skip ROM command only if there is a single Write Scratchpad [4Eh] slave device on the bus. In this case, time is saved by This command allows the master to write 3 bytes of data allowing the master to read from the slave without send- to the DS18B20’s scratchpad. The first data byte is written ing the device’s 64-bit ROM code. A Skip ROM command into the TH register (byte 2 of the scratchpad), the second followed by a Read Scratchpad command will cause byte is written into the TL register (byte 3), and the third a data collision on the bus if there is more than one byte is written into the configuration register (byte 4). Data slave since multiple devices will attempt to transmit data must be transmitted least significant bit first. All three simultaneously. bytes MUST be written before the master issues a reset, Alarm Search [ECh] or the data may be corrupted. The operation of this command is identical to the operation Read Scratchpad [BEh] of the Search ROM command except that only slaves with This command allows the master to read the contents of a set alarm flag will respond. This command allows the the scratchpad. The data transfer starts with the least sig- master device to determine if any DS18B20s experienced nificant bit of byte 0 and continues through the scratchpad an alarm condition during the most recent temperature until the 9th byte (byte 8 – CRC) is read. The master may conversion. After every Alarm Search cycle (i.e., Alarm issue a reset to terminate reading at any time if only part Search command followed by data exchange), the bus of the scratchpad data is needed. iButton is a registered trademark of Maxim Integrated Products, Inc. www.maximintegrated.com Maxim Integrated │ 11