




已閱讀5頁,還剩1頁未讀, 繼續(xù)免費閱讀
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
附錄 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 的研究與應用 DS18B20的通信是通過一個 1 - Wire端口。與 1 - Wire端口,內存和控制功能將無法使用以前的 ROM功能協(xié)議已經(jīng)成立。主機必須首先提供五種 ROM操作命令之一: 1)讀 ROM, 2) Match ROM命令, 3)搜索 ROM, 4)跳過 ROM 或 5)報警搜索。這些命令運行在 64 位光刻 ROM 部分。設備和能出一個特定的設備很多都是單一的,如果在 1 - Wire 總線以及說明目前的主機有多少,哪些類型的設備都存在。經(jīng)過 ROM 操作序列 已成功地執(zhí)行,內存和控制功能的主機可以訪問和再提供任何六個內存和控制功能命令之一。 一個控制功能命令指示執(zhí)行 DS18B20的溫度測量。這一測量結果將被放置在傳感器 DS18B20的便簽內存,并且可以通過發(fā)出命令,讀取記憶功能的暫存存儲器的內容讀。溫度報警觸發(fā)器 TH 和 TL 的 1 個字節(jié)的 EEPROM 每個組成。如果報警搜索命令不適用于 DS18B20的,這些寄存器可以作為通用的用戶存儲器。暫存器還包含一個配置字節(jié)來設置所需的溫度分辨率的數(shù)字轉換。寫作治療,熱釋光,配置字節(jié)是通過使用一個存儲器功能命令。讀訪問這些寄存器是 通過暫存器。所有數(shù)據(jù)讀取和寫入最低有效位在前。 為了傳感器 DS18B20 的能夠進行精確的溫度轉換,必須提供充足的電力過的電話號碼查詢線時溫度轉換正在發(fā)生。由于經(jīng)營的 DS18B20 的電流可達 1.5 mA的時,電話查號線將不會有足夠的驅動由于 5 公里的上拉電阻。這個問題尤其嚴重,如果幾個 DS18B20s 在同一電話號碼查詢和試圖轉換同時進行。 有兩種方法,以確保 DS18B20的過程中有其積極轉換周期足夠的電源電流。第一是要提供一個強大的 DQ線拉每當溫度轉換或拷貝到 E2的內存都在發(fā)生。這可能是通過使用一個 MOSFET 拉的 DQ 線直接供電,如圖 2 所示。的 DQ 線路必須在 10 切換到強的最大上拉后發(fā)出任何協(xié)議,涉及復制到 E2的內存或啟動溫度轉換。當使用寄生供電模式,在 VDD引腳必須接地。 另一個供應電流 DS18B20的方法是通過一個外部電源連接到 VDD端子的供應使用。對這樣做的好處是,強拉未上線所需的 DQ,總線主機不必束縛抱著這條線在溫度 conversions.This 允許在高的 1 - Wire 總線的轉換時間,在其他數(shù)據(jù)流量。此外,任何 DS18B20s 人數(shù)可能被放置在 1 - Wire總線,如果它們都使用外接電源,它們都可能同時 執(zhí)行通過發(fā)出跳過 ROM命令,然后轉換 T命令發(fā)出溫度轉換。請注意,只要外部電源處于活動狀態(tài), GND引腳可能不浮動。 該 DS18B20的核心功能是它直接對數(shù)字溫度傳感器。該 DS18B20的分辨率配置( 9, 10, 11或 12 位)與 12位讀數(shù),出廠默認狀態(tài)。這相當于 0.5 C的,0.25 C的, 0.125 C或 0.0625溫度分辨率 三繼轉換 T發(fā)行 44高 命令,執(zhí)行溫度轉換,熱數(shù)據(jù)存儲在 16位暫存器記憶體,符號擴展的二進制補碼格式。溫度信息可以檢索通過 1 - Wire 接口發(fā)出一個讀取暫存器 北京控股 命令一次轉換已 完成。數(shù)據(jù)傳輸通過 1 - Wire 總線, LSB 在前。對溫度寄存器的 MSB 中包含“符號“( s第)位,表示是否為正溫度 或負數(shù)。 每個 DS18B20的 ROM代碼包含一個獨特的 64位長。前 8位是 1 - Wire 家族碼( DS18B20 的代碼是 28H 頁)。接下來的 48 位是一個獨特的序列號。最后 8位是前 56位的 CRC碼。
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2030年中國內銷型苦丁茶數(shù)據(jù)監(jiān)測研究報告
- 廣東省汕尾市陸豐市碣石鎮(zhèn)2024-2025學年三年級上學期期中測試語文試卷(含答案)
- 幼教面試試題試題及答案
- 英美概況考試試題及答案
- 2025年軍隊文職人員招聘之軍隊文職教育學題庫檢測試卷B卷附答案
- 采購與供應商分包合同(2篇)
- 詞牌名的文化內涵與寫作技巧:小學高年級語文古詩教學教案
- 化學反應與能量化學科學教案
- 學前教育中的寓言故事啟示讀后感
- 房地產(chǎn)行業(yè)智慧社區(qū)與智能家居開發(fā)方案
- 2025年黑龍江農業(yè)工程職業(yè)學院單招職業(yè)適應性測試題庫完整版
- 2025年湖南環(huán)境生物職業(yè)技術學院單招職業(yè)技能測試題庫匯編
- 2025年廣西南寧市公安局警務輔助崗位招聘2364人歷年高頻重點模擬試卷提升(共500題附帶答案詳解)
- 2024年中國農業(yè)大學招聘筆試真題
- 課件:以《哪吒2》為鏡借哪吒精神燃開學斗志
- 2025年貴安發(fā)展集團有限公司招聘筆試參考題庫含答案解析
- berg平衡評定量表
- 中央空調維保方案
- 我是家里的小主人
- 中國高血糖危象診斷與治療指南-
- 《醫(yī)療機構基本標準(試行)》2017版
評論
0/150
提交評論