DS18B20是美国DALLAS半导体公司继DS1820之后最新推出的(精)
数字温度传感器DS18B20介绍及应用

数字温度传感器DS18B20介绍及应用【摘要】本文首先对数字温度传感器DS18B20的内部结构、工作原理做简单的介绍,然后结合DS18B20的性能,对温度传感器DS18B20在电路设计方面的应用做了相应的分析,最后提到DS18B20在使用过程中的注意事项。
【关键词】温度传感器;DS18B20;应用传统的温度敏感元件是热敏电阻,热敏电阻的优点是成本低,但是热敏电阻需要其他电路进行信号处理,因此可靠性较差,准确度和精确度都大大降低。
DS18B20是美国DALLAS公司新推出的一种数字温度传感器,它具有微型化、低功耗、高性能、抗干扰能力强、易配微处理器等优点。
DS18B20数字温度传感器可将温度转化成串行数字信息进行9~12位温度读数。
使用DS18B20数字温度传感器后,使整个系统结构更趋向简单,同时,可靠性也大大增高。
一、DS18B20的介绍1.DS18B20的内部结构DS18B20由四个部分组成:①64位光刻ROM、②温度传感器、③非挥发的温度报警触发器TH和TL、④配置寄存器。
64位光刻ROM在温度传感器出厂之前就刻上了64位序列号,它可以看是该温度传感器的地址序列码,每个DS18B20的序列号就如我们的身份证号一样,代表着自己的身份。
正一味如此,在同一根总线上可以同时挂接多个温度传感器。
DS18B20中的温度传感器可完成对温度的测量。
非挥发的温度报警触发器TH和TL是通过将测得的温度值分别于TH和TL进行比较,相应的对主机发出的告警搜索命令作出响应。
配置寄存器通过R1、R0位设定温度分辨率。
分辨率及使用者设定的报警温度存储在非易失性电擦写EEPROM中,这样,掉电后数据仍然可以保存。
2.DS18B20的测温原理及温度读取DS18B20利用低温系数振荡器输出的时钟脉冲信号通过由高温系数振荡器产生的门开通周期的计数值来测量温度。
DS18B20在出厂时就设定了分辨率是12位,在读取温度时一共读取16位,其中,前5位数字表示的是符号。
DS18B20温度传感器使用方法以及代码

第7章DS18B20温度传感器温度传感器概述温度传感器是各种传感器中最常用的一种,早起使用的是模拟温度传感器,如热敏电阻,随着环境温度的变化,它的阻值也发生线性变化,用处理器采集电阻两端的电压,然后根据某个公式就可以计算出当前环境温度。
随着科技的进步,现代的温度传感器已经走向数字化,外形小,接口简单,广泛应用在生产实践的各个领域,为我们的生活提供便利。
随着现代仪器的发展,微型化、集成化、数字化、正成为传感器发展的一个重要方向。
美国DALLS半导体公司推出的数字化温度传感器DS18B20采用单总线协议,即单片机接口仅需占用一个I/O端口,无需任何外部元件,直接将环境温度转化为数字信号,以数码方式串行输出,从而大大简化了传感器与微处理器的接口。
DS18B20温度传感器介绍DS18B20是美国DALLAS半导体公司继DS1820之后最新推出的一种改进型智能温度传感器。
与传统的热敏电阻相比,他能够直接读出被测温度并且可根据实际要求通过简单的编程实现9~12位的数字值读数方式。
可以分别在 ms和750 ms内完成9位和12位的数字量,并且从DS18B20读出的信息或写入DS18B20的信息仅需要一根口线(单线接口)读写,温度变换功率来源于数据总线,总线本身也可以向所挂接的DS18B20供电,而无需额外电源。
因而使用DS18B20可使系统结构更趋简单,可靠性更高。
他在测温精度、转换时间、传输距离、分辨率等方面较DS1820有了很大的改进,给用户带来了更方便的使用和更令人满意的效果。
1.DS18B20温度传感器的特性①独特的单线接口方式:DS18B20与微处理器连接时仅需要一条口线即可实现微处理器与DS18B20的双向通讯。
②在使用中不需要任何外围元件。
③可用数据线供电,电压范围:+~ + V。
④测温范围:-55 ~+125 ℃。
固有测温分辨率为℃。
⑤通过编程可实现9~12位的数字读数方式。
⑥用户可自设定非易失性的报警上下限值。
6.新型数字温度传感器DS18B20介绍-.

新型数字温度传感器DS18B20介绍一、来源中国传感器网/page/info/553.shtml发布人:北京微点科技有限公司二、概述在传统的模拟信号远距离温度测量系统中,需要很好的解决引线误差补偿问题、多点测量切换误差问题和放大电路零点漂移误差问题等技术问题,才能够达到较高的测量精度。
另外一般监控现场的电磁环境都非常恶劣,各种干扰信号较强,模拟温度信号容易受到干扰而产生测量误差,影响测量精度。
因此,在温度测量系统中,采用抗干扰能力强的新型数字温度传感器是解决这些问题的最有效方案,新型数字温度传感器DS18B20具有体积更小、精度更高、适用电压更宽、采用一线总线、可组网等优点,在实际应用中取得了良好的测温效果。
三、新型数字温度传感器美国Dallas半导体公司的数字化温度传感器DS1820是世界上第一片支持 "一线总线"接口的温度传感器,在其内部使用了在板(ON-B0ARD)专利技术。
全部传感元件及转换电路集成在形如一只三极管的集成电路内。
一线总线独特而且经济的特点,使用户可轻松地组建传感器网络,为测量系统的构建引入全新概念。
现在,新一代的DS18B20体积更小、更经济、更灵活。
使你可以充分发挥“一线总线”的优点。
目前DS18B20批量采购价格仅10元左右。
DS18B20可以程序设定9~12位的分辨率,精度为±0.5°C。
可选更小的封装方式,更宽的电压适用范围。
分辨率设定,及用户设定的报警温度存储在EEPROM中,掉电后依然保存。
DS18B20的性能是新一代产品中最好的!性能价格比也非常出色!DS1822与DS18B20软件兼容,是DS18B20的简化版本。
省略了存储用户定义报警温度、分辨率参数的EEPROM,精度降低为±2°C,适用于对性能要求不高,成本控制严格的应用,是经济型产品。
继"一线总线"的早期产品后,DS1820开辟了温度传感器技术的新概念。
数字式温度传感器DS18B20及其应用

