【正文】
te. If the DS18B20 is powered by an external supply, the master can issue “read time slots” (see the 1WIRE BUS SYSTEM section) after the Convert T mand and the DS18B20 will respond by transmitting 0 while the temperature conversion is in progress and 1 when the conversion is done. If the DS18B20 is powered with parasite power, this notification technique cannot be used since the bus must be pulled high by a strong pullup during the entire temperature conversion. The bus requirements for parasite power are explained in detail in the POWERING THE DS18B20 section of this datasheet。C. In addition, the DS18B20 can derive powerdirectly from the data line (“parasite power”), eliminating the need for an external power supply. Each DS18B20 has a unique 64bit serial code, which allows multiple DS18B20s to function on the same 1–wire bus。C ● Thermometer resolution is userselectable from 9 to 12 bits ● Converts temperature to 12bit digital word in 750ms (max.) ● Userdefinable nonvolatile (NV) alarm settings ● Alarm search mand identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition) ● Available in 8pin SO (150mil), 8pin SOP, and 3pin TO92 packages ● Software patible with the DS1822 ● Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermally sensitive 二 . DESCRIPTION The DS18B20 Digital Thermometer provides 9 to 12–bit centigrade temperature measurements and has an alarm function with nonvolatile userprogrammable upper and lower trigger points. The DS18B20 municates over a 1Wire bus that by definition requires only one data line (and ground) for munication with a central microprocessor. It has an operating temperature range of –55176。C (–67176。C to +125176。C to +85176。C to +85176。 四 . OPERATION — MEASURING TEMPERATURE The core functionality of the DS18B20 is its directtodigital temperature sensor. The resolution of the temperature sensor is userconfigurable to 9, 10, 11, or 12 bits, corresponding to increments of C, C, C, and C, respectively. The default resolution at powerup is 12bit. The DS18B20 powersup in a lowpower idle state。 五 . OPERATION — ALARM SIGNALING After the DS18B20 performs a temperature conversion, the temperature value is pared to the userdefined two’s plement alarm trigger values stored in the 1byte TH and TL registers (see Figure 3). The sign bit (S) indicates if the value is positive or negative: for positive numbers S = 0 and for negative numbers S = 1. The TH and TL registers are nonvolatile (EEPROM) so they will retain data when the device is powered down. TH and TL can be accessed through bytes 2 and 3 of the scratchpad as explained in the MEMORY section of this datasheet。 these bytes will return all 1s when read. Byte 8 of the scratchpad is readonly and contains the cyclic redundancy check (CRC) code for bytes 0 through 7 of the scratchpad. The DS18B20 generates this CRC using the method described in the CRC GENERATION section. Data is written to bytes 2, 3, and 4 of the scratchpad using the Write Scratchpad [4Eh] mand。 C 至 +125 176。 C 的精度為 176。 C到 +125 176。 C 。此特性的應(yīng)用范圍包括 HVAC、環(huán)境控制、建筑物、設(shè)備或機(jī)械內(nèi)的溫度檢測以及過程監(jiān)視和控制系統(tǒng)。配置寄存器允許用戶設(shè)置的溫度到數(shù)字轉(zhuǎn)換的分辨率為 9, 10,11或 12位。在這種總線系統(tǒng)中,微處理器(主設(shè)備)和地址標(biāo)識上使用其獨(dú)有的 64位代碼。當(dāng) DQ引腳為高電平時,電壓是單總線上拉電阻通過 DQ引腳供應(yīng)的。 四. 運(yùn)用 —— 測量溫度 該 DS18B20的核心功能是 它是直接輸出數(shù)字信號的 溫度傳感器。 C 和 176。轉(zhuǎn)換后,所產(chǎn)生的數(shù)據(jù)存儲在內(nèi)存中的 2比特溫度 寄存器中, DS18B20返回其空閑狀態(tài)。 DS18B20 的輸出溫度數(shù)據(jù) 為標(biāo)準(zhǔn) 攝氏度 。如果是 DS18B20配置 為 12位分辨率,在溫度寄存器的所有位將包含有效數(shù)據(jù)。表 2給出了輸出數(shù)字?jǐn)?shù)據(jù) 和 相應(yīng) 的 12位分辨率溫度讀數(shù)轉(zhuǎn)換例子 。 TH 和 TL 可通過 暫存器中 字節(jié) 2和 3獲得,此內(nèi)容 在本數(shù)據(jù)表內(nèi)存部分解釋 。主設(shè)備可以 通過搜索 ECH命令 檢查總線上所有 DS18B20s 報警標(biāo)志 位 的狀態(tài)。寄生 電源在遠(yuǎn)程或者 空間受限 情況下感溫 是非常有用的。在寄生電源模式下, 單 總線和 CPP可以提供足夠的電流給 DS18B20的大部分操作,只要指定的時間和電壓的要求得到滿足(參考本數(shù)據(jù)手冊 DC電氣特性和 AC 電氣特性章節(jié)) 。 這可以通過使用一個 MOSFET以直接 把總線電壓下降到 如圖 4所示。 這種方法的優(yōu)點(diǎn)是不需要 MOSFET的上拉, 而且單 總線可以 在 進(jìn)行溫度轉(zhuǎn)換時間自由地進(jìn)行其他操作 。主 機(jī) 需要這些信息來確定是否強(qiáng)大的總線上拉應(yīng)在溫度轉(zhuǎn)換 時 使用。 八. 64位激光 ROM 每一 DS1820 包括一個唯一的 64 位長的 ROM 編碼。 64位 ROM代碼和相關(guān) ROM功能控制邏輯使 DS18B20作為使用協(xié)議的單 線 設(shè)備 的運(yùn)作, 單 總線系統(tǒng)的數(shù)據(jù)表部分詳細(xì)介紹了這個協(xié)議 。暫存器 的 字節(jié) 0和字節(jié) 1分別包含 LSB和 MSB溫度寄存器。字節(jié) 5, 6和 7是保留供內(nèi)部使用的設(shè)備,不能被覆蓋, 當(dāng)被讀到時, 這些字節(jié)將返回 1秒 。數(shù)據(jù)必須傳輸?shù)?DS18B20以 最低有效位開始的 第 2字節(jié)。設(shè)備 關(guān)機(jī) 時, 在 EEPROM寄存器的數(shù)據(jù) 將 被保留,上電時 EEPROM中的數(shù)據(jù) 到相應(yīng)的位置暫存器重新加載。用戶可以使用該寄存器的 R0 和 R1 的位設(shè)置DS18B20的轉(zhuǎn)換分辨率。 十一 .CRC生成 CRC字節(jié)是 DS18B20的 64位 ROM代碼的一部分,在暫存器 的第 9比特 。為了驗(yàn)證數(shù)據(jù)已被正確讀取,總線主機(jī)必須從接收到的數(shù)據(jù) 中 重新計(jì)算 CRC,然后比較此值無論是 ROM代碼( 為 ROM讀)或暫存器的 CRC(為暫存器讀?。?由總線主機(jī)產(chǎn)生的價值電路。從 ROM或從暫存器中最重要的 第 7字節(jié)轉(zhuǎn)移 到第 56比特后 ,多項(xiàng)式發(fā)生器將包含重新計(jì)算 的 CRC校驗(yàn)碼。