温度传感器DS18b20接口设计(4课时).ppt
《温度传感器DS18b20接口设计(4课时).ppt》由会员分享,可在线阅读,更多相关《温度传感器DS18b20接口设计(4课时).ppt(24页珍藏版)》请在沃文网上搜索。
1、89s52与温度传感器DS18b20接口设计DS18b20 FEATURES1、Unique 1-WireTM interface requires only one port pin for communication2、Measures temperatures from-55C to+125C;Fahrenheit equivalent is-67F to+257F 3、0.5 C accuracy from-10C to+85C4、Thermometer resolution is programmable from 9 to 12 bits5、Converts 12-bit temp
2、erature to digital word in 750 ms(max.)DS18b20 简介1、单总线技术,只需要一个端口与主机通信2、温度测量范围摄氏-55C+125C,华氏-67F +257F 3、-10C +85C间测量误差在 0.5 C 以内4、温度测量精度可编程控制(9位到12位)5、12位精度时温度转换时间750ms(最大)DS18B20 MEMORY MAPDS18B20 CONFIGURATION REGISTERBits 0-4 are dont cares on a write but will always read out“1”.Bit 7 is dont car
3、e on a write but will always read out“0”.R0,R1:Thermometer resolution bits.Table below defines the resolution of the digital thermometer,based on the settings of these two bits.There is a direct tradeoff between resolution and conversion time,as depicted in the AC Electrical Characteristics.The fact
4、ory default of these EEPROM bits is R0=1 andR1=1(12-bit conversions).DS18B20 与单片机通信流程单片机与DS18B20一次完整的通信过程由以下4步组成:所有操作都必须由初始化脉冲开始,波形如图,单片机先输出一个480960us低电平到DQ引脚,再将DQ引脚置高电平,过1560us后检测DQ引脚状态,若为低电平则DS18B20工作正常,否则初始化失败,不能正常测量温度。DS18B20 初始化DS18B20 ROM操作命令1、Read ROM 33H2、Match ROM 55H3、Skip ROM CCH4、Search
5、ROM F0H5、Alarm Search ECHDS18B20 内存操作命令1、Write Scratchpad 4EHThis command writes to the scratchpad of the DS18B20,starting at the TH register.The next three bytes written will be saved in scratchpad memory at address locations 2 through 4.All three bytes must be written before a reset is issued.1、写暂
6、存器命令【4EH】这个命令为由TH寄存器开始向DS18B20暂存器写入数据,4EH命令后的3字节数据将被保存到暂存器的地址2、3、4(TH、TL、CONFIG)三个字节。所有数据必须在复位脉冲前写完。即如果只想写一个字节的数据到地址2,可按如下流程:1、初始化 2、写0CCH 跳过ROM检测 3、写4EH 4、写1字节数据 5、复位 即向DQ输出480960us低电平2、Read Scratchpad BEHThis command reads the contents of the scratchpad.Reading will commence at byte 0 and will con
7、tinue through the scratchpad until the 9th(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.2、读暂存命令【BEH】这个命令由字节0读取9个暂存器内容,如果不需要读取所有暂存内容,可随时输出复位脉冲终止读取过程DS18B20 内存操作命令DS18B20 内存操作命令3、Convert T 44HThis command begins a temperature
8、 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 whe
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10 积分
下载 | 加入VIP,下载更划算! |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 温度传感器 DS18b20 接口 设计 课时
