外文翻译--DS18B20的研究与应用_第1页
外文翻译--DS18B20的研究与应用_第2页
外文翻译--DS18B20的研究与应用_第3页
外文翻译--DS18B20的研究与应用_第4页
外文翻译--DS18B20的研究与应用_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

附录 Research and Application of DS18B20 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 DS18B20s 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. 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 E2 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 E2 memory or initiates temperature conversions. When using the parasite power mode, the VDD 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 VDD pin. 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 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 command, a temperature conversion is performed and the thermal data is stored in the scratchpad memory in a 16-bit, sign-extended twos 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. Each 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. 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. 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. The 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 + 1 The 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 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”. DS18B20 的研究与应用 DS18B20 的通信是通过一个 1 - Wire 端口。与 1 - Wire 端口,内存和控制功能将无法使用以前的 ROM 功能协议已经成立。主机必须首先提供五种 ROM 操作命令之一: 1)读 ROM, 2) Match ROM 命令, 3)搜索 ROM, 4)跳过 ROM 或 5)报警搜索。这些命令运行在 64 位光刻 ROM 部分。设备和能出一个特定的设备很多都是单一的,如果在 1 - Wire 总线以及说明目前的主机有多少,哪些类型的设备都存在。经过 ROM 操作序列 已成功地执行,内存和控制功能的主机可以访问和再提供任何六个内存和控制功能命令之一。 一个控制功能命令指示执行 DS18B20 的温度测量。这一测量结果将被放置在传感器 DS18B20 的便签内存,并且可以通过发出命令,读取记忆功能的暂存存储器的内容读。温度报警触发器 TH 和 TL 的 1 个字节的 EEPROM 每个组成。如果报警搜索命令不适用于 DS18B20 的,这些寄存器可以作为通用的用户存储器。暂存器还包含一个配置字节来设置所需的温度分辨率的数字转换。写作治疗,热释光,配置字节是通过使用一个存储器功能命令。读访问这些寄存器是 通过暂存器。所有数据读取和写入最低有效位在前。 为了传感器 DS18B20 的能够进行精确的温度转换,必须提供充足的电力过的电话号码查询线时温度转换正在发生。由于经营的 DS18B20 的电流可达 1.5 mA的时,电话查号线将不会有足够的驱动由于 5公里的上拉电阻。这个问题尤其严重,如果几个 DS18B20s 在同一电话号码查询和试图转换同时进行。 有两种方法,以确保 DS18B20 的过程中有其积极转换周期足够的电源电流。第一是要提供一个强大的 DQ 线拉每当温度转换或拷贝到 E2 的内存都在发生。这可能是通过使用一个 MOSFET 拉的 DQ 线直接供电,如图 2 所示。的 DQ 线路必须在 10 切换到强的最大上拉后发出任何协议,涉及复制到 E2的内存或启动温度转换。当使用寄生供电模式,在 VDD 引脚必须接地。 另一个供应电流 DS18B20的方法是通过一个外部电源连接到 VDD端子的供应使用。对这样做的好处是,强拉未上线所需的 DQ,总线主机不必束缚抱着这条线在温度 conversions.This 允许在高的 1 - Wire 总线的转换时间,在其他数据流量。此外,任何 DS18B20s 人数可能被放置在 1 - Wire 总线,如果它们都使用外接电源,它们都可能同时 执行通过发出跳过 ROM 命令,然后转换 T命令发出温度转换。请注意,只要外部电源处于活动状态, GND 引脚可能不浮动。 该 DS18B20 的核心功能是它直接对数字温度传感器。该 DS18B20 的分辨率配置( 9, 10, 11或 12 位)与 12 位读数,出厂默认状态。这相当于 0.5 C 的,0.25 C的, 0.125 C或 0.0625 温度分辨率 三继转换 T发行 44 高 命令,执行温度转换,热数据存储在 16 位暂存器记忆体,符号扩展的二进制补码格式。温度信息可以检索通过 1 - Wire 接口发出一个读取暂存器 北京控股 命令一次转换已 完成。数据传输通过 1 - Wire 总线, LSB 在前。对温度寄存器的 MSB 中包含“符号“( s第)位,表示是否为正温度 或负数。 每个 DS18B20 的 ROM 代码包含一个独特的 64 位长。前 8位是 1 - Wire 家族码( DS18B20 的代码是 28H 页)。接下来的 48 位是一个独特的序列号。最后 8位是前 56 位的 CRC 码。 64位 ROM 和 ROM 功能控制部分

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论