器件应用数字式温度传感器DS18B20及其应用空军工程大学导弹学院(陕西三原713800) 韩小斌 朱永文摘 要 文章介绍了新一代数字式温度传感器DS18B20,它集温度感知、数字量转化、高低温限设定和报警于一体。
文章详细地阐述了DS18B20的测量原理、特性以及在多路温度测量应用中的测量电器设计和软件设计。
关键词 DS18B20传感器 温度检测 单片机 DS18B20是美国Dallas 半导体公司的新一代数字式温度传感器,它具有独特的单总线接口方式,即允许在一条信号线上挂接数十甚至上百个数字式传感器,从而使测温装置与各传感器的接口变得十分简单,克服了模拟式传感器与微机接口时需要的A/D 转换器及其它复杂外围电路的缺点,由它组成的温度测控系统非常方便,而且成本低、体积小、可靠性高。
图1 DS18B20外部形状及管脚图1 基本特性DS18B20数字式温度传感器的外部形状、内部芯片如图1所示。
它使用一总线接口实现和外部微处理器的通信。
温度的测量范围为-55~+125b C,测量精度为0.5b C 。
传感器的供电寄生在通信的总线上,可以从一总线通信中的高电平中取得,这样可以不需要外部的供电电源。
作为替代也可直接用供电端(VDD)供电。
一般在检测的温度超过100b C 时,建议使用供电端供电,供电的范围为3~5.5V 。
当使用总线寄生供电时,供电端必须接地,同时总线口在空闲的时候必须保持高电平,以便对传感器充电。
每一个DS18B20温度传感器都有一个自己特有的芯片序列号,我们可以将多个这样的温度传感器挂接在一根总线上,实现多点温度的检测。
2 测温原理DS18B20的测温原理如图2所示。
低温系数振荡器输出的时钟脉冲信号通过由高温系数振荡器产生的门开通周期而被计数,通过该计数值来测量温度。
计数器被预置为与-55b C 对应的一个基数值,如果计数器在高温系数振荡器输出的门周期结束前计数到零,表示测量的温度高于-55b C,被预置在-55b C 的温度寄存器的值就增加一个增量,同时为了补偿温度振荡器的抛物线特性,计数器被斜率累加器所决定的值进行预置,时钟再次使计数器计数直至零,如果开门通时间仍未结束,那么重复此过程,直到高温度系数振荡器的门周期结束为止。
DS18B20温度传感器课程设计报告

传感器课程设计设计题目:DS18B20温度传感器班级:电子(2)班姓名:梁玉杰,韦小门,李军伟学号:201140620223指导教师:XXX调试地点:509目录一、概述 (2)二、内容 (3)1、课程设计题目 (3)2、课程设计目的 (3)3、设计任务和要求 (3)4、正文 (3)(一)、方案选择与论证 (3)三、系统的具体设计与实现 (5)(1)、系统的总体设计方案 (5)(2)、硬件电路设计 (5)a、单片机控制模块 (5)b、温度传感器模块 (6)四、软件设计 (12)1、主程序 (12)2、读出温度子程序 (12)3、温度转换命令子程序 (12)4、计算温度子程序 (13)五、完整程序如下: (13)六、设计体会 (18)七、参考文献 (19)一、概述随着时代的进步和发展,单片机技术已经普及到我们生活、工作、科研、各个领域,已经成为一种比较成熟的技术。
本文主要介绍了一个基于89S51单片机的测温系统,详细描述了利用液晶显示器件传感器DS18B20开发测温系统的过程,重点对传感器在单片机下的硬件连接,软件编程以及各模块系统流程进行了详尽分析,特别是数字温度传感DS18B20的数据采集过程。
对各部分的电路也一一进行了介绍,该系统可以方便的实现实现温度采集和显示,并可根据需要任意设定上下限报警温度,它使用起来相当方便,具有精度高、量程宽、灵敏度高、体积小、功耗低等优点,适合于我们日常生活和工、农业生产中的温度测量,也可以当作温度处理模块嵌入其它系统中,作为其他主系统的辅助扩展。
DS18B20与AT89C51结合实现最简温度检测系统,该系统结构简单,抗干扰能力强,适合于恶劣环境下进行现场温度测量,有广泛的应用前景。
关键词:单片机AT89C51、DS18B20温度传感器、液晶显示LCD1602。
二、内容1、课程设计题目基于DS18B20的温度传感器2、课程设计目的通过基于MCS-51系列单片机AT89C51和DS18B20温度传感器检测温度,熟悉芯片的使用,温度传感器的功能,数码显示管的使用,汇编语言的设计;并且把我们这一年所学的数字和模拟电子技术、检测技术、单片机应用等知识,通过理论联系实际,从题目分析、电路设计调试、程序编制调试到传感器的选定等这一完整的实验过程,培养了学生正确的设计思想,使学生充分发挥主观能动性,去独立解决实际问题,以达到提升学生的综合能力、动手能力、文献资料查阅能力的作用,为毕业设计和以后工作打下一个良好的基础。
51单片机温度测量与控制系统毕业论文

