欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    单片机课程设计方案—数字温度计.pdf

    • 资源ID:56681770       资源大小:785.24KB        全文页数:22页
    • 资源格式: PDF        下载积分:4.3金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要4.3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    单片机课程设计方案—数字温度计.pdf

    1/22 1 课题任务、功能要求说明及总体方案介绍1.1 课题目的随着社会的发展,温度的测量及控制变得越来越重要。本文采用单片机STC89S52设计了温度实时测量及控制系统。单片机STC89S52 能够根据温度传感器 DS18B20 所采集的温度在数码管上实时显示,通过控制从而把温度控制在设定的范围之内。所有温度数据均通过4 位数码管 LED显示出来。系统可以根据时钟存储相关的数据。通过该课程的学习使我们对计算机控制系统有一个全面的了解、掌握常规控制算法的使用方法、掌握简单微型计算机应用系统软硬的设计方法,进一步锻炼同学们在微型计算机应用方面的实际工作能力。1.2 功能要求说明设计一个具有特定功能的数字温度计。该数字温度计上电或按键复位后能自动显示系统提示符“P.”,进入准备工作状态。测量温度范围0 99,测量精度小数点后两位,可以通过开始和结束键控制数字温度计的工作状态。1.3 设计课题总体方案介绍及工作原理说明1.3.1 设计课题总体方案(1根据设计要求,选择 AT89C52单片机为核心器件。(2温度检测器件采用DS18B20数字式温度传感器。与单片机的接口为P3.6 引脚。(3键盘采用独立式按键,由三个按键组成,分别是:设置键SET),加一建+1),确认键 SET 键+1 键RET键确认键):当该键按下时,指向下一个要调整的位。通过P0.3引脚接入。2/22 1.3.2 工作原理说明本课题以是80S52 单片机为核心设计的一种数字温度控制系统,利用温度传感器DS18B20可以直接读取被测温度值,进行转换的特性,模拟温度值经过DS18B20处理后转换为数字值,然后送到单片机中进行数据处理,并与设置的温度报警限比较,超过限度后通过扬声器报警。同时处理后的数据送到 LED中显示。文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E33/22 2 硬件系统的设计2.1 课题硬件系统各模块功能简要介绍硬件电路设计总体框图为图1:图 1 2.1.1 主控制器单片机 AT89S52具有低电压供电和体积小等特点,四个端口只需要两个口就能满足电路系统的设计需要,使用Atmel公司高密度非易失性存储器技术制造,与工业80C51 产品指令和引脚完全兼容。片上Flash 允许程序存储器在系统可编程,亦适于常规编程器。很适合便携手持式产品的设计使用。2.2.2 显示电路显示电路采用四位共阳LED数码管,从 P3口 RXD,TXD 串口输出段码。2.2.3 温度传感器DS18B20是美国DALLAS半导体公司最新推出的一种改进型智能温度传感器,与传统的热敏电阻等测温元件相比,它能直接读出被测温度,并且可根据实际要求通过简单的编程实现位的数字值读数方式。DS18B20的性能特点如下:?独特的单线接口仅需一个端口引脚进行通讯?简单的多点分布应用?无需外部器件?可通过数据线供电?零待机功耗?测温范围-55+125,以 0.5 递增。华氏器件-67+2570F,以0.90F递按键输入电路时钟电路复位电路电源电路单片机LED 显示器驱动电路4 位 LED显示器温度检测文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E34/22 增?温度以 9 位数字量读出?温度数字量转换时间 200ms 典型值)?用户可定义的非易失性温度报警设置?报警搜索命令识别并标志超过程序限定温度温度报警条件)的器件。DS18B20 内部结构主要由四部分组成:64位光刻ROM、温度传感器、非挥发的温度报警触发器 TH 和TL、配置寄存器。DS18B20 的管脚排列、各种封装形式如图2所示,DQ 为数据输入/输出引脚。开漏单总线接口引脚。当被用着在寄生电源下,也可以向器件提供电源;GND 为地信号;VDD 为可选择的 VDD 引脚。当工作于寄生电源时,此引脚必须接地。其电路图如图2所示.。图2外部封装形式在仿真软件中如图 3所示图3 DS18B20的测温原理如图4 所示,图中低温度系数晶振的振荡频率受温度的影响很小用于产生固定频率的脉冲信号送给减法计数器1,高温度系数晶振随温度变化其震荡频率明显改变,所产生的信号作为减法计数器2 的脉冲输入,图中还隐含着计数门,当计数门打开时,DS18B20就对低温度系数振荡器产生的时钟脉冲后进行计数,进而完成温度测量.计数门的开启时间由高温度系数振荡器来决定,每次测量前,首先将-55 所对应的基数分别置入减法计数文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E35/22 器 1 和温度寄存器中,减法计数器1 和温度寄存器被预置在-55 所对应的一个基数值。减法计数器1 对低温度系数晶振产生的脉冲信号进行减法计数,当减法计数器 1 的预置值减到0 时温度寄存器的值将加1,减法计数器 1 的预置将重新被装入,减法计数器1 重新开始对低温度系数晶振产生的脉冲信号进行计数,如此循环直到减法计数器2 计数到 0 时,停止温度寄存器值的累加,此时温度寄存器中的数值即为所测温图4 中的斜率累加器用于补偿和修正测温过程中的非线性其输出用,于修正减法计数器的预置值,只要计数门仍未关闭就重复上述过程,直至温度寄存器值达到被测温度值,这就是DS18B20 的测温原理。另外,由于DS18B20单线通信功能是分时完成的,有严格的时隙概念,因此读写时序很重要。系统对DS18B20的各种操作必须按协议进行。操作协议为:初始化 DS18B20 发复位脉冲)发ROM 功能命令发存储器操作命令处理数据。预置低温度系数振荡器高温度系数振荡器斜率增加器计数器 1比较预置=0温度寄存器计数器 2=0Tx加 1停止12图 4 在正常测温情况下,DS1820的测温分辨力为0.5,可采用下述方法获得高分辨率的温度测量结果:首先用DS1820 提供的读暂存器指令BEH)读出以0.5 为分辨率的温度测量结果,然后切去测量结果中的最低有效位.北京:高等教育出版社,2006.Yang Suhang.Analog electronic technology foundation(second edition.Beijing:higher education press,2006【2】阎石著.数字电子技术基础(第五版 .北京:高等教育出版社,2006.Yan Shi.Digital electronic technology base(fifth edition.Beijing:higher education press,2006.【3】李全利,仲伟峰,徐军著.单片机原理及应用.北京:清华大学社,2006.Li Quanli ZhongWeiFeng,Xu Junzhu.Single chip microcomputer principle and application.Beijing:tsinghua university club,2006【4】杨路明著 C 语言程序设计教程(第 2 版 北京:北京邮电大学出版社,2005.Yang Luming.C language programming tutorial(second edition.Beijing:Beijing university of posts and telecommunications publishing house,2005文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E314/22 附录一源程序#include typedef unsigned char uint8。typedef unsigned int uint16。typedef unsigned long uint32。uint8 x。uint32 tvalue。uint8 keyflag=0。uint8 code table=0 x3F,0 x06,0 x5B,0 x4F,0 x66,0 x6D,0 x7D,0 x07,0 x7F,0 x6F。/012346789 sbit DQ=P36。/sbit DQ=P30。/sbit dule=P26。/sbit wele=P27。sbit key1=P10。sbit led1=P30。/18B20初始化成功灯亮void delay(uint16 i while(i-。/*温度传感器*/void init_18b20(/18b20的初始化。DQ=0。/将 DQ 拉低,开始初始化时序。/DQ拉低,保持480960 微秒 DQ=1。delay(14。/DQ拉高,保持60 微秒 x=DQ。/初始化成功x 为 1 if(x=1 文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E315/22 led1=0。/初始化成功灯亮 void write_18b20(uint8 dat /18b20写操作 uint8 i。for(i=0。i /一字节 8 位要写满 DQ=1。/初始化 DQ线 delay(4。DQ=0。/将 DQ 拉低,开始写操作时序,15us 之内要将所需写的位送到DQ线上 DQ=dat&0 x01。/从最低位取数时,要和0X01位与 delay(7。/将 DQ拉低后 15-60us 间对总线采样 DQ=1。/写完后恢复 delay(1。/两个写时序间至少需要1us 的恢复期 dat=1。/将数据向右移一位,准备写入下一个数据 uint8 read_18b20(/*读操作*uint8 i,dat2。for(i=0。i /读一个字节的8 位 DQ=1。/初始化 DQ线 delay(1。dat2=1。/dat右移一位,使最高位空出 DQ=0。/将 DQ拉低,开始读操作时序 delay(1。/*注意不能延时太长,否则读数有误*DQ=1。/将 DQ拉高,使单片机检测 18B20的输出电平 if(DQ=1 /如果检测到18B20 的输出电平为 1 dat2|=0 x80。/将 DQ线的 1 取出,写在dat2 的最高位。位或后最高位为1 delay(6。/两个读时序间至少需要1us 的恢复期 return(dat2。/返回读出的八位数据文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3文档编码:CH3P6O4Z9D6 HS8R8Z1X1S3 ZH2U6Z10I3E3

    注意事项

    本文(单片机课程设计方案—数字温度计.pdf)为本站会员(H****o)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开