【文章內(nèi)容簡介】
vice and allow the master to single out a specific device if many are present on the 1Wire bus. These mands 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 mands, and each mand is 8 bits long. The master device must issue an appropriate ROM mand before issuing a DS18B20 function mand. 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 (., Search ROM mand 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 mand can be used in place of the Search ROM process. ROM [33h] This mand can only be used when there is one slave on the bus. It allows the bus master to read the slave’s 64bit ROM code without using the Search ROM procedure. If this mand 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. ROM [55h] The match ROM mand followed by a 64bit ROM code sequence allows 外文翻譯(原文) 9 the bus master to address a specific slave device on a multidrop or singledrop bus. Only the slave that exactly matches the 64bit ROM code sequence will respond to the function mand issued by the master。 all other slaves on the bus will wait for a reset pulse. ROM [CCh] The master can use this mand to address all devices on the bus simultaneously without sending out any ROM code information. For example, the master can make all DS18B20s on the bus perform simultaneous temperature conversions by issuing a Skip ROM mand followed by a Convert T [44h] mand. Note that the Read Scratchpad [BEh] mand can follow the Skip ROM mand only if there is a single slave device on the bus. In this case, time is saved by allowing the master to read from the slave without sending the device’s 64bit ROM code. A Skip ROM mand followed by a Read Scratchpad mand will cause a data collision on the bus if there is more than one slave since multiple devices will attempt to transmit data simultaneously. SEARCH [ECh] The operation of this mand is identical to the operation of the Search ROM mand except that only slaves with a set alarm flag will respond. This mand allows the master device to determine if any DS18B20s experienced an alarm condition during the most recent temperature conversion. After every Alarm Search cycle (., Alarm Search mand followed by data exchange), the bus master must return to Step 1 (Initialization) in the transaction sequence. ( 3) DS18B20 FUNCTION COMMANDS After the bus master has used a ROM mand to address the DS18B20 with which it wishes to municate, the master can issue one of the DS18B20 function mands. These mands allow the master to write to and read from the DS18B20’s scratchpad memory, initiate temperature conversions and determine the power supply mode. 外文翻譯(原文) 10 T [44h] This mand initiates a single temperature conversion. Following the conversion, the resulting thermal data is stored in the 2byte temperature register in the scratchpad memory and the DS18B20 returns to its lowpower idle state. If the device is being used in parasite power mode, within 10181。s (max) after this mand is issued the master must enable a strong pull up on the 1Wire bus. If the DS18B20 is powered by an external supply, the master can issue read time slots after the Convert T mand and the DS18B20 will respond by transmitting a 0 while the temperature conversion is in progress and a 1 when the conversion is done. In parasite power mode this notification technique cannot be used since the bus is pulled high by the strong pull up during the conversion. SCRATCHPAD [BEh] This mand allows the master to read the contents of the scratchpad. The data transfer starts with the least significant bit of byte 0 and continues through the scratchpad until the 9th byte (byte 8 – CRC) is read. The master may issue a reset to terminate reading at any time if only part of the scratchpad data is needed. SCRATCHPAD [4Eh] This mand allows the master to write 3 bytes of data to the DS18B20’s scratchpad. The first data byte is written into the TH register (byte 2 of the scratchpad), the second byte is written into the TL register (byte 3), and the third byte is written into the configuration register (byte 4). Data must be transmitted least significant bit first. All three bytes MUST be written before the master issues a reset, or the data may be corrupted. SCRATCHPAD [48h] This mand copies the contents of the scratchpad TH, TL and configuration registers (bytes 2, 3 and 4) to EEPROM. If the device is being used in parasite power mode, within 10181。s (max) after this mand is issued the master must enable a 外文翻譯(原文) 11 strong pullup on the 1Wire bus. E2 [B8h] This mand recalls the alarm trigger values (TH and TL) and configuration data from EEPROM and places the data in bytes 2, 3, and 4, respectively, in the scratchpad memory. The master device can issue read time slots following the Recall E2mand and the DS18B20 will indicate the status of the recall by transmitting 0 while the recall is in progress and 1 when the recall is done. The recall operation happens automatically at powerup, so valid data is available in the scratchpad as soon as power is applied to the device. 6. READ POWER SUPPLY [B4h] The master device issues this mand followed by a read time slot to determine if any DS18B20s on the bus are using parasite power. During the read time slot, parasite powered DS18B20s will pull the bus