51单片机温度测量与控制系统摘要随着现代信息技术和工农业的快速发展,单片机技术已经普及到我们生活、工作、科研、各个领域,已经成为一种比较成熟的技术, 本文主要介绍了一个基于51单片机的测温系统,详细描述了利用数字温度传感器DS18B20开发测温系统的过程,重点对传感器在单片机下的硬件连接,软件编程以及各模块系统流程进行了详尽分析,对各部分的电路也进行了介绍,该系统可以方便的实现实时温度采集和显示,并可根据需要设定上下限报警温度,它使用起来相当方便,具有精度高、量程宽、灵敏度高、体积小、功耗低等优点,适合于我们日常生活和工、农业生产中的温度测量,也可以当作温度处理模块嵌入其它系统中,作为其他主系统的辅助扩展。
DS18B20与51单片机结合实现最简温度检测系统,该系统结构简单,抗干扰能力强,适合于恶劣环境下进行现场温度测量,有广泛的应用前景。
关键字:51单片机、温度、DS18B20、数码管、 C51AbstractWith the rapid development of modern information technology and industry and agriculture, microcontroller technology has spread to our life, work, scientific research, each domain, has become a relatively mature technology, this paper introduces a temperature measurement system based on 51 single chip, detailed description of the use of digital temperature sensor DS18B20 temperature measurement system development, key the connection to the sensor under the SCM hardware, software programming and system flow of each module are analyzed in detail, on the part of the circuit are introduced, the system can easily achieve the real-time temperature acquisition and display, and can according to need to set the alarm temperature, it is very convenient to use, has high accuracy, Liang Chengkuan, high sensitivity, small volume, low power consumption, suitable for our daily lives and industrial, agricultural production in the temperature measurement, which can also be used as a temperature processing module embedded in other systems, as other auxiliary system. DS18B20 and 51 microcontroller with temperature detection system to achieve the most simple, the system has the advantages of simple structure, strong anti-interference ability, suitable for on-site temperature measurements in harsh environment, has the widespread application prospect.Key words:The 51 single chip microcomputer、Temperature、DS18B20、Digital tube、C51目录第1章概论 (1)1.1设计背景 (1)1.2总体设计 (2)1.3 设计要求 (3)第2章设计理论基础 (4)2.1 51单片机 (4)2.2 温度传感器 DS18B20 (7)2.3 锁存器 74HC573 (10)2.4 LED 数码管 (11)第3章硬件电路设计 (13)3.1 单片机最小的系统 (13)3.2 温度采集电路 (14)3.3 温度控制电路 (16)3.4 键盘电路 (17)3.5 显示电路 (18)第4章软件程序设计 (19)4.1 程序初始化 (19)4.2 延时子函数 (19)4.3 按键设定子函数 (20)4.4 温度显示子函数 (21)4.5 温度采集子函数 (21)4.6 温度控制子函数 (23)4.7 主函数 (24)第5章总结全文 (25)5.1结束语 (25)5.2致谢词 (25)参考文献 (26)附录 (27)第1章概论1.1设计背景温度是表征物体冷热程度的物理量,温度是工农业生产、科学试验以及日常生活中需要普遍进行测量和控制的一个重要物理量,由此对温度进行检测的意义就越来越大。
DS18B20数字温度计设计实验报告(1)

单片机原理及应用课程设计报告书题目:DS18B20数字温度计姓名:李成学号:133010220指导老师: 周灵彬设计时间: 2015年1月目录1. 引言 (3)1.1。
设计意义31。
2.系统功能要求32。
方案设计 (4)3。
硬件设计 (4)4. 软件设计 (8)5。
系统调试106. 设计总结 (11)7. 附录 (12)8。
参考文献15DS18B20数字温度计设计1.引言1.1. 设计意义在日常生活及工农业生产中,经常要用到温度的检测及控制,传统的测温元件有热电偶和热电阻。
而热电偶和热电阻测出的一般都是电压,再转换成对应的温度,需要比较多的外部硬件支持。
其缺点如下:●硬件电路复杂;●软件调试复杂;●制作成本高。
本数字温度计设计采用美国DALLAS半导体公司继DS1820之后推出的一种改进型智能温度传感器DS18B20作为检测元件,测温范围为—55~125℃,最高分辨率可达0.0625℃.DS18B20可以直接读出被测温度值,而且采用三线制与单片机相连,减少了外部的硬件电路,具有低成本和易使用的热点。
1.2. 系统功能要求设计出的DS18B20数字温度计测温范围在0~125℃,误差在±1℃以内,采用LED数码管直接读显示。
2. 方案设计按照系统设计功能的要求,确定系统由3个模块组成:主控制器、测温电路和显示电路.数字温度计总体电路结构框图如4。
1图所示:图4.13. 硬件设计温度计电路设计原理图如下图所示,控制器使用单片机AT89C2051,温度传感器使用DS18B20,使用四位共阳LED 数码管以动态扫描法实现温度显示。
AT89C51 主 控制器 DS18B20 显示电路 扫描驱动主控制器单片机AT89C51具有低电压供电和小体积等特点,两个端口刚好满足电路系统的设计需要,很适合便携手持式产品的设计使用.系统可用两节电池供电。
AT89C51的引脚图如右图所示:VCC:供电电压。
GND:接地.P0口:P0口为一个8位漏级开路双向I/O口,每脚可吸收8TTL门电流。
DS18B20温度传感器资料

