DS18B20数字温度计简介毕业论文外文翻译.doc
外文翻译DS18B20 brief introduction:FEATURESUnique 1-Wireinterface requires only one port pin for communication Each device has a unique 64-bit serial code stored in an onboard ROMMultidrop capability simplifies distributed temperature sensing applications Requires no external components Can be powered from data line. Power supply range is 3.0V to 5.5V Measures temperatures from 55°C to +125°C (67°F to +257°F) 0.5C accuracy from 10°C to +85°C Thermometer resolution is user-selectable from 9 to 12 bits Converts temperature to 12-bit digital word in 750ms (max.) User-definable nonvolatile (NV) alarm settings Alarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition) Available in 8-pin SO (150mil), 8-pin SOP, and 3-pin TO-92 packages Software compatible with the DS1822 Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermally sensitive特征:独特的单线接口,只需 1 个接口引脚即可通信每个设备都有一个唯一的64位串行代码存储在光盘片上多点能力使分布式温度检测应用得以简化不需要外部部件可以从数据线供电,电源电压范围为3.0V至5.5V测量范围从-55 ° C 至+125 ° C(-67 ° F至257 ° F),从-10至+85 ° C的精度为0.5 ° C温度计分辨率是用户可选择的9至12位转换12位数字的最长时间是750ms用户可定义的 非易失性的温度告警设置告警搜索命令识别和寻址温度在编定的极限之外的器件 (温度告警情况)采用8引脚SO(150mil),8引脚SOP和3引脚TO - 92封装软件与DS1822兼容应用范围包括恒温控制 工业系统 消费类产品 温度计或任何热敏系统DESCRIPTION The DS18B20 Digital Thermometer provides 9 to 12bit centigrade temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of 55°C to +125°Cand is accurate to 0.5C over the range of 10°C to +85°C. In addition, the DS18B20 can derive powerdirectly from the data line (“parasite power”), eliminating the need for an external power supply. Each DS18B20 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same 1wire bus; thus, it is simple to use one microprocessor to control many DS18B20s distributed over a large area. Applications that can benefit from this feature include HVAC environmental controls, temperature monitoring systems inside buildings, equipment or machinery, and process monitoring and control systems. 简介该DS18B20的数字温度计提供9至12位的摄氏温度测量,并具有与非易失性用户可编程上限和下限报警功能。信息单线接口送入 DS1820 或从 DS1820 送出,因此按照定义只需要一条数据线(和地线)与中央微处理器进行通信。它的测温范围从-55 ° C到 +125 ° C,其中从-10 ° C至+85 ° C可以精确到0.5° C 。此外,DS18B20可以从数据线直接供电(“寄生电源”),从而消除了供应需要一个外部电源。每个DS18B20的有一个唯一的64位序列码,它允许多个DS18B20s的功能在同一1 -巴士线,因此,用一个微处理器控制大面积分布的许多DS18B20s是非常简单的。此特性的应用范围包括 HVAC、环境控制、建筑物、设备或机械内的温度检测以及过程监视和控制系统。OVERVIEWFigure 1 shows a block diagram of the DS18B20, and pin descriptions are given in Table 1. The 64-bit ROM stores the devices unique serial code. 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 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 Dallas exclusive 1-Wire bus protocol that implements bus communication using one control signal. The control line requires a weak pullup resistor since all devices are linked to the bus via a 3-state 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 bus using each devices unique 64-bit code. Because each device has a unique code, the number of devices that can be addressed on one 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 section of this datasheet。 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 power to the device when the bus is low. This method of deriving power from the 1-Wire bus is referred to as “parasite power.” As an alternative, the DS18B20 may also be powered by an external supply on VDD. 综述图1显示了DS18B20的框图,引脚说明如表1。 64位ROM存储设备的独特序号。存贮器包含2个字节的温度寄存器,它存储来自温度传感器的数字输出。此外,暂存器可以访问的1个字节的上下限温度告警触发器(TH和TL)和1个字节的配置寄存器。配置寄存器允许用户设置的温度到数字转换的分辨率为9,10,11或12位。TH,TL和配置寄存器是非易失性的,因此掉电时依然可以保存数据。该DS18B20使用Dallas的单总线协议,总线之间的通信用一个控制信号就可以实现。控制线需要一个弱上拉电阻,因为所有的设备都是通过3线或开漏端口连接(在DS18B20中用DQ引脚)到总线的。在这种总线系统中,微处理器(主设备)和地址标识上使用其独有的64位代码。因为每个设备都有一个唯一的代码,一个总线上连接设备的数量几乎是无限的。 单总线协议,包括详细的解释命令和“时间槽”,此资料的单总线系统部分包括这些内容。DS18B20的另一个特点是:没有外部电源供电仍然可以工作。当DQ引脚为高电平时,电压是单总线上拉电阻通过DQ引脚供应的。高电平信号也可以充当外部电源,当总线是低电平时供应给设备电压。这种从但总线提供动力的方法被称为“寄生电源“。作为替代电源,该DS18B20也可以使用连接到 VDD 引脚的外部电源供电。OPERATION MEASURING TEMPERATURE The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5C, 0.25C, 0.125C, and 0.0625C, respectively. The default resolution at power-up is 12-bit. The DS18B20 powers-up in a low-power idle state; to initiate a temperature measurement and A-to-D conversion, the master must issue a Convert T 44h command. 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 by an external supply, the master can issue “read time slots” (see 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 done. If the DS18B20 is powered with parasite power, this 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 explained in detail in the POWERING THE DS18B20 section of this datasheet.The DS18B20 output temperature data is calibrated in degrees centigrade; for Fahrenheit applications, a lookup table or conversion routine must be used. The temperature data is stored as a 16-bit sign-extended twos complement number in the temperature register (see Figure 2). The sign bits (S) indicate if the temperature is positive or negative: for 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 9-bit resolution bits 2, 1 and 0 are undefined. Table 2 gives examples of digital output data and the corresponding temperature reading for 12-bit resolution conversions. 运用 测量温度该DS18B20的核心功能是它是直接输出数字信号的温度传感器。该温度传感器的分辨率为用户配置至9,10,11或12位,相当于0.5° C,0.25° C,0.125 ° C和0.0625° C的增量。其中传感器默认为12位。该DS18B20在低功耗空闲状态;启动温度测量和模数转换,主机必须发出一个转换命令。转换后,所产生的数据存储在内存中的2比特温度寄存器中,DS18B20返回其空闲状态。如果DS18B20是由外部电源供电的,主机可以发出“读时隙”(见单总线系统部分),转换后,通过发送低电平T命令和DS18B20将响应,同时温度转换继续进行,当转换完成时变为高电平。如果DS18B20的是寄生电源供电的,在整个温度转换过程中此通知技术不能使用,因为总线必须变为高电平。总线需要寄生电源供电将在此资料的DS18B20驱动部分将详细介绍。DS18B20的输出温度数据为标准摄氏度;对于华氏温度的应用,必须通过查表或运用转换方法。温度数据在温度寄存器存储为一个16位符号扩展位和2位的补码(见表2)。该标志位(S)表示温度的正负符号位:为正数时S = 0,为负数时S = 1。如果是DS18B20配置为12位分辨率,在温度寄存器的所有位将包含有效数据。对于11位分辨率,位0是未定义的。对于10位分辨率,位1和0是未定义的。对于9位分辨率,位2,1和0是未定义的。表2给出了输出数字数据和相应的12位分辨率温度读数转换例子。OPERATION ALARM SIGNALINGAfter the DS18B20 performs a temperature conversion, the temperature value is compared to the user-defined twos 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: for positive numbers S = 0 and for negative numbers 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 of this datasheet. 运用 - 报警信号DS18B20温度转换完成后,温度值与用户定义的2个报警触发值存储在1个字节的TH和TL寄存器(见图3)。符号位(S)表示温度值的正负: S = 0时为正值, S = 1为负值。TH和TL寄存器是非易失(EEPROM),因此他们将保留设备掉电时的数据。 TH和TL可通过暂存器中字节2和3获得,此内容在本数据表内存部分解释。TH AND TL REGISTER FORMAT Figure 3 Only 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 measured temperature is lower than or equal to TL or higher than TH, an alarm condition 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 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 should be done to validate the alarm condition.TH和TL寄存器格式只有温度寄存器4中的11位用于和TL的比较中,由于TH和TL都是 8位寄存器。如果测量温度低于或等于TL或超过TH,报警情况存在而且报警标志将设置在DS18B20的内部。每个温度测量后,这个标志位将被更新,因此,如果报警条件消失,下一个温度转换后,该标志位将被关闭。主设备可以通过搜索ECH命令检查总线上所有DS18B20s报警标志位的状态。任何有设置报警标志位的DS18B20s将响应命令,所以主设备可以决定到底是哪个DS18B20s在经历一个报警条件。如果报警的情况存在,TH和TL设置已经改变了,另一个温度转换应该去验证报警条件。 POWERING THE DS18B20 The DS18B20 can be powered by an external supply on the VDD pin, or it can operate in “parasite power” mode, which allows the DS18B20 to function without a local external supply. Parasite power is very useful for applications that require remote temperature sensing or that are very space constrained. Figure 1 shows the DS18B20s parasite-power control circuitry, which “steals” power from the 1-Wire 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 is stored on the parasite power capacitor (CPP) to provide power when the bus is low. When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground. In parasite power mode, the 1-Wire bus and CPP can provide sufficient current to the DS18B20 for most operations as long as the specified timing and voltage requirements are met (refer to the DC ELECTRICAL CHARACTERISTICS and the AC ELECTRICAL CHARACTERISTICS sections of this data sheet).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 current 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 1-Wire bus whenever temperature conversions are taking place or 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 10 (max) after a Convert T 44h or Copy Scratchpad 48h command is issued, and the bus must be held 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. The DS18B20 can also be powered by the conventional method of connecting an external power supply to the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not required, and the 1-Wire bus is free to carry other traffic during the temperature conversion time. The use of parasite power is not recommended for temperatures above +100C since the DS18B20 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 supply. In some situations the bus master may not know 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 Skip ROM CCh command followed by a Read Power Supply B4h command followed by a “read time slot”. During the read time slot, parasite powered DS18B20s 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 conversions. DS18B20的驱动该传感器DS18B20可以用外部电源接VDD端供电,或者它可以工作在“寄生电源”模式下,这种模式允许DS18B20在没有外部电源下工作。寄生电源在远程或者空间受限情况下感温是非常有用的。图1显示了的的寄生功率控制电路,其中当总线引脚为高电平时,力部门宿舍从DS18B201通过连接单总线的DQ端“偷”电。当总线是高电平或者总线是低电平,而一些能量存贮在CPP中来提供电源,“偷”来的电位DS18B20提供驱动。当DS18B20在寄生电源模式下使用时,VDD引脚必须接地。在寄生电源模式下,单总线和CPP可以提供足够的电流给DS18B20的大部分操作,只要指定的时间和电压的要求得到满足(参考本数据手册DC电气特性和AC电气特性章节)。然而,当DS18B20温度转换或复制暂存器的数据到EEPROM时,工作电流可高达1.5毫安。这个电流会导致无法接受的电压下降,整个单总线电阻压降减小,更多的电流可以由寄生电源供应。为了确保DS18B20有足够的电流供应,无论正在发生温度转换或复制暂存器的数据到EEPROM,单总线都必须接一个强上拉电阻。这可以通过使用一个MOSFET以直接把总线电压下降到如图4所示。单总线必须在转换T44h或暂存器复制48H命令发出后, 10秒内(最大)转换到强上拉状态,而且总线必须在转换(tconv)或数据传输(twr = 10ms)期间通过上拉保持高电平。在单总线上拉使能时,其他活动不能发生。该DS18B20的也可以采用的连接外部电源到VDD脚上的传统方法,如图5所示。这种方法的优点是不需要MOSFET的上拉, 而且单总线可以在进行温度转换时间自由地进行其他操作。在+100以上的高温时不推荐使用寄生电源,因为在这些温度下存在较高泄漏电流,DS18B20可能无法维持通信。对于像在这种高温下的使用,强烈建议由一个DS18B20的外部电源供电。在某些情况下,总线主机可能不知道DS18B20s是外部电源还是寄生电源供电。主机需要这些信息来确定是否强大的总线上拉应在温度转换时使用。要获得这些信息,主机可以在 “阅读时段” 一个读取电源B4h命令后,发出一个跳过ROMCCh命令。在读时隙,寄生电源给DS18B20s供电将把总线电平拉低,外部供电时DS18B20s将会让总线仍然保持高电平。如果总线拉低,主机知道在温度转换期间它必须提供单总线强上拉。64-BIT LASERED ROM CODE Each DS18B20 contains a unique 64bit code (see Figure 6) stored in ROM. The least significant 8 bits of the ROM code contain the DS18B20s 1-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 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 1-Wire device using the protocol detailed in the 1-WIRE BUS SYSTEM section of this datasheet. 64位激光ROM 每一 DS1820 包括一个唯一的 64 位长的 ROM 编码。开绐的 8 位是单线产品系列编码:28h,接着的 48 位是唯一的系列号。最重要的8位是开始 56 位 CRC位,从56位的ROM端计算而来。CRC比特的详细内容将在CRC概述一章中介绍。64位ROM代码和相关ROM功能控制逻辑使DS18B20作为使用协议的单线设备的运作,单总线系统的数据表部分详细介绍了这个协议。MEMORY T