




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、DS18B2嗷字溫度傳感器作者:日期:DS18B20 1 Wire Digital ThermometerFEATURES1,Unique 1Wire? Interface Requires Only One Port Pin for Communication2,Each Device has a Unique 64-Bit Serial Code Stored in an On-Board ROMMultidrop Capability Simplifies Distributed Temperature Sensing ApplicationsRequires No External C
2、omponents5,Can Be Powered from Data Line; Power Supply Range is 3.0V to 5.5V6, Measures Temperatures from -55C to +125 C (-67 F to +257 F)i0.5 C Accuracy from -10 C to +85 C7,Thermometer Resolution is User Selectable from 9 to 12 Bits 8,Converts Temperature to 12-Bit Digital Word in 750ms (Max) 9,Us
3、er-Definable Nonvolatile (NV) Alarm Settings10,Alarm Search Command Identifies and Addresses Devices Whose Temperature is Outside Programmed Limits (Temperature Alarm Condition)11,Available in 8 Pin SO (150 mils) , 8-Pin 仙 SOP。and 3-Pin TO92 Packages12,Software Compatible with the DS182213,Applicati
4、ons Include Thermostatic Controls,Industrial Systems, Consumer Products Thermometers, or Any Thermally Sensitive System PIN CONFIGURATIONSN.C.;DALLAS1SB加1 2 37 B 5 DALLAS1COB202 3 4GNDr&arroMViEw-TO-92(DS18E20)p VpQ 一 N.GCZl N.CO NCtiSOP (DSICBfOU)SO (150 mils) 1DS1SB20ZJoDESCRIPTIONThe DS18B20 digi
5、tal thermometer provides 9 bit to 12bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger point s The DS18B20 communicates over a 1 Wire bus that by definition requires only one data line (and ground) for communication with a centra
6、l microprocesso r It has an operating temperature range of -55C to +125 C and is accurate to 0。5 C over the range of -10 C to +85 C。In addition, the DS18B20 can derive power directly from the data line ( parasite peweinating the need for anexternal power supply。文檔為個人收集整理來源于網(wǎng)絡(luò)個人收集整理勿做商業(yè)用途Each DS18B20
7、 has a unique 6*bit serial code, which allows multiple DS18B20s to function on the same 1 Wire bus. Thus, it is simple to use one microprocessor to control many DS18B20s distributed over a large are a Applications that can benefit from this feature include HVAC environmentalcontrols, temperature mon
8、itoring systems inside buildings equipment, or machinery, and process monitoring and control system sPIN DESCRIPTIONPINNAMEFUNCTIONSON SOPTO 9 21, 2,6,7, 82, 3, 5,6, 7一No CoNo Connection383VDDOptional VDD. VDD must be grounded for operation in parasite power mode.412DQDataInput/OutputoOpen-drain1-Wi
9、reinterface pin。 Also provides power to the device when used in parasite power mode (see thePowering the DS18B20section.)541GNDGroundOVERVIEWFigure 1 shows a block diagram of the DS18B20 and pin descriptions are given in the Pin Description table. The 6- bit ROM stores the device s unique serial cod
10、e. The scratchpad memory contains the 2-byte temperature register that stores the digital output from the temperature sensor In addition, the scratchpad provides access to the 1-byte upper and lower alarm trigger registers (TH and TL) and the 1-byte configuration register The configuration register
11、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.The DS18B20 uses MaXm s exclusive-Wire bus protocol that implements bus
12、communication using one control signal. The control line requires a weak pullup resistor since all devices are linked to the bus via a 3state or open- drain port (the DQ pin in the case of the DS18B20。In this bus system! the microprocessor (the master device) identifies and addresses devices on the
13、bus using each device654-s unicode。 Because eachdevice has a unique code, the number of devices that can be addressed on one DS18B20 3 of 22 bus is virtually unlimited. The 1 Wire bus protocol, including detailed explanations of the commands and “time slots, is covered in the 1-Wire Bus System secti
14、on2人收集整理,勿做商業(yè)用途個人收集整理,勿做商業(yè)用途Another feature of the DS18B20 is the ability to operate without an external power supply. Power is instead supplied through the 1-Wire pullup resistor via the DQ pin when the bus is high The high bus signal also charges an internal capacitor (CPP), which then supplies po
15、wer to the device when the bus is low. This method of deriving power from the 1Wire bus is referred to as “parasite power As aialternative, the DS18B20 may also be powered by an external supply on VDD.DS18B20 Block DiagramOPERATION -MEASURING TEMPERATUREThe core functionality of the DS18B20 is its d
16、irect to-digital temperature sensor. The resolution of the temperature sensor is userconfigurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5 C,0025 C, 0.125 C, and 0.0625 C, respectively. The default resolution at poweLup is 12 bit。The DS18B20 powers up in a low-power idle state To
17、 initiate a temperature measurement and A-to- D conversion, the master must issue a Convert T 44h commando Following the conversion, the resulting thermal data is stored in the 2-byte temperature register in the scratchpad memory and the DS18B20 returns to its idle state. If the DS18B20 is powered b
18、y an external supply, the master can issue “ read time ssete the 1-Wire Bus System section) after the Convert T command and the DS18B20 will respond by transmitting 0 while the temperature conversion is in progress and 1 when the conversion is donelf the DS18B20 is powered with parasite power, this
19、notification technique cannot be used since the bus must be pulled high by a strong pullup during the entire temperature conversion. The bus requirements for parasite power are explainedin detail in the Powering the DS18B20 section個人收集整理,勿做商業(yè)用途個人收集整理,勿做商業(yè)用途The DS18B20 output temperature data is cali
20、brated in degrees Celsius; forFahrenheit applications, a lookup table or conversion routine must be use dThe temperature data is stored as a 16bit signextendedtwo s complement number in the temperature register (see Figure 2). The sign bits (S) indicate if the temperature is positive or negative for
21、 positive numbers S = 0 and for negative numbers S = 1 If the DS18B20 is configured for 12-bit resolution, all bits in the temperature register will contain valid data For 11-bit resolution, bit 0 is undefined。 For 10 bit resolution, bits 1 and 0 are undefined, and for 9bit resolution bits 2, 1, and
22、 0 are undefined Table 1 gives examples of digital output data and the corresponding temperature reading for 12-bit resolution conversions 本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途文檔為個人收集整理,來源于網(wǎng)絡(luò)Temperature Register Formats52r22-1T24efrisBIT 14BIT 136IT12BIT 11BIT 10BIT 9bitbSSSS史受管LS BYTEMS BYTEbit 7 ere bits BIT 4 bit? B
23、IT 2 BIT1 bitoOPERATION-ALARM SIGNALINGAfter the DS18B20 performs a temperature conversion the temperature value is compared to the userdefinedWo s complement alarm trigger values stored in the 1 byte TH and TL registers (see Figure 3 .The sign bit (S) indicates if the value is positive or negative
24、for positive numbers S = 0 and for negativenumbers S = 1. The TH and TL registers are nonvolatile (EEPROM) so they will retain data when the device is powered down TH and TL can be accessed through bytes 2 and 3 of the scratchpad as explained in the Memory section。文檔為個人收集整理,來源于網(wǎng)絡(luò)本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途Fig
25、ure 3。 TH and T L Register FormatBIT 7 BIT6 BITS BIT4 BIT 3BIT2BIT I BITOsa221Only bits 11 through 4 of the temperature register are used in the TH and TL comparison since TH and TL are 8 bit registers。If the measuredtemperature is lower than or equal to TL or higher than or equal to TH an alarm con
26、dition exists and an alarm flag is set inside the DS18B20. This flag is updated after every temperature measurement; therefore, if the alarm condition goes away the flag will be turned off after the next temperature conversion.The master device can check the alarm flag status of all DS18B20s on the
27、bus by issuing an Alarm Search ECh command. Any DS18B20s with a set alarm flag will respond to the command, so the master can determine exactly which DS18B20s have experienced an alarm condition. If an alarm condition exists and the TH or TL settings have changed, another temperature conversion shou
28、ld be done to validate the alarm condition.POWERING THE DS18B20The DS18B20 can be powered by an external supply on the VDD pin, or it can operate in “ parasite pmwee, which allows the DS18B20 to function without a local external supply. Parasite power is very useful for applications that require rem
29、ote temperature sensing or that are very space constrain ed Figure 1 shows the DS18B20 s parowee control circuitry, which“stealspower from the 1Wire bus via the DQ pin when the bus is high The stolen charge powers the DS18B20 while the bus is high, and some of the charge isstored on the parasite pow
30、er capadtor (CPP) to provide power when the bus is 個人收集整理,勿做商業(yè)用途文檔為個人收集整理,來源于網(wǎng)絡(luò)low。 When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground.In parasite power mode, the 1Wire bus and CPP can provide sufficient current to the DS18B20 for most operations as long as the
31、specified timing and voltage requirements are met (see the DC Electrical Characteristics and AC Electrical Characteristics) . However, when the DS18B20 is performing temperature conversions or copying data from the scratchpad memory to EEPROM , the operating current can be as high as 1.5mA. This cur
32、rent can cause an unacceptable voltage drop across the weak 1-Wire pullup resistor and is more current than can be supplied by CPP To assure that the DS18B20 has sufficient supply current, it is necessary to provide a strong pullup on the 1Wire bus whenever temperature conversions are taking place o
33、r data is being copied from the scratchpad to EEPROM. This can be accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure 4. The 1-Wire bus must be switched to the strong pullup within 10i s (max) after a Convert T 44h or Copy Scratchpad 48h command is issued and the b
34、us must be h ld high by the pullup for the duration of the conversion (tCONV) or data transfer (tWR = 10ms). No other activity can take place on the 1 Wire bus while the pullup is enabled本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途個人收集整理,勿做商業(yè)用途The DS18B20 can also be powered by the conventional method of connecting an externa
35、l power supply to the VDD pin, as shown in Figure 5 The advantage of this method is that the MOSFET pullup is not required andthe 1Wire bus is free to carry other traffic during the temperature conversion time。The use of parasite power is not recommended for temperatures above +100 C since the DS18B
36、20 may not be able to sustain communications due to the higher leakage currents that can exist at these temperatures For applications in which such temperatures are likely it is strongly recommended that the DS18B20 be powered by an external power supp lyIn some situations the bus master may not kno
37、w whether the DS18B20s on the bus are parasite powered or powered by external supplies. The master needs this information to determine if the strong bus pullup should be used during temperature conversions. To get this information, the master can issue a SkipROM CCh command followed by a Read Power
38、Supply B4h commandfollowed by a“ read time slclDuring the read time slot, parasite poweredDS18B20s will pull the bus low, and externally powered DS18B20s will let the bus remain high If the bus is pulled low, the master knows that it must supply the strong pullup on the 1 Wire bus during temperature
39、 conversions 本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途TOOTHER1-WIRE DEVICESFigure 4。 Supplying the Parasite PoweredDS18B20 DuringTemperature ConversionsFigure 5. Powering the DS18B20 with an External Supply64 BIT LASERED ROM CODEEach DS18B20 contains a unique 64bit code (see Figure 6 stored in ROM. The lea
40、st significant 8 bits of the ROM code contain the DS18B20 s1-Wire family code: 28h. The next 48 bits contain a unique serial number The most significant 8 bits contain a cyclic redundancy check (CRC byte that is calculated from the first 56 bits of the ROM code A detailed explanation of the CRC bits
41、 is provided in the CRC Generation section. The 64-bit ROM code and associated ROM function control logic allow the DS18B20 to operate as a 1Wire device using the protocol detailed in the 1 Wire Bus System section. 個人收集整理,勿做商業(yè)用途文檔為個人收集整理,來源于網(wǎng)絡(luò) Figure 6. 64-Bit Lasered ROM Code |0-BIT CRC; 4S-BIT SER
42、IAL NUMBER | 一丁 FAMILY CODE 一MSELSB MSBLSB MSBLSBMEMORYThe DS18B20 s memory is organized as shown in Figure 7The memory consists of an SRAM scratchpad with nonvolatile EEPROM storage for the high and low alarm trigger registers (TH and TL) and configuration register。 Note that if the DS18B20 alarm f
43、unction is not used, the TH and TL registers can serve as general-purpose memory. All memory commands are described in detail in the DS18B20 Function Commands section.Byte 0 and byte 1 of the scratchpad contain the LSB and the MSB of the temperature register respectively. These bytes are readonly。 B
44、ytes 2 and 3 provide access to TH and TL registers. Byte 4 contains the configuration register data, which is explained in detail in the Configuration Register section. Bytes 5, 6, and 7 are reserved for internal use by the device and cannot be overwritten.Byte 8 of the scratchpad is read-only and c
45、ontains the CRC code for bytes 0 hrough 7 of the scratchpad.The DS18B20 generates this CRC using the method described in the CRC Generation section.Data is written to bytes 2, 3, and 4 of the scratchpad using the Write Scratchpad 4Eh command; the data must be transmitted to the DS18B20 starting with
46、 the least significant bit of byte 2。 To verify data integrity, the scratchpad can be read (using the Read ScratchpOcBEh command) after the data is written. When reading the scratchpad data is transferred over the 1-Wire bus starting with the least significant bit of byte Oo To transfer the TH, TL a
47、nd configuration data from the scratchpad to EEPROM the master must issue the Copy Scratchpad 48h command本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途文檔為 個人收集整理,來源于網(wǎng)絡(luò)Data in the EEPROM registers is retained when the device is powered down; at power up the EEPROM data is reloaded into the corresponding scratchpad locations. Dat
48、a can also be reloaded from EEPROM to the scratchpad at any time using the Recall E2 B8h commando The master 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 don
49、e.Figure 7。 DS18B20 Memory MapByie 0Byte 1Teiii)enMikre LSB( 50h)但-產(chǎn)、一C)MSB iO?h JByie 2Th Register or User Byte 1*Byte 3I Registei ct Use】 Byig 2*Byte 1Conti iutation Re & 梵/Hyle 5Reserved (F Hi)Byie 6RestficdBie -Reserved (10 i)Byie KCRC*SCRATCHPAD (PGTR-IT STATE)* Anrw-wp jftTfF firpendi ertnrtd
50、in EEPROM.T Registei or User Byte IIl R 白oi lTsei Bxte 2Conirguiiiiion RegisteiCONFIGURATION REGISTERByte 4 of the scratchpad memory contains the configuration registe r which is organized as illustrated in Figure 8 The user can set the conversion resolution of the DS18B20 using the R0 and R1 bits i
51、n this register as shown in Table 2。 The power-up default of these bits is R0 = 1 and R1 = 1 (12-bit resolution). Note that there is a direct tradeoff between resolution and conversion time. Bit 7 and bits 0 to 4 in the configuration register are reserved for internal use by the device and cannot be
52、 overwritte冷人收集整理 , 勿做商業(yè)用途文檔 為個人收集整理,來源于網(wǎng)絡(luò)Figure 8. Configuration RegisterBIT 7 BIT 6 BIT 5 BIT 4 BITS BIT 2 BIT 1 BITO0R1RO11111Table 2. Thermometer Resolution ConfigurationRIRORESOLUTION (BITS)MAX CONVERSION TIME00993.75ms(tCONV8)0110187.5ms(l8NV4)1011(tCONV2)1112750ms(koNv)CRC GENERATIONCRC bytes
53、 are provided as part of the DS18B20 -bit ROMsc64e and in the 9th byte of the scratchpad memory. The ROM code CRC is calculated from the first 56 bits of the ROM code and is contained in the most significant byte of the ROM. The scratchpad CRC is calculated from the data stored in the scratchpad, an
54、d therefore it changes when the data in the scratchpad changes The CRCs provide the bus master with a method of data validation when data is read from the DS18B20. To verify that data has been read correctly, the bus master must re-calculate the CRC from the received data and then compare this value
55、 to either the ROM code CRC (for ROM reads) or to the scratchpad CRC (for scratchpad reads。If the calculated CRC matches the read CRC the data has been received error free The comparison of CRC values and the decision to continue with an operation are determined entirely by the bus master There is n
56、o circuitry inside the DS18B20 that prevents a command sequence from proceeding if the DS18B20 CRC (ROM or scratchpacl) does not match the value generated by the bus master,人收集整理,勿做商業(yè)用途文檔為個人收集整理,來源于網(wǎng)絡(luò)The equivalent polynomial function of the CRC (ROM or scratchpacD is: CRC = X8 + X5 + X4 + 1The bus
57、master can re-calculate the CRC and compare it to the CRC values from the DS18B20 using the polynomial generator shown in Figure 9. This circuit consists of a shift register and XOR gates and the shift register bits are initialized to 0. Starting with the least significant bit of the ROM code or the
58、 least significant bit of byte 0 in the scratchpad one bit at a time should shifted into the shift register。 After shifting in the 56th bit from the ROM or the most significant bit of byte 7 from the scratchpad, the polynomial generator will contain the re-calculated CRC. Nex t the 8-bit ROM code or
59、 scratchpad CRC from the DS18B20 must be shifted into the circuit At this point, if the re-calculated CRC was correc t the shift register will contain all 0s。 Additional information about the Maxim 1 Wire cyclic redundancy check is available in Application Note 27: Understanding and Using Cyclic Red
60、undancy Checks with Maxim iButton Products?人收集整理勿做商業(yè)用途個人收集整 理,勿做商業(yè)用途Figure 9. CRC Generator1WIRE BUS SYSTEMThe 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 asysteme
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 江蘇財經(jīng)職業(yè)技術(shù)學院《打印創(chuàng)新設(shè)計》2023-2024學年第二學期期末試卷
- 天津醫(yī)科大學臨床醫(yī)學院《電視節(jié)目播音主持實訓》2023-2024學年第二學期期末試卷
- 邵陽職業(yè)技術(shù)學院《結(jié)構(gòu)設(shè)計軟件應(yīng)用》2023-2024學年第二學期期末試卷
- 長春職業(yè)技術(shù)學院《三維動畫MAYA》2023-2024學年第二學期期末試卷
- 內(nèi)江師范學院《SAS與統(tǒng)計分析》2023-2024學年第二學期期末試卷
- 2025年重慶市建筑安全員考試題庫附答案
- 長春師范大學《公共管理與公共政策實務(wù)》2023-2024學年第二學期期末試卷
- 西安航空學院《老年認知癥的篩查與干預(yù)》2023-2024學年第二學期期末試卷
- 南京科技職業(yè)學院《會展設(shè)計實務(wù)》2023-2024學年第二學期期末試卷
- 襄陽職業(yè)技術(shù)學院《現(xiàn)代環(huán)境分析技術(shù)與應(yīng)用》2023-2024學年第二學期期末試卷
- 一通三防培訓課件PPT課件(PPT 53頁)
- 江蘇省邳州市2021-2022學年人教版四年級上冊期末數(shù)學試卷(含答案)
- 大數(shù)據(jù)分析及應(yīng)用實踐全書課件匯總整本書電子教案(最新)
- 教練技術(shù)一階段講義(共59頁)
- 第3章-系統(tǒng)模型與模型化
- 精品課程建設(shè)驗收自評報告
- 福建省義務(wù)教育課程設(shè)置及比例(修訂)
- 未成年人需辦銀行卡證明(模板)
- 建設(shè)項目職業(yè)病防護設(shè)施設(shè)計專篇編制導(dǎo)則
- 員工考勤流程圖
- 出口加工區(qū)外匯管理培訓(ppt49)
評論
0/150
提交評論