已閱讀5頁(yè),還剩1頁(yè)未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
附錄 Research and Application of DS18B20 Communication to the DS18B20 is via a 1-Wire port. With the 1-Wire port, the memory and control functions will not be available before the ROM function protocol has been established. The master must first provide one of five ROM function commands: 1) Read ROM, 2) Match ROM, 3) Search ROM, 4) Skip ROM, or 5) Alarm Search. These commands operate on the 64-bit lasered ROM portion of each device and can single out a specific device if many are present on the 1-Wire line as well as indicate to the bus master how many and what types of devices are present. After a ROM function sequence has been successfully executed, the memory and control functions are accessible and the master may then provide any one of the six memory and control function commands. One control function command instructs the DS18B20 to perform a temperature measurement. The result of this measurement will be placed in the DS18B20s scratch-pad memory, and may be read by issuing a memory function command which reads the contents of the scratchpad memory. The temperature alarm triggers TH and TL consist of 1 byte EEPROM each. If the alarm search command is not applied to the DS18B20, these registers may be used as general purpose user memory. The scratchpad also contains a configuration byte to set the desired resolution of the temperature to digital conversion. Writing TH, TL, and the configuration byte is done using a memory function command. Read access to these registers is through the scratchpad. All data is read and written least significant bit first. In order for the DS18B20 to be able to perform accurate temperature conversions, sufficient power must be provided over the DQ line when a temperature conversion is taking place. Since the operating current of the DS18B20 is up to 1.5 mA, the DQ line will not have sufficient drive due to the 5k pullup resistor. This problem is particularly acute if several DS18B20s are on the same DQ and attempting to convert simultaneously. There are two ways to assure that the DS18B20 has sufficient supply current during its active conversion cycle. The first is to provide a strong pullup on the DQ line whenever temperature conversions or copies to the E2 memory are taking place. This may be accomplished by using a MOSFET to pull the DQ line directly to the power supply as shown in Figure 2. The DQ line must be switched over to the strong E2 memory or initiates temperature conversions. When using the parasite power mode, the VDD pin must be tied to ground. Another method of supplying current to the DS18B20 is through the use of an external power supply tied to the VDD pin. The advantage to this is that the strong pullup is not required on the DQ line, and the bus master need not be tied up holding that line high during temperature conversions.This allows other data traffic on the 1-Wire bus during the conversion time. In addition, any number of DS18B20s may be placed on the 1-Wire bus, and if they all use external power, they may all simultaneously perform temperature conversions by issuing the Skip ROM command and then issuing the Convert T command. Note that as long as the external power supply is active, the GND pin may not be floating. The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the DS18B20 is configurable (9, 10, 11, or 12 bits), with 12-bit command, a temperature conversion is performed and the thermal data is stored in the scratchpad memory in a 16-bit, sign-extended twos complement format. The temperature information can be retrieved over the 1-Wire interface by issuing a Read Scratchpad BEh command once the conversion has been performed. The data is transferred over the 1-Wire bus, LSB first. The MSB of the temperature register contains the “sign” (S) bit, denoting whether the temperature is positive or negative. Each DS18B20 contains a unique ROM code that is 64-bits long. The first 8 bits are a 1-Wire family code (DS18B20 code is 28h). The next 48 bits are a unique serial number. The last 8 bits are a CRC of the first 56 bits. The 64-bit ROM and ROM Function Control section allow the DS18B20 to operate as a 1-Wire device and follow the 1-Wire protocol detailed in the section “1-Wire Bus System.” The functions required to control sections of the DS18B20 are not accessible until the ROM function protocol has been satisfied. This protocol is described in the ROM function protocol flowchart. The 1-Wire bus master must first provide one of five ROM function commands: 1) Read ROM, 2) Match ROM, 3) Search ROM, 4) Skip ROM, or 5) Alarm Search. After a ROM function sequence has been successfully executed, the functions specific to the DS18B20 are accessible and the bus master may then provide one of the six memory and control function commands. The DS18B20 has an 8-bit CRC stored in the most significant byte of the 64-bit ROM. The bus master can compute a CRC value from the first 56-bits of the 64-bit ROM and compare it to the value stored within the DS18B20 to determine if the ROM data has been received error-free by the bus master. The equivalent polynomial function of this CRC is: CRC = X8 + X5 + X4 + 1 The DS18B20 also generates an 8-bit CRC value using the same polynomial function shown above and provides this value to the bus master to validate the transfer of data bytes. In each case where a CRC is used for data transfer validation, the bus master must calculate a CRC value using the polynomial function given above and compare the calculated value to either the 8-bit CRC value stored in the 64-bit ROM portion of the DS18B20 (for ROM reads) or the 8-bit CRC value computed within the DS18B20(which is read as a ninth byte when the scratchpad is read). The comparison of CRC values and decision to continue with an operation are determined entirely by the bus master. There is no circuitry inside the DS18B20 that prevents a command sequence from proceeding if the CRC stored in or calculated by the DS18B20 does not match the value generated by the bus master. The scratchpad is organized as eight bytes of memory. The first 2 bytes contain the LSB and the MSB of the measured temperature information, respectively. The third and fourth bytes are volatile copies of TH and TL and are refreshed with every power-on reset. The fifth byte is a volatile copy of the configuration register and is refreshed with every power-on reset. The configuration register will be explained in more detail later in this section of the datasheet. The sixth, seventh, and eighth bytes are used for internal computations, and thus will not read out any predictable pattern. It is imperative that one writes TH, TL, and config in succession; i.e. a write is not valid if one writes only to TH and TL, for example, and then issues a reset. If any of these bytes must be written, all three must be written before a reset is issued. There is a ninth byte which may be read with a Read Scratchpad BEh command. This byte contains a cyclic redundancy check (CRC) byte which is the CRC over all of the eight previous bytes. This CRC is implemented in the fashion described in the section titled “CRC Generation”. DS18B20 的研究與應(yīng)用 DS18B20的通信是通過(guò)一個(gè) 1 - Wire端口。與 1 - Wire端口,內(nèi)存和控制功能將無(wú)法使用以前的 ROM功能協(xié)議已經(jīng)成立。主機(jī)必須首先提供五種 ROM操作命令之一: 1)讀 ROM, 2) Match ROM命令, 3)搜索 ROM, 4)跳過(guò) ROM 或 5)報(bào)警搜索。這些命令運(yùn)行在 64 位光刻 ROM 部分。設(shè)備和能出一個(gè)特定的設(shè)備很多都是單一的,如果在 1 - Wire 總線以及說(shuō)明目前的主機(jī)有多少,哪些類型的設(shè)備都存在。經(jīng)過(guò) ROM 操作序列 已成功地執(zhí)行,內(nèi)存和控制功能的主機(jī)可以訪問(wèn)和再提供任何六個(gè)內(nèi)存和控制功能命令之一。 一個(gè)控制功能命令指示執(zhí)行 DS18B20的溫度測(cè)量。這一測(cè)量結(jié)果將被放置在傳感器 DS18B20的便簽內(nèi)存,并且可以通過(guò)發(fā)出命令,讀取記憶功能的暫存存儲(chǔ)器的內(nèi)容讀。溫度報(bào)警觸發(fā)器 TH 和 TL 的 1 個(gè)字節(jié)的 EEPROM 每個(gè)組成。如果報(bào)警搜索命令不適用于 DS18B20的,這些寄存器可以作為通用的用戶存儲(chǔ)器。暫存器還包含一個(gè)配置字節(jié)來(lái)設(shè)置所需的溫度分辨率的數(shù)字轉(zhuǎn)換。寫(xiě)作治療,熱釋光,配置字節(jié)是通過(guò)使用一個(gè)存儲(chǔ)器功能命令。讀訪問(wèn)這些寄存器是 通過(guò)暫存器。所有數(shù)據(jù)讀取和寫(xiě)入最低有效位在前。 為了傳感器 DS18B20 的能夠進(jìn)行精確的溫度轉(zhuǎn)換,必須提供充足的電力過(guò)的電話號(hào)碼查詢線時(shí)溫度轉(zhuǎn)換正在發(fā)生。由于經(jīng)營(yíng)的 DS18B20 的電流可達(dá) 1.5 mA的時(shí),電話查號(hào)線將不會(huì)有足夠的驅(qū)動(dòng)由于 5 公里的上拉電阻。這個(gè)問(wèn)題尤其嚴(yán)重,如果幾個(gè) DS18B20s 在同一電話號(hào)碼查詢和試圖轉(zhuǎn)換同時(shí)進(jìn)行。 有兩種方法,以確保 DS18B20的過(guò)程中有其積極轉(zhuǎn)換周期足夠的電源電流。第一是要提供一個(gè)強(qiáng)大的 DQ線拉每當(dāng)溫度轉(zhuǎn)換或拷貝到 E2的內(nèi)存都在發(fā)生。這可能是通過(guò)使用一個(gè) MOSFET 拉的 DQ 線直接供電,如圖 2 所示。的 DQ 線路必須在 10 切換到強(qiáng)的最大上拉后發(fā)出任何協(xié)議,涉及復(fù)制到 E2的內(nèi)存或啟動(dòng)溫度轉(zhuǎn)換。當(dāng)使用寄生供電模式,在 VDD引腳必須接地。 另一個(gè)供應(yīng)電流 DS18B20的方法是通過(guò)一個(gè)外部電源連接到 VDD端子的供應(yīng)使用。對(duì)這樣做的好處是,強(qiáng)拉未上線所需的 DQ,總線主機(jī)不必束縛抱著這條線在溫度 conversions.This 允許在高的 1 - Wire 總線的轉(zhuǎn)換時(shí)間,在其他數(shù)據(jù)流量。此外,任何 DS18B20s 人數(shù)可能被放置在 1 - Wire總線,如果它們都使用外接電源,它們都可能同時(shí) 執(zhí)行通過(guò)發(fā)出跳過(guò) ROM命令,然后轉(zhuǎn)換 T命令發(fā)出溫度轉(zhuǎn)換。請(qǐng)注意,只要外部電源處于活動(dòng)狀態(tài), GND引腳可能不浮動(dòng)。 該 DS18B20的核心功能是它直接對(duì)數(shù)字溫度傳感器。該 DS18B20的分辨率配置( 9, 10, 11或 12 位)與 12位讀數(shù),出廠默認(rèn)狀態(tài)。這相當(dāng)于 0.5 C的,0.25 C的, 0.125 C或 0.0625溫度分辨率 三繼轉(zhuǎn)換 T發(fā)行 44高 命令,執(zhí)行溫度轉(zhuǎn)換,熱數(shù)據(jù)存儲(chǔ)在 16位暫存器記憶體,符號(hào)擴(kuò)展的二進(jìn)制補(bǔ)碼格式。溫度信息可以檢索通過(guò) 1 - Wire 接口發(fā)出一個(gè)讀取暫存器 北京控股 命令一次轉(zhuǎn)換已 完成。數(shù)據(jù)傳輸通過(guò) 1 - Wire 總線, LSB 在前。對(duì)溫度寄存器的 MSB 中包含“符號(hào)“( s第)位,表示是否為正溫度 或負(fù)數(shù)。 每個(gè) DS18B20的 ROM代碼包含一個(gè)獨(dú)特的 64位長(zhǎng)。前 8位是 1 - Wire 家族碼( DS18B20 的代碼是 28H 頁(yè))。接下來(lái)的 48 位是一個(gè)獨(dú)特的序列號(hào)。最后 8位是前 56位的 CRC碼。
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 船邊卸貨合同范例
- 搜藏品回購(gòu)合同范例
- 拆遷木方回收合同范例
- 外包食品加工合同范例
- 2025私人借款合同范本大全
- 保值豬合同范例
- 合伙做飯店生意合同范例
- 美國(guó)代銷合同范例
- 模壓設(shè)備出租合同范例
- 玻璃耗材采購(gòu)合同范例
- 北師大版四年級(jí)上冊(cè)除法豎式計(jì)算題300道及答案
- 2024-2030年中國(guó)橡膠伸縮縫行業(yè)市場(chǎng)發(fā)展趨勢(shì)與前景展望戰(zhàn)略分析報(bào)告
- 2021-2022學(xué)年內(nèi)蒙古呼和浩特市高一上學(xué)期期末考試英語(yǔ)試題(解析版)
- 12SG121-1 施工圖結(jié)構(gòu)設(shè)計(jì)總說(shuō)明
- DL∕T 2447-2021 水電站防水淹廠房安全檢查技術(shù)規(guī)程
- AQ 1097-2014 井工煤礦安全設(shè)施設(shè)計(jì)編制導(dǎo)則(正式版)
- 2024裝修補(bǔ)貼協(xié)議書(shū)
- 四川省對(duì)外文化交流中心2024年公開(kāi)招聘工作人員歷年【重點(diǎn)基礎(chǔ)提升】模擬試題(共500題)附帶答案詳解
- 許昌市2022-2023學(xué)年七年級(jí)上學(xué)期期末語(yǔ)文試題
- 小學(xué)語(yǔ)文學(xué)習(xí)任務(wù)群的設(shè)計(jì)與實(shí)施研究
- 2024年中考物理微專題練習(xí)熱學(xué)計(jì)算1含答案
評(píng)論
0/150
提交評(píng)論