溫度傳感器DS18B20 外文翻譯
DS18B20 Programmable Resolution 1-WireDigital Thermometer1、DS18B20 FEATURES(1) Unique 1-Wire interface requires only one Port pin for communication, requires no external components(2) Each device has a unique 64-bit serial code stored in an onboard ROM(3) Can be powered form data line .Power supply range is 3.0Vto 5.5V(4) Measures temperatures form -55°C to +125°C , ±0.5°C accuracy from -10°C to +85 °C( 5) Thermometer resolution is user-selected from 9 to 12 bits( 6) Converts temperature to 12-bit digital word in 750ms (max)( 7 ) Alarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition)( 8) Available in 8-pin SOIC, and 3-bin TO -92 packages2、DS18B20 BLOCK DIAFRAMFigure 1 shows a block diagram of the DS18B20, The 64-bite ROM stores the device's serial code. The scratchpad memory cont-abiyntse ttehmepe2rature egister that stores the digital output from the temperature sensor. In addition, the scratchpad provides access to the 1-byte upper and lower alarm trigger register (TH and TL), and the 1-byte configuratuion register. The configuration register allows the user to set the resolution of the temperature-to-digital conversion to 9, 10, 11 or 12 bits. The TH,TL and configuration registers are nonvolatile(EEPROM), so they will retain data when the device is powered down.POV'R6-ElTE kOMSUPPYSENSE跡D1 -V;ire Port4 MEMORY' CONTROL LOGICSCRATCHPADALARM HIGHTkLGG£R(TH.' EEG 1ST EE?. (EEPROi:)ALAJM匸0百TRIGG ER(TL) RI-GISTEE. (EE PROM;S-BILE- CRC G£NER_TDB.L'£MP£kAlirE.ESENSORl OX FIG UR ATXREGISTER(EEPEtOM)Figure 1 block diagram of the DS18B203、DS18B20 ROM COMMANDS SEARCH ROM 0F0HWhen 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 as many times as necessary to iden tify all of the -bifeROM? d6vices.(2) READ ROM 55HThis command can only be used when there is one slave on the bus. It allows the bus master to read the slave'64-bit ROM code without using the Search ROM procedure. If this command 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.(3) MATCH ROM 55HThe match ROM command followed by a 64-bit ROM code sequence allows thebus master to address a specific DS18B20 on a multidrop or single-drop bus. Only theDS18B20 that exactly matches the 64-bitROM code sequence will respond to thefunction command issued by the master; all other slaves on the bus will wait for a reset pulse.(4) SKIP ROM 0CCHThe master can use this command to address all devices on the bus simultaneously without sending out any ROM code information. Note that the Read Scratchpad command can follow the Skip ROM command only if there is a single slave device on the bus. In this case time is saved by allowing the master to read from the slave without sending the device's 64-bit ROM code. A Skip ROM command followed by a Read Scratchpad command will cause a data collision on the bus if there is more than one slave since multiple devices will attempt to transmit data simultaneously.(5) ALARM SEARCH 0ECHThe operation of this command is identical to the operation of the Search ROM command except that only slaves with a set alarm flag will respond .This command allows the master device to determine if any DS18B20s experienced an alarm condition during the most recent temperature conversion .Refer to the OPERATION-ALARM SIGNAING section for an explanation of alarm flag operation.(6) CONVERTT 44HThis command initiates a single temperature conversion. Following the conversion, the resulting thermal data is stored in the 2-bute temperature register in the scratchpad memory and the DS18B20 returns to its low-power idle state. If the device is being used in parasite power mode, within 10us after this command is issued the master must enable a strong pullup on the 1-Wire bus for the duration of the conversion as described in the POWERING THE DS18320 section. If the DS18B20 is powered by an external supply, the master can issue read time slots after the Convert T command and the DS18B20 will respond by transmitting a 0 while the temperature conversion is in Progress and a 1 when the conversion is done. In parasite power mode this notification technique cannot be used since the bus1 is pulled high by the strong pullup during the conversion.(7) WRITE SCRACHPAD 4EHThis command allows the master to write 3 bytes of the data to the DS18B20's scratchpad. The first data byte is writer into the TH register , the second byte is written into the TL register, and the third byte is written into the configuration register. Data must be transmitted least significant bit first. All three bytes must be written before the master issues a reset ,or the data may be corrupted.(8) READ SCRACHPAD 0BEHThis command allows the master to read the contents of the scratchpad .The data transfer starts with the least significant bit of byte 0 and continues through the scratchpad until 9 byte(byte 8-CRC) is read.The master may issue a reset to terminate reading at any time if only partof the scratchpad data is needed.(9) COPY SCRATCHPAD 48HThis command copies the contents of the scratchpad TH,TL and configuration registers to EEPROM. If the device is being used in parasite power mode ,within 10us(max) after this command is issued the master must enable a strong pullup on the 1-Wire bus for at least 10ms as described in the POWERING THE DS18B20 section.(10) RECALL E2 B8HThis command recalls the alarm trigger values(TH and TL) and configuration data from EEPROM,respectively,in the scratchpad memory .The master device can issue read time slots following the Recall E2 command and the DS18B20 will indicate the status of the recall by transmitting 0 while the recall is in progress and 1 when the recall is done.The recall operation happens automatically at power-up, so valid data is available in the scratchpad as soon as power is applied to the device.DS18B20單總線數(shù)字溫度計(jì)1、DS18B20的特性(1) 獨(dú)特的單總線接口只占用一個(gè)I/O端口,而無(wú)需外圍元件;(2) 可以由總線提供電源,電壓適用范圍為3.0V5.5V;(3) 測(cè)量溫度范圍為-55°C+125°C,在-10°C+85°C范圍內(nèi)精度為土 0.5°C;(4) 每個(gè)DS18B20含有一個(gè)唯一的64位ROM編碼;(5) 用戶(hù)可以通過(guò)編程實(shí)現(xiàn)912位的溫度分辨率;(6) 分辨率為12時(shí)最大轉(zhuǎn)換時(shí)間為750ms;(7) 報(bào)警搜索命令可識(shí)別哪片DS18B20溫度超限;(8) 采用3腳T0-92或8腳SOIC封裝。2、DS18B20的內(nèi)部結(jié)構(gòu)DS18B20的內(nèi)部結(jié)構(gòu)如圖1所示。主要包括:寄生電源、溫度傳感器、64 位激光ROM和單總線接口、存放中間數(shù)據(jù)的高速暫存器RAM、用于存儲(chǔ)用戶(hù)設(shè)定 溫度上下限值的TM和TL觸發(fā)器、存儲(chǔ)和控制邏輯、8位循環(huán)冗余校驗(yàn)碼發(fā)生器 等。溫度轉(zhuǎn)換為數(shù)的改變時(shí)通過(guò)改變寄存器的值來(lái)實(shí)現(xiàn)的,用戶(hù)可以根據(jù)需要將 DS18B20的溫度轉(zhuǎn)化位數(shù)設(shè)置為9,10,11,12位。溫度報(bào)警觸發(fā)器的設(shè)置寄存器 都由非易失性電可擦寫(xiě)存儲(chǔ)器(EEROM)組成,設(shè)置值可以通過(guò)相應(yīng)命令寫(xiě)入,一 旦寫(xiě)入后不會(huì)因?yàn)榈綦姸鴣G失。3、DS18B20的各個(gè)ROM命令(1)Search ROM 0F0H當(dāng)一個(gè)系統(tǒng)初次啟動(dòng)時(shí),總線控制器可能并不知道單線總線上有多少器件 或它們的64位ROM編碼。搜索ROM命令允許總線控制器用排除法識(shí)別總線上的 所有從機(jī)的64位編碼。(2)Read ROM 33H這個(gè)命令允許總線控制器讀到DS18B20的8位系列編碼、唯一的序列號(hào)和 8位CRC碼。只有在總線上存在單只DS18B20的時(shí)候才能使用這個(gè)命令。如果 總線上有不止一個(gè)從機(jī),當(dāng)所有從機(jī)試圖同時(shí)傳送信號(hào)時(shí)就會(huì)發(fā)生數(shù)據(jù)沖突。(3)Match ROM 55H這個(gè)是匹配ROM命令,后跟64位ROM序列,讓總線控制器在多點(diǎn)總線上定 位一只特定的DS18B20。只有和64位ROM序列完全匹配的DS18B20才能響應(yīng)隨 后的存儲(chǔ)器操作。所有和64位ROM序列不匹配的從機(jī)都將等待復(fù)位脈沖。這條 命令在總線上有單個(gè)或多個(gè)器件時(shí)都可以使用。(4)Skip ROM 0CCH這條命令允許總線控制器不用提供64位ROM編碼就使用存儲(chǔ)器操作命令, 在單點(diǎn)總線情況下,可以節(jié)約時(shí)間。如果總線上不止一個(gè)從機(jī),在 Skip ROM 命令之后跟著發(fā)一條讀命令,由于多個(gè)從機(jī)同時(shí)發(fā)送信號(hào)??偩€上就會(huì)發(fā)生數(shù) 據(jù)沖突。(5)Alarm Search 0ECH這條命令的流程和Search ROM相同。然而,只有在最近一次測(cè)溫后遇到符 合報(bào)警條件的情況,DS18B20才會(huì)響應(yīng)這條命令。報(bào)警條件定義為溫度高于TH 或溫度低于TL。只要DS18B20不掉電,報(bào)警狀態(tài)將一直保持,直到再一次測(cè)得 的溫度值達(dá)不到報(bào)警條件。6)Convert T 44H這條命令啟動(dòng)一次溫度轉(zhuǎn)換無(wú)需其它數(shù)據(jù)。溫度轉(zhuǎn)換命令被執(zhí)行,而后 DS18B20 保持等待狀態(tài)。如果總線控制器在這條命令之后跟著發(fā)出時(shí)間隙,而 DS18B20又忙于做時(shí)間轉(zhuǎn)換的話(huà),DS18B20將在總線上輸出0,若溫度轉(zhuǎn)換完成, 則輸出1。如果使用寄生電源,總線控制器必須在發(fā)出這條命令后立即啟動(dòng)強(qiáng)上拉,并保持 500ms 以上的時(shí)間。7) Write Scratchpad 4EH這條命令向DS18B20的暫存器TH和TL中寫(xiě)入數(shù)據(jù)??梢栽谌魏螘r(shí)候發(fā)出 復(fù)位命令來(lái)中止寫(xiě)入。8) Read Scratchpad 0BEH這個(gè)命令讀暫存器的內(nèi)容。讀取從第 1 個(gè)字節(jié)開(kāi)始,一直進(jìn)行下去,直到 9 (CRC)字節(jié)讀完。如果不想讀完所有字節(jié),控制器可以在任何時(shí)候發(fā)出復(fù)位 命令來(lái)中止讀取。9) Copy Scratchpad 48H這個(gè)命令把暫存器的內(nèi)容拷貝到DS18B20的EEPROM存儲(chǔ)器里,即把溫度報(bào) 警觸發(fā)字節(jié)存入非易失性存儲(chǔ)器里。如果總線控制器在這條命令之后跟著發(fā)出 讀時(shí)間隙,而DS18B20又忙于把存儲(chǔ)器拷貝到EEROM存儲(chǔ)器,DS18B20就會(huì)輸 出一個(gè)0,如果拷貝結(jié)束的話(huà),DS18B20則輸出1。如果使用寄生電源,總線控 制器必須在這條命令發(fā)出后立即啟動(dòng)強(qiáng)上拉并最少保持 10ms。(10)Recall E2 0B8H這條命令把報(bào)警觸發(fā)器里的值拷貝回暫存器。這種拷貝操作在 DS18B20 上 電時(shí)自動(dòng)執(zhí)行,這樣器件一上電暫存器里馬上就存在有效數(shù)據(jù)了。若在這條命 令之后發(fā)出數(shù)據(jù)隙,器件會(huì)輸出溫度轉(zhuǎn)換忙的標(biāo)識(shí):0 為忙 ,1 為完成。