【正文】
一無(wú)二的 64 位碼(見(jiàn)圖 3)。 暫存器的字節(jié) 0 和字節(jié) 1 分別包含溫度寄存器的最低有效位和最高有效位。當(dāng)讀取暫存器時(shí),數(shù)據(jù)通過(guò)單總線從字節(jié) 0 的最低有效位開(kāi)始傳輸。 DS18B20 一直是個(gè)從機(jī)。初始化序列包含一個(gè)由主機(jī)發(fā)出的復(fù)位脈沖,以及由從機(jī)傳送的應(yīng)答脈沖。 ROM 命令 F0H 當(dāng)系統(tǒng)上電初始化時(shí),主機(jī)必須檢測(cè)總線上的所有從機(jī)設(shè)備的 ROM 碼,是主機(jī)能夠確定設(shè)備的數(shù)目和類型。例如,主機(jī)發(fā)出跳躍命令后跟隨轉(zhuǎn)換溫度命令( 44H),則可以同時(shí)命令所有 DS18B20同時(shí)開(kāi)始轉(zhuǎn)換溫度。這些命令使主機(jī)從 DS18B20 暫存器中讀取或?qū)懭霐?shù)據(jù)、初始化溫度轉(zhuǎn)換 和確定供電類型。如果只需要部分命令,主機(jī)可以隨時(shí)發(fā)送復(fù)位以中止此操作。如果是外部供電,那么主機(jī)可以在此命令后進(jìn)入讀時(shí)隙,若轉(zhuǎn)換尚在進(jìn)行之中則給主機(jī)發(fā) 0,若轉(zhuǎn)換完成則發(fā) 1。 ECH 與搜索 ROM 命令類似,但只有溫度超出報(bào)警限的 DS18B20 才會(huì)響應(yīng)。此命令允許主機(jī)讀取從機(jī)的 64 位 ROM 碼而不必使用搜索命令進(jìn)程。如果沒(méi)有從機(jī)設(shè)備處于告警狀態(tài)時(shí),這些命令還能使主機(jī)檢測(cè)有總線上有多少數(shù)量和類型的設(shè)備。 訪問(wèn) DS18B20 的處理順序如下: 外文翻譯(譯文) 21 第一步,初始化 第二步, ROM 命令(隨后是必要數(shù)據(jù)交換命令) 第三步, DS18B20 功能命令(隨后是必要的 數(shù)據(jù)交換命令) DS18B20 每一次被訪問(wèn)時(shí)都必須遵循這個(gè)順序,因?yàn)槿绻谶@個(gè)順序中任何一步丟失或亂序的話 DS18B20 都不會(huì)響應(yīng)主機(jī)。這些位的上電默認(rèn)值是 R0=1 和 R1=1( 12 位分辨率)。暫存器的字節(jié) 8 是只讀的,包含暫存器從字節(jié) 0 到字節(jié) 7 的值。 64 位 ROM 碼和相關(guān)的 ROM 邏輯控制功能允許 DS18B20 使用單總線系統(tǒng)中詳細(xì)協(xié)議來(lái)作為單總線設(shè)備運(yùn)行。符號(hào)位 S 表明溫度是正還是負(fù):溫度正值時(shí) S= S=1。系統(tǒng)上電默認(rèn)值是 12 位及分辨率。這種供電方法被稱為“寄生電源”。 DS18B20 使用單總線獨(dú)有的協(xié)議準(zhǔn)則,使用某一控制信號(hào)進(jìn)行設(shè)備總線通信。C 范 圍內(nèi)測(cè)量精度為 177。因此很容易用一片微處理器控制分布在較大領(lǐng)域的多個(gè) DS18B20。 DS18B20 通過(guò)單總線通信,單總線被定義為只需要一根數(shù)據(jù)線與主微處理器相連進(jìn)行通信。s). The DS18B20 samples the 1Wire bus during a window that lasts from 15181。s. M a s t e r T x R e s e t P u l s e4 8 0 181。 the system is ―multidrop‖ if there are multiple slaves on the bus. All data and mands are transmitted least significant bit first over the 1Wire bus. The following discussion of the 1Wire bus system is broken down into three topics: hardware configuration, transaction sequence, and 1Wire signaling (signal types and timing). SEQUENCE The transaction sequence for accessing the DS18B20 is as follows: Step 1. Initialization Step 2. ROM Command (followed by any required data exchange) Step 3. DS18B20 Function Command (followed by any required data exchange) It is very important to follow this sequence every time the DS18B20 is accessed, as the DS18B20 will not respond if any steps in the sequence are missing or out of order. Exceptions to this rule are the Search ROM [F0h] and Alarm Search [ECh] mands. After issuing either of these ROM mands, the master must return to Step 1 in the sequence. ( 1) INITIALIZATION All transactions on the 1Wire bus begin with an initialization sequence. The initialization sequence consists of a reset pulse transmitted by the bus master followed 0 0 1 1 0 1 0 1 9 10 11 12 375ms 750ms 外文翻譯(原文) 8 by presence pulse(s) transmitted by the slave(s). The presence pulse lets the bus master know that slave devices (such as the DS18B20) are on the bus and are ready to operate. ( 2) ROM COMMANDS After the bus master has detected a presence pulse, it can issue a ROM mand. These mands operate on the unique 64bit ROM codes of each slave device 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。C to +85176。 Interface Requires Only One Port Pin for Communication ? Each Device has a Unique 64Bit Serial Code Stored in an OnBoard ROM ? Multidrop Capability Simplifies Distributed TemperatureSensing Applications ? Requires No External Components 外文翻譯(原文) 2 ? Can Be Powered from Data Line。外文翻譯(原文) 1 中英文資料外文翻譯文獻(xiàn) The introduction to The DS18B20 1. DESCRIPTION The DS18B20 digital thermometer provides 9bit to 12bit Celsius temperature measurements and has an alarm function with nonvolatile user programmable upper and lower trigger points. The DS18B20 municates over a 1Wire bus that by definition requires only one data line for munication with a central microprocessor. It has an operating temperature range of 55176。 Power Supply Range is to ? Measures Temperatures from 55176。C ? Thermometer Resolution is User Selectable from 9 to 12 Bits ? Converts Temperature to 12Bit Digital Word in 750ms (Max) ? UserDefinable Nonvolatile (NV) Alarm Settings ? Alarm Search Command Identifies and Addresses Devices Whose Temperature is Outside Programmed Limits ? Software Compatible with the DS1822 ? Applications Include Thermostatic Controls, Industrial Systems, Consumer Products, Thermometers, or Any Thermally Sensitive System Figure 1 shows a block diagram of the DS18B20, and pin descriptions are given in the Pin Description table. The 64bit ROM stores the device’s unique serial code. The scratchpad memory contains the 2byte temperature register that stores the di