【正文】
ter are reserved for internal use by the device and cannot be overwritten. BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0 TM R1 R0 1 1 1 1 1 Figure Register R0 R1 RESOLUTION(BITS) MAX CONVERSION TIME 外文翻譯(原文) 7 Table Resolution Configuration BUS SYSTEM The 1Wire bus system uses a single bus master to control one or more slave devices. The DS18B20 is always a slave. When there is only one slave on the bus, the system is referred to as a ―singledrop‖ system。s to 240181。s. When the bus is released, the 5k? pullup resistor will pull the bus high. To generate a Write 0 time slot, after pulling the 1Wire 外文翻譯(原文) 13 bus low, the bus master must continue to hold the bus low for the duration of the time slot (at least 60181。s from the start of the slot. M A S T E R R E A D ― 0 ‖ S L O T 1 5 u s1 5 u s3 0 u s1 5 u sD S 1 8 B 2 0 r e a d t i m e s l o tV c cG N D1 w i r e b u sM A S T E R R E A D ― 1 ‖ S L O T B u s m a s t e r p u l l i n g l o w D S 1 8 B 2 0 p u l l i n g l o w R e s i s t o r p u l l u p M a s t e r s a m p l e s M a s t e r s a m p l e s 1 u s 1 u s 1 u s Figure Read Time Slot 外文翻譯(原文) 15 外文翻譯(譯文) 16 DS18B20 介紹 DS18B20 數(shù)字式溫度傳感器提供 9 位到 12 位的攝氏溫度測(cè)量,并且有用戶可編程的、非易失性溫度上下限告警出發(fā)點(diǎn)。 每一個(gè) DS18B20 都有一個(gè)獨(dú)一無二的 64 位序列碼,這個(gè)序列碼允許多個(gè)DS18B20 在同一根單總線上工作。C 到 85176。TH,TL 和配置寄存器是非易失性的( EEPROM),所以掉電后仍然能保存數(shù)據(jù)。高電平同時(shí)充電一個(gè)內(nèi)部電容,當(dāng)總線低電平時(shí)由此電容供應(yīng)能量。C。溫度數(shù)據(jù)以 16 位擴(kuò)展補(bǔ)碼信號(hào)存儲(chǔ)在溫度寄存器中(見圖 2)。最高 8 位包含一個(gè)循環(huán)冗余校驗(yàn)( CRC)字節(jié),由 ROM 碼的前 56 位計(jì)算得來。字節(jié) 4包含配置寄存器數(shù)據(jù),字節(jié) 6 和 7 是為設(shè)備內(nèi)部使用而預(yù)留 的,不可以被重寫。用戶能通過 表 2 中 寄存器 R0 和 R1 位來設(shè)置 DS18B20 的轉(zhuǎn)換精度。接下來的單總線系統(tǒng)討論分為三個(gè)題目:硬件接法,處理順序,和單線信號(hào)(信號(hào)類型與定時(shí))。這些命令的運(yùn)行基于每一個(gè)從機(jī)設(shè)備的唯一 64 位 ROM 碼,當(dāng)總線上有多個(gè)設(shè)備存在時(shí)能使主機(jī)能夠檢測(cè)出特定的設(shè)備。 ROM 命令 33H 這個(gè)命令只能用于總線上僅有一個(gè)從機(jī)的情況。如果總線上有多個(gè)從機(jī)同時(shí)試圖傳送數(shù)據(jù),跳過 ROM 命令后跟隨的讀暫存器命令就 會(huì)引發(fā)數(shù)據(jù)沖突。s 內(nèi)主機(jī)必須允許保持上拉單總線。 4EH 這個(gè)命令使主機(jī)向 DS18B20 的暫存器寫入 3 個(gè)字節(jié)的數(shù)據(jù)。 44H 這個(gè)命令啟動(dòng)溫度轉(zhuǎn)換,隨后轉(zhuǎn)換結(jié)果被存入中間結(jié)果暫存器的兩個(gè)字節(jié)溫度寄存器中,然后 DS18B20 又返回到低壓休閑狀態(tài)。注意只有在總線上僅有一個(gè)從機(jī)設(shè)備情況下跳過 ROM 命令后才能跟隨讀暫存器命令。主機(jī)通 過淘汰過程獲得 ROM 碼,這需要主機(jī)執(zhí)行多次搜索命令循環(huán)(搜索后是數(shù)據(jù)交換)直到檢測(cè)所有的從機(jī)設(shè)備。應(yīng)答脈沖時(shí)主機(jī)知道從機(jī)設(shè)備(例如 DS18B20)在總線上并已準(zhǔn)備好工作。當(dāng)總線上只有一個(gè)從機(jī)時(shí),系統(tǒng)被稱為“單站”體系,如果總線上有多個(gè)從機(jī),系統(tǒng)就被稱為“多站”體系。為了把暫存器中的 TH、 TL 和配置寄存器的數(shù)據(jù)傳輸?shù)紼EPROM 中,主機(jī)必須發(fā)出復(fù)制暫存器命令。這些字節(jié)是只讀的。ROM 碼的最低 8 位包含 DS18B20 的單總線產(chǎn)品系列碼: 28h。如果 DS18B20 采用寄生電源,這個(gè)響應(yīng)方法就不能使用,因?yàn)榭偩€在整個(gè)溫度轉(zhuǎn)換環(huán)節(jié)中必須保持高電平。C, 176。 DS18B20 的另一個(gè)特點(diǎn)是不需要再外部供電下即可工作。另外高速暫存器提供功能訪問一 個(gè)字節(jié)的溫度上限及下限告警觸發(fā)寄存器( TH 和 TL)和一個(gè)字節(jié)的配置寄存器。F 到 +257176。C 。s and then releasing the bus (see Figure 8). After the master initiates the read time slot, the DS18B20 will begin transmitting a 1 or 0 on bus. The DS18B20 transmits a 1 by leaving the bus high and 外文翻譯(原文) 14 transmits a 0 by pulling the bus low. When transmitting a 0, the DS18B20 will release the bus by the end of the time slot, and the bus will be pulled back to its high idle state by the pull up resister. Output data from the DS18B20 is valid for 15181。s in duration with a minimum of a 1181。s to 60181。C, respectively. The default resolution at powerup is 12bit. The DS18B20 powers up in a lowpower idle state. To initiate a temperature measurement and AtoD conversion, the master must issue a Convert T [44h] mand. Following the conversion, the resulting thermal data is stored in the 2byte temperature register in the scratchpad memory and the DS18B20 returns to its idle state. 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 外文翻譯(原文) 4 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 pull up during the entire temperature conversion. The DS18B20 output temperature data is calibrated in degrees Celsius。F) ? 177。C over the range of 10176。 176。F to +257176。C, and 176。s. The bus master then releases 外文翻譯(原文) 12 the bus and goes into receive mode (RX). When the bus is released, the 5k? pullup resistor pulls the 1Wire bus high. When the DS18B20 detects this rising edge, it waits 15181。 s m i n i m u mD S 1 8 B 2 0 I n i t i a l i z a t i o n T i m i n g V p uG N D1 W i r e B u sB u s m a s t e r p u l l i n g l o w D S 1 8 B 2 0 p u l l i n g l o w R e s i s t o r p u l l u p Figure Timing ( 2) READ/WRITE TIME SLOTS The bus master writes data to the DS18B20 during write time slots and reads data from the DS18B20 during read time slots. One bit of data is transmitted over the 1Wire bus per time slot. TIME SLOTS There are two types of write time slots: ―Write 1‖ time slots and ―Write 0‖ time slots. The bus master uses a Write 1 time slot to write a logic 1 to the DS18B20 and a Write 0 time slot to write a logic 0 to the DS18B20. All write time slots must be a minimum of 60181。s recovery time between slots. A read time slot is initiated by the master device pulling the 1Wire bus low for a minimum of 1181。 176。C ( 67176。高速暫存器包含 2 個(gè)字節(jié)的溫度寄存器,溫度寄存器存儲(chǔ)來自溫度傳感器的數(shù)字輸出。單總線協(xié)議,包括詳細(xì)的命令解釋和時(shí)間時(shí)隙說明,被掩膜在在單總線系統(tǒng)中。C, 176。如果 DS18B20 是有外部供電 ,主機(jī)能在轉(zhuǎn)換命令后發(fā)出“讀時(shí)隙”命令,當(dāng)溫度轉(zhuǎn)換在進(jìn)行時(shí) DS18B20 傳輸 0、當(dāng)轉(zhuǎn)換完成時(shí) DS18B20 傳輸 1 來響應(yīng)主機(jī)。 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 低字節(jié) 23 22 21 20 21 22 23 24 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 高字節(jié) S S S S S 26 25 24 圖 溫度 數(shù)字輸出(二進(jìn)制) 數(shù)字輸出(十六進(jìn)制) +125℃ 0000 0111 1101 0000 07D0H +℃ 0000 0001 1001 0001 0191H 0℃ 0000 0000 0000 0000 0000H ℃ 1111 1110 0110 1111 FE6FH 55℃ 1111 1100 1001 0000 FC90H 表 /數(shù)據(jù)關(guān)系 外文翻譯(譯文) 19 位激光 ROM 每一個(gè) DS18B20 包含一個(gè)存儲(chǔ)在 ROM 中的獨(dú)