FEATURES Unique 1-Wire interface requires only one port pin for communicationMultidrop capability simplifies distributed temperature sensing applications Requires no external componentsCan be powered from data line. Power supply range is 3.0V to 5.5VZero standby power requiredMeasures temperatures from -55°C to +125°C. Fahrenheit equivalent is -67°F to +257°F±0.5°C accuracy from -10°C to +85°C Thermometer resolution is programmable from 9 to 12 bitsConverts 12-bit temperature to digital word in 750 ms (max.)User-definable, nonvolatile temperature alarm settingsAlarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition)Applications include thermostatic controls,industrial systems, consumer products,thermometers, or any thermally sensitive systemPIN ASSIGNMENTPIN DESCRIPTIONGND - Ground DQ - Data In/OutV DD - Power Supply Voltage NC- No ConnectDESCRIPTIONThe DS18B20 Digital Thermometer provides 9 to 12-bit (configurable) temperature readings which indicate the temperature of the device.Information is sent to/from the DS18B20 over a 1-Wire interface, so that only one wire (and ground)needs to be connected from a central microprocessor to a DS18B20. Power for reading, writing, and performing temperature conversions can be derived from the data line itself with no need for an external power source.Because each DS18B20 contains a unique silicon serial number, multiple DS18B20s can exist on the same 1-Wire bus. This allows for placing temperature sensors in many different places. Applications where this feature is useful include HVAC environmental controls, sensing temperatures inside buildings,equipment or machinery, and process monitoring and control.DS18B20Programmable Resolution 1-Wire ®Digital ThermometerG N D D Q V DDDS18B20 To-92PackageNC NC NC GNDNC NCV DD DQDS18B20Z8-Pin SOIC (150 mil)DETAILED PIN DESCRIPTION Table 1PIN8PIN SOICPINTO92SYMBOL DESCRIPTION51GND Ground.42DQ Data Input/Output pin. For 1-Wire operation: Opendrain. (See “Parasite Power” section.)33V DD Optional V DD pin. See “Parasite Power” section fordetails of connection. V DD must be grounded foroperation in parasite power mode.DS18B20Z (8-pin SOIC): All pins not specified in this table are not to be connected.OVERVIEWThe block diagram of Figure 1 shows the major components of the DS18B20. The DS18B20 has four main data components: 1) 64-bit lasered ROM, 2) temperature sensor, 3) nonvolatile temperature alarm triggers TH and TL, and 4) a configuration register. The device derives its power from the 1-Wire communication line by storing energy on an internal capacitor during periods of time when the signal line is high and continues to operate off this power source during the low times of the 1-Wire line until it returns high to replenish the parasite (capacitor) supply. As an alternative, the DS18B20 may also be powered from an external 3 volt - 5.5 volt supply.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 DS18B20’s 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.DS18B20 BLOCK DIAGRAM Figure 1PARASITE POWERThe block diagram (Figure 1) shows the parasite-powered circuitry. This circuitry “steals” power whenever the DQ or V DD pins are high. DQ will provide sufficient power as long as the specified timing and voltage requirements are met (see the section titled “1-Wire Bus System”). The advantages of parasite power are twofold: 1) by parasiting off this pin, no local power source is needed for remote sensing of temperature, and 2) the ROM may be read in absence of normal power.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 E 2 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 pull-up within 10 µs maximum after issuing any protocol that involves copying to the E 2 memory or initiates temperature conversions. When using the parasite power mode, the V DD 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 V DD pin, as shown in Figure 3. 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 use of parasite power is not recommended above 100°C, since it may not be able to sustain communications given the higher leakage currents the DS18B20 exhibits at these temperatures. For applications in which such temperatures are likely, it is strongly recommended that V DD be applied to the DS18B20.DQVFor situations where the bus master does not know whether the DS18B20s on the bus are parasite powered or supplied with external V DD, a provision is made in the DS18B20 to signal the power supply scheme used. The bus master can determine if any DS18B20s are on the bus which require the strong pullup by sending a Skip ROM protocol, then issuing the read power supply command. After this command is issued, the master then issues read time slots. The DS18B20 will send back “0” on the 1-Wire bus if it is parasite powered; it will send back a “1” if it is powered from the V DD pin. If the master receives a “0,” it knows that it must supply the strong pullup on the DQ line during temperature conversions. See “Memory Command Functions” section for more detail on this command protocol. STRONG PULLUP FOR SUPPLYING DS18B20 DURING TEMPERATURE CONVERSION Figure 2USING V DD TO SUPPLY TEMPERATURE CONVERSION CURRENT Figure 3TO OTHER 1-WIRE DEVICESOPERATION - MEASURING TEMPERATUREThe 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 readings the factory default state. This equates to a temperature resolution of 0.5°C, 0.25°C, 0.125°C, or 0.0625°C. Following the issuance of the Convert T [44h] command, a temperature conversion is performed and the thermal data is stored in the scratchpad memory in a 16-bit, sign-extended two’s 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.Table 2 describes the exact relationship of output data to measured temperature. The table assumes 12-bit resolution. If the DS18B20 is configured for a lower resolution, insignificant bits will contain zeros. For Fahrenheit usage, a lookup table or conversion routine must be used.Temperature/Data Relationships Table 2232221202-12-22-32-4LSBMSb(unit = °C)LSbS S S S S262524MSBTEMPERATURE DIGITAL OUTPUT(Binary)DIGITAL OUTPUT (Hex)+125°C0000 0111 1101 000007D0h+85°C0000 0101 0101 00000550h*+25.0625°C0000 0001 1001 00010191h+10.125°C0000 0000 1010 001000A2h+0.5°C0000 0000 0000 10000008h0°C0000 0000 0000 00000000h-0.5°C1111 1111 1111 1000FFF8h-10.125°C1111 1111 0101 1110FF5Eh-25.0625°C1111 1110 0110 1111FF6Fh-55°C1111 1100 1001 0000FC90h*The power on reset register value is +85°C.OPERATION - ALARM SIGNALINGAfter the DS18B20 has performed a temperature conversion, the temperature value is compared to the trigger values stored in TH and TL. Since these registers are 8-bit only, bits 9-12 are ignored for comparison. The most significant bit of TH or TL directly corresponds to the sign bit of the 16-bit temperature register. If the result of a temperature measurement is higher than TH or lower than TL, an alarm flag inside the device is set. This flag is updated with every temperature measurement. As long as the alarm flag is set, the DS18B20 will respond to the alarm search command. This allows many DS18B20s to be connected in parallel doing simultaneous temperature measurements. If somewhere the temperature exceeds the limits, the alarming device(s) can be identified and read immediately without having to read non-alarming devices.64-BIT LASERED ROMEach 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. (See Figure 4.) 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 (Figure 5). 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.CRC GENERATIONThe 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 + 1The 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 1-Wire CRC can be generated using a polynomial generator consisting of a shift register and XOR gates as shown in Figure 6. Additional information about the Dallas 1-Wire Cyclic Redundancy Check is available in Application Note 27 entitled “Understanding and Using Cyclic Redundancy Checks with Dallas Semiconductor Touch Memory Products.”The shift register bits are initialized to 0. Then starting with the least significant bit of the family code, 1 bit at a time is shifted in. After the 8th bit of the family code has been entered, then the serial number is entered. After the 48th bit of the serial number has been entered, the shift register contains the CRC value. Shifting in the 8 bits of CRC should return the shift register to all 0s.64-BIT LASERED ROM Figure 48-BIT CRC CODE48-BIT SERIAL NUMBER 8-BIT FAMILY CODE(28h)MSB LSB MSB LSB MSB LSBROM FUNCTIONS FLOW CHART Figure 51-WIRE CRC CODE Figure 6MEMORYThe DS18B20’s memory is organized as shown in Figure 8. The memory consists of a scratchpad RAM and a nonvolatile, electrically erasable (E 2) RAM, which stores the high and low temperature triggers TH and TL, and the configuration register. The scratchpad helps insure data integrity when communicating over the 1-Wire bus. Data is first written to the scratchpad using the Write Scratchpad [4Eh] command.It can then be verified by using the Read Scratchpad [BEh] command. After the data has been verified, a Copy Scratchpad [48h] command will transfer the data to the nonvolatile (E 2) RAM. This process insures data integrity when modifying memory. The DS18B20 EEPROM is rated for a minimum of 50,000writes and 10 years data retention at T = +55°C.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”.Configuration RegisterThe fifth byte of the scratchpad memory is the configuration register.It contains information which will be used by the device to determine the resolution of the temperature to digital conversion. The bits are organized as shown in Figure 7.DS18B20 CONFIGURATION REGISTER Figure 70R1R011111MSbLSbBits 0-4 are don’t cares on a write but will always read out “1”.Bit 7 is a don’t care on a write but will always read out “0”.R0, R1: Thermometer resolution bits. Table 3 below defines the resolution of the digital thermometer,based on the settings of these 2 bits. There is a direct tradeoff between resolution and conversion time, as depicted in the AC Electrical Characteristics. The factory default of these EEPROM bits is R0=1 and R1=1 (12-bit conversions).Thermometer Resolution Configuration Table 3R1R0Thermometer Resolution Max ConversionTime009 bit 93.75 ms (t conv/8)0110 bit 187.5 ms (t conv /4)1011 bit 375 ms (t conv /2)1112 bit750 ms (t conv )DS18B20 MEMORY MAP Figure 8SCRATCHPADBYTE012345678E 2RAM1-WIRE BUS SYSTEMThe 1-Wire bus is a system which has a single bus master and one or more slaves. The DS18B20 behaves as a slave. The discussion of this bus system is broken down into three topics: hardware configuration, transaction sequence, and 1-Wire signaling (signal types and timing).HARDWARE CONFIGURATIONThe 1-Wire bus has only a single line by definition; it is important that each device on the bus be able to drive it at the appropriate time. To facilitate this, each device attached to the 1-Wire bus must have open drain or 3-state outputs. The 1-Wire port of the DS18B20 (DQ pin) is open drain with an internal circuit equivalent to that shown in Figure 9. A multidrop bus consists of a 1-Wire bus with multiple slaves attached. The 1-Wire bus requires a pullup resistor of approximately 5 kΩ.HARDWARE CONFIGURATION Figure 9The idle state for the 1-Wire bus is high. If for any reason a transaction needs to be suspended, the bus MUST be left in the idle state if the transaction is to resume. Infinite recovery time can occur between bits so long as the 1-Wire bus is in the inactive (high) state during the recovery period. If this does not occur and the bus is left low for more than 480 µs, all components on the bus will be reset. TRANSACTION SEQUENCEThe protocol for accessing the DS18B20 via the 1-Wire port is as follows:InitializationROM Function CommandMemory Function CommandTransaction/DataINITIALIZATIONAll transactions on the 1-Wire bus begin with an initialization sequence. The initialization sequence consists of a reset pulse transmitted by the bus master followed by presence pulse(s) transmitted by the slave(s).The presence pulse lets the bus master know that the DS18B20 is on the bus and is ready to operate. For more details, see the “1-Wire Signaling” section.ROM FUNCTION COMMANDSOnce the bus master has detected a presence, it can issue one of the five ROM function commands. All ROM function commands are 8 bits long. A list of these commands follows (refer to flowchart in Figure 5):Read ROM [33h]This command allows the bus master to read the DS18B20’s 8-bit family code, unique 48-bit serial number, and 8-bit CRC. This command can only be used if there is a single DS18B20 on the bus. If more than one slave is present on the bus, a data collision will occur when all slaves try to transmit at the same time (open drain will produce a wired AND result).Match ROM [55h]The match ROM command, followed by a 64-bit ROM sequence, allows the bus master to address a specific DS18B20 on a multidrop bus. Only the DS18B20 that exactly matches the 64-bit ROM sequence will respond to the following memory function command. All slaves that do not match the 64-bit ROM sequence will wait for a reset pulse. This command can be used with a single or multiple devices on the bus.Skip ROM [CCh]This command can save time in a single drop bus system by allowing the bus master to access the memory functions without providing the 64-bit ROM code. If more than one slave is present on the bus and a Read command is issued following the Skip ROM command, data collision will occur on the bus as multiple slaves transmit simultaneously (open drain pulldowns will produce a wired AND result). Search ROM [F0h]When a system is initially brought up, the bus master might not know the number of devices on the 1-Wire bus or their 64-bit ROM codes. The search ROM command allows the bus master to use a process of elimination to identify the 64-bit ROM codes of all slave devices on the bus.Alarm Search [ECh]The flowchart of this command is identical to the Search ROM command. However, the DS18B20 will respond to this command only if an alarm condition has been encountered at the last temperature measurement. An alarm condition is defined as a temperature higher than TH or lower than TL. The alarm condition remains set as long as the DS18B20 is powered up, or until another temperature measurement reveals a non-alarming value. For alarming, the trigger values stored in EEPROM are taken into account. If an alarm condition exists and the TH or TL settings are changed, another temperature conversion should be done to validate any alarm conditions.Example of a ROM SearchThe ROM search process is the repetition of a simple three-step routine: read a bit, read the complement of the bit, then write the desired value of that bit. The bus master performs this simple, three-step routine on each bit of the ROM. After one complete pass, the bus master knows the contents of the ROM in one device. The remaining number of devices and their ROM codes may be identified by additional passes.The following example of the ROM search process assumes four different devices are connected to the same 1-Wire bus. The ROM data of the four devices is as shown:ROM100110101...ROM210101010...ROM311110101...ROM400010001...The search process is as follows:1.The bus master begins the initialization sequence by issuing a reset pulse. The slave devices respondby issuing simultaneous presence pulses.2.The bus master will then issue the Search ROM command on the 1-Wire bus.3.The bus master reads a bit from the 1-Wire bus. Each device will respond by placing the value of thefirst bit of their respective ROM data onto the 1-Wire bus. ROM1 and ROM4 will place a 0 onto the 1-Wire bus, i.e., pull it low. ROM2 and ROM3 will place a 1 onto the 1-Wire bus by allowing the line to stay high. The result is the logical AND of all devices on the line, therefore the bus master sees a 0. The bus master reads another bit. Since the Search ROM data command is being executed, all of the devices on the 1-Wire bus respond to this second read by placing the complement of the first bit of their respective ROM data onto the 1-Wire bus. ROM1 and ROM4 will place a 1 onto the 1-Wire, allowing the line to stay high. ROM2 and ROM3 will place a 0 onto the 1-Wire, thus it will be pulled low. The bus master again observes a 0 for the complement of the first ROM data bit. The bus master has determined that there are some devices on the 1-Wire bus that have a 0 in the first position and others that have a 1.The data obtained from the two reads of the three-step routine have the following interpretations:00There are still devices attached which have conflicting bits in this position.01All devices still coupled have a 0-bit in this bit position.10All devices still coupled have a 1-bit in this bit position.11There are no devices attached to the 1-Wire bus.4.The bus master writes a 0. This deselects ROM2 and ROM3 for the remainder of this search pass,leaving only ROM1 and ROM4 connected to the 1-Wire bus.5.The bus master performs two more reads and receives a 0-bit followed by a 1-bit. This indicates thatall devices still coupled to the bus have 0s as their second ROM data bit.6.The bus master then writes a 0 to keep both ROM1 and ROM4 coupled.7.The bus master executes two reads and receives two 0-bits. This indicates that both 1-bits and 0-bitsexist as the 3rd bit of the ROM data of the attached devices.8.The bus master writes a 0-bit. This deselects ROM1, leaving ROM4 as the only device stillconnected.9.The bus master reads the remainder of the ROM bits for ROM4 and continues to access the part ifdesired. This completes the first pass and uniquely identifies one part on the 1-Wire bus.10.The bus master starts a new ROM search sequence by repeating steps 1 through 7.11.The bus master writes a 1-bit. This decouples ROM4, leaving only ROM1 still coupled.12.The bus master reads the remainder of the ROM bits for ROM1 and communicates to the underlyinglogic if desired. This completes the second ROM search pass, in which another of the ROMs was found.13.The bus master starts a new ROM search by repeating steps 1 through 3.14.The bus master writes a 1-bit. This deselects ROM1 and ROM4 for the remainder of this search pass,leaving only ROM2 and ROM3 coupled to the system.15.The bus master executes two Read time slots and receives two 0s.16.The bus master writes a 0-bit. This decouples ROM3 leaving only ROM2.17.The bus master reads the remainder of the ROM bits for ROM2 and communicates to the underlyinglogic if desired. This completes the third ROM search pass, in which another of the ROMs was found.18.The bus master starts a new ROM search by repeating steps 13 through 15.19.The bus master writes a 1-bit. This decouples ROM2, leaving only ROM3.20.The bus master reads the remainder of the ROM bits for ROM3 and communicates to the underlyinglogic if desired. This completes the fourth ROM search pass, in which another of the ROMs was found.NOTE:The bus master learns the unique ID number (ROM data pattern) of one 1-Wire device on each ROM Search operation. The time required to derive the part’s unique ROM code is:960 µs + (8 + 3 x 64) 61 µs = 13.16 msThe bus master is therefore capable of identifying 75 different 1-Wire devices per second.I/O SIGNALINGThe DS18B20 requires strict protocols to insure data integrity. The protocol consists of several types of signaling on one line: reset pulse, presence pulse, write 0, write 1, read 0, and read 1. All of these signals, with the exception of the presence pulse, are initiated by the bus master.The initialization sequence required to begin any communication with the DS18B20 is shown in Figure 11. A reset pulse followed by a presence pulse indicates the DS18B20 is ready to send or receive data given the correct ROM command and memory function command.The bus master transmits (TX) a reset pulse (a low signal for a minimum of 480 µs). The bus master then releases the line and goes into a receive mode (RX). The 1-Wire bus is pulled to a high state via the 5k pullup resistor. After detecting the rising edge on the DQ pin, the DS18B20 waits 15-60 µs and then transmits the presence pulse (a low signal for 60-240 µs).MEMORY COMMAND FUNCTIONSThe following command protocols are summarized in Table 4, and by the flowchart of Figure 10.Write Scratchpad [4Eh]This command writes to the scratchpad of the DS18B20, starting at the TH register. The next 3 bytes written will be saved in scratchpad memory at address locations 2 through 4. All 3 bytes must be written before a reset is issued.Read Scratchpad [BEh]This command reads the contents of the scratchpad. Reading will commence at byte 0 and will continue through the scratchpad until the ninth (byte 8, CRC) byte is read. If not all locations are to be read, the master may issue a reset to terminate reading at any time.Copy Scratchpad [48h]This command copies the scratchpad into the E2memory of the DS18B20, storing the temperature trigger bytes in nonvolatile memory. If the bus master issues read time slots following this command, the DS18B20 will output 0 on the bus as long as it is busy copying the scratchpad to E2; it will return a 1 when the copy process is complete. If parasite-powered, the bus master has to enable a strong pullup for at least 10 ms immediately after issuing this command. The DS18B20 EEPROM is rated for a minimum of 50,000 writes and 10 years data retention at T=+55°C.Convert T [44h]This command begins a temperature conversion. No further data is required. The temperature conversion will be performed and then the DS18B20 will remain idle. If the bus master issues read time slots following this command, the DS18B20 will output 0 on the bus as long as it is busy making a temperature conversion; it will return a 1 when the temperature conversion is complete. If parasite-powered, the bus master has to enable a strong pullup for a period greater than t conv immediately after issuing this command.Recall E2 [B8h]This command recalls the temperature trigger values and configuration register stored in E2 to the scratchpad. This recall operation happens automatically upon power-up to the DS18B20 as well, so valid data is available in the scratchpad as soon as the device has power applied. With every read data time slot issued after this command has been sent, the device will output its temperature converter busy flag: 0=busy, 1=ready.Read Power Supply [B4h]With every read data time slot issued after this command has been sent to the DS18B20, the device will signal its power mode: 0=parasite power, 1=external power supply provided.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
DS18B20是美国DALLAS半导体公司继DS1820之后最新推出的一种改进型智能温度传感器。
与传统的热敏电阻相比,他能够直接读出被测温度并且可根据实际要求通过简单的编程实现9~12位的数字值读数方式。
可以分别在93.75 ms和750 ms内完成9位和12位的数字量,并且从DS18B20读出的信息或写入DS18B2 0的信息仅需要一根口线(单线接口)读写,温度变换功率来源于数据总线,总线本身也可以向所挂接的DS1 8B20供电,而无需额外电源。
因而使用DS18B20可使系统结构更趋简单,可靠性更高。
他在测温精度、转换时间、传输距离、分辨率等方面较DS1820有了很大的改进,给用户带来了更方便的使用和更令人满意的效果。
1 DS18B20简介
(1)独特的单线接口方式:DS18B20与微处理器连接时仅需要一条口线即可实现微处理器与DS18B20的双向通讯。
(2)在使用中不需要任何外围元件。
(3)可用数据线供电,电压范围:3.0" 5.5 V。
(4)测温范围:-55 " 125 ℃。
固有测温分辨率为0.5 ℃。
(5)通过编程可实现9"12位的数字读数方式。
(6)用户可自设定非易失性的报警上下限值。
(7)支持多点组网功能,多个DS18B20可以并联在惟一的三线上,实现多点测温。
(8)负压特性,电源极性接反时,温度计不会因发热而烧毁,但不能正常工作。
2 DS18B20的内部结构
DS18B20采用3脚PR35封装或8脚SOIC封装,其内部结构框图如图1所示。
(1) 64 b闪速ROM的结构如下:
开始8位是产品类型的编号,接着是每个器件的惟一的序号,共有48位,最后8位是前56位的CRC校验码,这也是多个DS18B20可以采用一线进行通信的原因。
(2) 非易市失性温度报警触发器TH和TL,可通过软件写入用户报警上下限。
(3) 高速暂存存储器
DS18B20温度传感器的内部存储器包括一个高速暂存RAM和一个非易失性的可电擦除的E 2RAM。
后者用于存储TH,TL值。
数据先写入RAM,经校验后再传给E 2RAM。
而配置寄存器为高速暂存器中的第5个字节,他的内容用于确定温度值的数字转换分辨率,DS18B20工作时按此寄存器中的分辨率将温度转换为相应精度的数值。
该字节各位的定义如下:
低5位一直都是1,TM是测试模式位,用于设置DS18B20在工作模式还是在测试模式。
在DS18B20出厂
时该位被设置为0,用户不要去改动,R1和R0决定温度转换的精度位数,即是来设置分辨率,如表1所示(DS18B20出厂时被设置为12位)。
由表1可见,设定的分辨率越高,所需要的温度数据转换时间就越长。
因此,在实际应用中要在分辨率和转换时间权衡考虑。
高速暂存存储器除了配置寄存器外,还有其他8个字节组成,其分配如下所示。
其中温度信息(第1,2字节)、TH和TL值第3,4字节、第6~8字节未用,表现为全逻辑1;第9字节读出的是前面所有8个字节的CRC码,可用来保证通信正确。
当DS18B20接收到温度转换命令后,开始启动转换。
转换完成后的温度值就以16位带符号扩展的二进制补码形式存储在高速暂存存储器的第1,2字节。
单片机可通过单线接口读到该数据,读取时低位在前,高位在后,数据格式以0 062 5 ℃/LSB形式表示。
温度值格式如下:
对应的温度计算:当符号位S=0时,直接将二进制位转换为十进制;当S=1时,先将补码变换为原码,再计算十进制值。
表2是对应的一部分温度值。
DS18B20完成温度转换后,就把测得的温度值与TH,TL作比较,若T>TH或T<T L,则将该器件内的告警标志置位,并对主机发出的告警搜索命令作出响应。
因此,可用多只DS18B20同时测量温度并进行告警搜索。
<TL,则将该器件内的告警标志置位,并对主机发出的告警搜索命令作出响应。
因此,可用多只DS18B20同时测量温度并进行告警搜索。
(4) CRC的产生在64 b ROM的最高有效字节中存储有循环冗余校验码(CRC)。
主机根据ROM的前56位来计算CRC值,并和存入DS18B20中的CRC值做比较,以判断主机收到的ROM数据是否正确。
3 DS18B20的测温原理
DS18B20的测温原理如图2所示,图中低温度系数晶振的振荡频率受温度的影响很小[1],用于产生固定频率的脉冲信号送给减法计数器1,高温度系数晶振随温度变化其震荡频率明显改变,所产生的信号作为减法计数器2的脉冲输入,图中还隐含着计数门,当计数门打开时,DS18B20就对低温度系数振荡器产生的时钟脉冲后进行计数,进而完成温度测量。
计数门的开启时间由高温度系数振荡器来决定,每次测量前,首先将-55 ℃所对应的基数分别置入减法计数器1和温度寄存器中,减法计数器1和温度寄存器被预置在 -55 ℃ 所对应的一个基数值。
减法计数器1对低温度系数晶振产生的脉冲信号进行减法计数,当减法计数器1的预置值减到0时温度寄存器的值将加1,减法计数器1的预置将重新被装入,减法计数器1重新开始对低温度系数晶振产生的脉冲信号进行计数,如此循环直到减法计数器2计数到0时,停止温度寄存器值的累加,此时温度寄存器中的数值即为所测温度。
图2中的斜率累加器用于补偿和修正测温过程中的非线性,其输出用于修正减法计数器的预置值,只要计数门仍未关闭就重复上述过程,直至温度寄存器值达到被测温度值,这就是DS18B20的测温原理。
另外,由于DS18B20单线通信功能是分时完成的,他有严格的时隙概念,因此读写时序很重要。
系统对D S18B20的各种操作必须按协议进行。
操作协议为:初始化DS18B20(发复位脉冲)→发ROM功能命令→发存储器操作命令→处理数据。
各种操作的时序图与DS1820相同,可参看文献[2]。
4 DS18B20与单片机的典型接口设计
以MCS51单片机为例,图3中采用寄生电源供电方式,P1 1口接单线总线为保证在有效的DS18B20时钟周期内提供足够的电流,可用一个MOSFET管和89C51的P1 0来完成对总线的上拉[2]。
当DS18B2 0处于写存储器操作和温度A/D变换操作时,总线上必须有强的上拉,上拉开启时间最大为10 μs。
采用寄生电源供电方式是VDD和GND端均接地。
由于单线制只有一根线,因此发送接收口必须是三态的。
主机控制DS18B20完成温度转换必须经过3个步骤:初始化、ROM操作指令、存储器操作指令。
假设单片机系统所用的晶振频率为12 MHz,根据DS18B20的初始化时序、写时序和读时序,分别编写3个子程序:INI T为初始化子程序,WRITE为写(命令或数据)子程序,READ为读数据子程序,所有的数据读写均由最低位开始,实际在实验中不用这种方式,只要在数据线上加一个上拉电阻4.7 kΩ,另外2个脚分别接电源和地。
5 DS18B20的精确延时问题
虽然DS18B20有诸多优点,但使用起来并非易事,由于采用单总线数据传输方式,DS18B20的数据I/O均由同一条线完成。
因此,对读写的操作时序要求严格。
为保证DS18B20的严格I/O时序,需要做较精确的延时。
在DS18B20操作中,用到的延时有15 μs,90 μs,270 μs,540 μs等。
因这些延时均为15 μs的整数倍,因此可编写一个DELAY15(n)函数,源码如下:
只要用该函数进行大约15 μs×N的延时即可。
有了比较精确的延时保证,就可以对DS18B20进行读写操作、温度转换及显示等操作。
6 结语
我们已成功地将DS18B20应用于所开发的“LCD显示气温”的控制系统中,其测温系统简单,测温精度高,连接方便,占用口线少,转换速度快,与微处理器的接口简单,给硬件设计工作带来了极大的方便,能有效地降低成本,缩短开发周期。
参考文献
[1]胡振宇,刘鲁源,杜振辉 DS18B20接口的C语言程序设计[J]单片机与嵌入式系统应用,2002,(7) [2]金伟正 单线数字温度传感器的原理与应用 [J].电子技术应用,2000,(6):6668。