




已阅读5页,还剩44页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
课程论文课程论文 设计题目设计题目: : 温湿度控制器温湿度控制器 2 温湿度控制器设计报温湿度控制器设计报 摘 要 本文主要介绍的是基于单片机的温湿度计的设计,通过 lcd 显示所测量的 温湿度。系统采用集温湿度传感器与 a/d 转换器为一体的 sht11 芯片,通过单 片机处理进行显示,文中详细说明了温湿度计数据采集与传输、液晶显示、加 湿等功能以及实现这些功能而进行的硬件电路设计和软件程序设计。本文给出 了硬件电路原理图、主程序和部分子程序流程图,通过软、硬件设计使得该款 温湿度计具有智能化、高精度、高可靠性等优势,具有广阔的应用前景。此系 统结构简单、实用、提高了测量精度和效率。 关键词:单片机、温湿度传感器、液晶显示器 湖南人文科技学院毕业设计 3 abstract are mainly introduced in this paper based on single-chip microcomputer temperature and humidity meter design, through the lcd display measured by the temperature and humidity. system adopts sets and humidity sensor and a/d converter for the integration of sht11 chip microcontroller processing, through that explained temperature and humidity data collection and transmission project, lcd display, humidifying functions and achieve these functions and design of hardware circuit and the software programming. this paper also presents the hardware circuit principle diagram, the main program and the terrorists program flowcharts, through the software and hardware design makes duckshot almost temperature and humidity plan has intelligence, high accuracy, high reliability, etc advantages, has wide application prospects. this system structure is simple, practical, improve the measurement accuracy and efficiency keywords:mcu、temperature humidity sensor、lcd 目 录 摘 要.i abstract ii 第 1 章 绪论1 1)功能与特点1 2)硬件设计2 2.1 设计框图.3 2.2 温湿度传感器器及检测电路温湿度传感器器及检测电路. 4 2.3 单片机电路单片机电路.5 2.4 显示电路显示电路.6 2.5 温湿度上限存储温湿度上限存储.7 2.6 供电及程序下载电路供电及程序下载电路.8 4 3 3) ) 软件编程软件编程 3.1 软件流程图软件流程图.9 3.2 主程序主程序 .10 3.3 常量、变量定义.11 4)下载与调试 4.1 usb 转串口驱动安装.12 2 下载程序.13 3 运行运行14 本章小结12 结 论13 致 谢14 参考文献15 附录 1 译文.16 附录 2 英文资料.17 附录 3 电路原理图.18 附录 4 软件程序.19 附录 5 元件清单列表.20 一、一、功能与特点功能与特点 配用全数字型温湿度传感器 dht11,温度测量范围 0-50,湿度测 湖南人文科技学院毕业设计 5 量范围 20%rh90%rh,可以满足一般需要。若要求更宽测量范围,只 需更换温湿度传感器型号,硬件电路及软件程序全兼容。 温湿度测量响应时间快、长期稳定性好。 采用先进的专用微处理器芯片 stc89c52,可靠性高,抗干扰能力强。 配用 eeprom 芯片 at24c04,使存储的温度上下限和湿度上下限可以掉电永久 保存。 可以通过四个按键方便地实现温湿度上下限的调整。 当温度或湿度超限后,报警信号点亮相应报警灯。如果配用三极管和继电器,该 信号也可以驱动继电器打开或切断风机、加热器等外部设备。 二、二、硬件设计硬件设计 1、设计框图 本研究设计的温湿度控制器框图如图 1 所示。 dht11温湿度传感器 stc89c52单片机外部eeprom 温湿度上限 温度、湿度数据 lcd显示 温湿度值 过阈报警按键输入 图 1 温湿度控制器方框图 图中 stc89c52 单片机每 2 秒钟从 dht11 温湿度传感器中读入温度和湿 度,在液晶屏上即时显示。液晶屏上同时显示温湿度上限值,该上限值保存外 外部 eeprom 存储器中,掉电不失,并且可以通过四只按键上调或下调。当 温度或湿度值超过上限值时,报警信号点亮相应报警灯。该报警信号可以通过 三极管驱动继电器,以控制外部风机或加热器。继电器电路套件中不标配,如 果需要请另外说明。 6 2、温湿度传感器器及检测电路 图 2 dht11 温湿度传感器外型及管脚 dht11 温湿度传感器外型及管脚如图 2 所示。其中电源引脚的供电电压为 3.5-5.5v。传感器上电后,要等待 1s 以越过不稳定状态在此期间不要发送 任何指令。电源引脚(vdd,gnd)之间可增加一个 100nf 的电容,用以去耦滤 波。 dht11典型应用电路如图3所示,其连接电路简单,只需要占用控制器一个i/o 口即可完成上下位的连接。建议连接线长度短于20时用5k上拉电阻,大于20米时根 据实际情况使用合适的上拉电阻, 图 3 dht11 典型应用电路 dht11数字湿温度传感器采用单总线数据格式,即单个数据引脚端口完成输入 输出双向传输。其数据包由5byte(40bit)组成。一次通讯时间最大3ms,数据分 小数部分和整数部分。 一次完整的数据传输为40bit,高位先出。 数据格式如表 一: 表1 dht11数据格式 湖南人文科技学院毕业设计 7 3、单片机电路 本设计选用宏晶公司高性能单片机 stc89c52,其管脚如图 4 所示。 图 4 stc89c52 单片机管脚图 该芯片为 52 内核 8 位单片机,兼容 intel 等 52 内核单片机,支持 isp 下 载,适用于常用检测控制电路。由 stc89c52 组成的单片机系统原理图如图 5 所示。 图中 data 引脚为温湿度传感器单总线引脚,k1、k2、k3、k4 为四只调节 按键,用以调整温湿度上限值。l3、l4、l5 为三只报警灯,其中 l3 为超温报 警,l4 为超湿报警,l5 保留给用户定义。 8 图 5 单片机系统原理图 4、显示电路 显示部分采用 smc 1602 液晶屏进行数据显示,其主要技术参数为: 表 2 液晶屏技术指标 湖南人文科技学院毕业设计 9 接口信号说明如表 3 所示。 表 3 液晶屏接口信号说明 与单片机接口电路如图 6 所示。 10 图 6 lcd 与单片机接口电路 5、温湿度上限存储 温湿度阈值存储在 eeprom 芯片 at24c04 中,并可以通过 k1k4 按键调节 并保存,其中 k1 为温度上限增加,k2 为温度上限减小,k3 为湿度上限增加, k4 为湿度上限减小。at24c04 是 iic 芯片,其电路如图 7 所示。 图 7 eeprom 存储电路 6、供电及程序下载电路 本设计采用 usb 接口供电,电源电压 5v。同时,usb 接口通过内含 pl2303 芯片的转换电路对单片机进行程序编写。其电路原理如图 8 所示。 图 8 供电及程序下载电路 湖南人文科技学院毕业设计 11 三、三、软件编程软件编程 1、软件流程图 本设计软件主程序流程图如图 9 所示。 数据初始化 定时器初始化 显示初始化 进入后台while循环 温湿度转换 超过阈值吗? 有键按下吗?按键处理 温湿度数值显示 报警 是 是 否 否 有转换标志吗? 是 否 图 9 主程序流程图 2、主程序 下面介绍 main.c 主程序编写,其他程序略。 (1) 头文件和一些宏定义 #include #include “1602.h“ 12 #include “dht.h“ #include “2402.h“ (2) 管脚定义 sbit led_qushi=p16; /去湿灯 sbit led_jiangwen=p15;/降温灯 sbit led_shengwen=p14;/升温灯 sbit key_th1 = p32; sbit key_th2 = p33; sbit key_hh1 = p34; sbit key_hh2 = p35; (3) 常量、变量定义 /定义标识 volatile bit flagstartrh = 0; /开始温湿度转换标志 volatile bit flagkeypress = 0; /有键按下 /定义温湿度传感器用外部变量 extern u8 u8flag,k; extern u8 u8count,u8temp; extern u8 u8t_data_h,u8t_data_l,u8rh_data_h,u8rh_data_l,u8checkdata; extern u8 u8t_data_h_temp,u8t_data_l_temp,u8rh_data_h_temp,u8rh_data_l_temp; extern u8 u8checkdata_temp; extern u8 u8comdata; extern u8 count, count_r; u16 temp; s16 temperature, humidity; s16 idata th, hh; /温度上限和湿度上限 char * psave; u8 keyvalue, keyth1, keyth2, keyhh1, keyhh2; u16 rhcounter; (4) 各子程序 /数据初始化 void data_init() rhcounter = 0; 湖南人文科技学院毕业设计 13 led_qushi = 1; led_jiangwen = 1; led_shengwen = 1; th = 40; hh = 85; keyvalue = 0; keyth1 = 1; keyth2 = 1; keyhh1 = 1; keyhh2 = 1; /定时器 0 初始化 void timer0_init() et0 = 1; /允许定时器 0 中断 tmod = 1; /定时器工作方式选择 tl0 = 0x06; th0 = 0xf8; /定时器赋予初值 tr0 = 1; /启动定时器 /定时器 0 中断 void timer0_isr (void) interrupt 1 using 0 tl0 = 0x06; th0 = 0xf8; /定时器赋予初值 /每 2 秒钟启动一次温湿度转换 rhcounter +; if (rhcounter = 1000) flagstartrh = 1; rhcounter = 0; /存入设定值、 14 void save_setting() psave = (char *) /地址低位对应低 8 位,高位对应高 8 位 wrteeprom(0, *psave); /存温度上限值 th 低 8 位 delay(500); psave +; wrteeprom(1, *psave); /存温度上限值 th 高 8 位 delay(500); psave = (char *) wrteeprom(2, *psave); /存湿度上限值 rh 低 8 位 delay(500); psave +; wrteeprom(3, *psave); /存湿度上限值 rh 高 8 位 delay(500); /载入设定值、 void load_setting() psave = (char *) *psave+ = rdeeprom(0); *psave = rdeeprom(1); psave = (char *) *psave+ = rdeeprom(2); *psave = rdeeprom(3); if (th99)|(th99)|(hh hh) led_qushi = 0; else led_qushi = 1;/去湿 /键盘查询,在弹起时响应 if (key_th1) keyvalue = 1; else if (key_th2) keyvalue = 2; 湖南人文科技学院毕业设计 17 else if (key_hh1) keyvalue = 3; else if (key_hh2) keyvalue = 4; if (flagkeypress = 1) keyprocess(keyvalue); flagkeypress = 0; if (!key_th1) keyth1 = 0; else keyth1 = 1; if (!key_th2) keyth2 = 0; else keyth2 = 1; if (!key_hh1) keyhh1 = 0; else keyhh1 = 1; if (!key_hh2) keyhh2 = 0; else keyhh2 = 1; 四、四、下载与调试下载与调试 提供例程在 uvision4 环境下编译,如果是其他版本 uvision,只需将所有. c 和.h 文件拷贝至新建项目,重新编译即可。当编译生成.hex 文件后,就可以 下载并进行调试了。 1、usb 转串口驱动安装 打开 usb 驱动文件夹下的 pl2303_prolific_driverinstaller_v130.exe 安装文 件,按提示安装 usb 转串口驱动程序。安装完成后,插入 usb 下载线后,在 开始-控制面板-打印机和其他硬件-设备管理器,在“端口”分支下有 (prolific usb-to-serial comm port(comx)。x 表示串口号,如果没有说明 usb 转串口驱动没有安装,须重新安装。记住括号里的 com 口号。 18 图 10 成功安装 usb 转串口驱动示意图 2、下载程序 打开 stc 单片机下载软件文件夹,点击运行 stc_isp_v481.exe 程序,出 现如下界面。 湖南人文科技学院毕业设计 19 图 11 下载软件 正确选择 mcu 类型,com 口(与刚才安装的 com 号一致) ,最高波特最高波特 率和最低波特率都选率和最低波特率都选 2400bps 或者或者 1200bps (下载线内 pl2303 芯片所限,没 办法!) ,并打开正确的.hex 数据文件。 点击“download/下载”按纽,窗口出现提示: chinese:正在尝试与 mcu/单片机 握手连接 . connection is failure. you can try: 1.give your mcu power on reset. 2.stop operation, then re-select com port. 3.because plcc-dip/pqfp-dip socket trace too long. 4.update the stc isp.exe version. 5.if still error, your mcu firmware is error or null. chinese:连接失败,请尝试以下操作: 1.在单片机停电状态下,点下载按钮,再给单片机上电 2.停止下载,重新选择 rs-232 串口, 接好电缆 3.可能需要先将 p1.0/p1.1 短接到地 4.可能外部时钟未接 5.因 plcc、pqfp 转换座引线过长而引起时钟不振荡,请 调整参数 20 6.可能要升级电脑端的 stc isp.exe 软件 7.若仍然不成功,可能 mcu/单片机内无 isp 系统引导码, 或需退回升级,或 mcu 已损坏 8.若使用 usb 转 rs-232 串口线下载,可能会遇到不兼容 的问题,可以让我们帮助购买兼容的 usb 转 rs-232 串口线 仍在连接中, 请给 mcu 上电. 按下电路板上的电源按纽,保证其有个失电至上电的过程,则窗口显示开 始烧录芯片。 3、运行运行 下载完成后程序自动运行,或重上电后程序正常运行,如图 12 所示。 本章小结 本章介绍了硬件电路主要部件的检测和功能强大的编译仿真软件 keil 的 一些基本使用方法,用其可以生成下载文件 hex,也可以编译仿真程序,如果 没有硬件进行验证程序,还可以与 proteus 这款软件配合使用,可以仿真硬件 实现的功能。 结 论 本次我的毕业设计的题目是基于单片机的温湿度计,要求是能够时时检测 当前温度和湿度,当湿度到某一数值时启动加湿功能。在老师的帮助和自己的 不断努力下,本次毕业设计成功实现了所要达到的技术指标。 在本此设计中,由于采用的是高效单片机作为核心,集温度传感器和湿度 传感器于一体的 sht11 作为主要的采集与测量系统,由于将传感器与电路部 分结合在一起,因此,该传感器具有比其它类型的湿度传感器优越得多的性能。 首先是传感器信号强度的增加增强了传感器的抗干扰性能,保证了传感器的长 期稳定性,而 a/d 转换的同时完成,则降低了传感器对干扰噪声的敏感程度。 其次在传感器芯片内装载的校准数据保证了每一只湿度传感器都具有相同的功 能,即具有 100%的互换性。其中它自带的 a/d 转换器,使得此温湿度计具有精 度高、成本低、接口简单等特点,还具有良好抗干扰能力。加上优化程序,使 湖南人文科技学院毕业设计 21 得本系统具有很高的实用性。 通过本次设计使我对温湿度计有了比较全面的了解,熟悉了温湿度计设计 的理念,掌握了温湿度计设计的一些技能,让我了解了设计方法对我们学习的 重要性,同时也发现了自己的很多不足之处。 我深刻认识到仅仅了解书本上 的知识是远远不够的,只有结合自己的实际情况运用于实践,这样才能更深地 了解和学习好知识,同时我们要在工作中不断的积累经验,学会用自己的知识 解决实际问题。 由于时间和本人能力的限制,设计中存在一些需要改进和优化的地方。测 量精度有待进一步提高,软件设计也存在不合理之处。但在设计的过程中,使 我对四年以来所学的专业知识有了更深一步的理解,不仅提高了动手能力,而 且使我对产品开发的过程有了更深刻的了解。通过本次设计我积攒了很多经验 并收获了很多知识,真是受益匪浅。 致 谢 大学生活一晃而过,人生能有几个四年,我在我的大学里度过了我人生最 有意义的四年。回首走过的岁月,心中倍感充实,当我写完这篇毕业论文的时 候有一种如释重负的感觉,感慨良多。 首先诚挚的感谢我的指导老师胡金龙老师。从开题报告开始,他在忙碌的 教学工作中挤出时间审查、修改我的论文。他渊博的专业知识,严谨的治学态 度,精益求精的工作作风,教人不倦的高尚品德,严于律己、宽以待人的崇高 风范,朴实无华、平易近人的人格魅力对我影响深远。不仅是我树立了远大的 工作目标,掌握了基本的学习方法,还是我明白了许多带人接物与为人处世的 道理,还有教过我的老师,你们的严谨细致、一丝不苟的作风一直是我工作学 习中的榜样;他们的循循善诱的教导和不拘一格的思路给与我无尽的启迪。 感谢四年中陪伴在我身边的同学、朋友、感谢他们为我提出有意的意见和 建议,有了他们的支持、鼓励和帮助,我才充实的度过了死难的学习生活。 最后真诚期望每一个已经出现在或是已经出现在我不同人生阶段却是同一 22 条生活轨迹的师长、亲友、同学们,能够拥有美好幸福的生活状态、以及一直 热忱于拥有满意工作的心,同时也是对自己未来生活的期冀。 参考文献 1 侯国锐.赵亮. 单片机c语言编程与实践.人民邮电出版社. 2 戴佳.于永. 单片机c语言常用模块与综合系统设计.电子工业出版社. 3 孙宝元. 杨宝清.传感器及其应用手册. 机械工业出版社. 2004. 4 张福学. 现代实用传感器电路. 中国计量出版社. 1997. 5 张洪润. 张亚凡. 单片机原理与应用. 清华大学出版社. 2005. 6 何立民. mcs-51 系列单片机应用系统设计.北京航空航天大学出版社.1990. 7 楼然苗.李光飞. 51 系列单片机设计实例.北京航空航天大学出版社. 2003. 8 纪宗南. 单片机外围器件实用手册. 北京航空航天大学出版社. 1998. 9 李华. mcs-51系列单片机使用接口技术. 北京航空航天大学出版社. 1990. 湖南人文科技学院毕业设计 23 10at89s51 datasheet.atmel . 11 sht11 datasheet.catalyst . 12 陈伟人. 计算机原理及接口技术. 清华大学出版社. 1993. 13 张庆双. 电子元器件的选用与检测. 机械工业出版社. 2003. 14 1602 字符型 lcd. 长沙太阳人电子有限公司 . 15 李维缇.郭强. 最新液晶显示应用. 电子工业出版社. 2006. 附录 1 译文 自单片机出现至今,单片机技术已走过了几十年的发展路程。纵观几十年 来单片机发展历程可以看出,单片机技术的发展以微处理器(mpu)技术及超 大规模集成电路技术的发展为先导,推动广泛的应用领域,表现出比微处理器 更具个性的发展趋势: 1.采用先进结构以实现高性能 在过去的一段时间内,单片机的指令运行速度一直在 10mips 以下,这对 于应用在工业控制领域内的单片机来说是足够了,但当单片机被应用在通讯及 dsp 领域作为高速运算、编码或解码时,就会出现因指令运行速度不够而限制 单片机应用的情形,因此提高单片机指令运行速度已经成为迫切需要解决的问 题。 2.进一步降低功耗 24 基于 80c51 的飞利浦低功率、低系统成本微控制器 51lpc 系列是业界推动 单片机向低功耗方向发展的主导单片机系列之一。51lpc 系列单片机采用以下 三种方法降低功耗: (1)使系统进入空闲模式,在空闲模式下,只有外围器件在工作,任意 的复位及中断均可结束空闲模式。 (2)使系统进入低功耗模式,在低功耗模式下,振荡器停止工作,使功 耗降到最小。 (3)使系统进入低电压 eprom 操作,eprom 包含了模拟电路,当 vcc 高于 4v 时,可通过软件使这些模拟电路掉电以降低功耗,在上电情况下可使系统退 出该模式。 3.采用 flash memory 随着半导体工艺技术的不断进步,mpu 的 flash 版本逐渐替代了原有的 otp 版本。flash mpu 具有以下优点:与多次可编程的窗口式 eprom 相比, flash mpu 的成本要低得多;在系统编程能力以及产品生产方面提供了灵活性, 因为 flash mpu 可在编程后面再次以新代码重新编程;可减少已编程器件的报 废和库存;有助于生产厂商缩短设计周期,使终端用户产品更具有竞争力。 4.集成更多功能及兼容性 目前单片机的另一个发展趋势是在芯片上集成更多的功能。如模拟功能, 包括模拟比较器、a/d 和 d/a 转换器等。具体表现在:兼容性作为设计的第一 考虑;额外的新的特点是透明的;使用同一种编程器;otp 使器件快速提升及 标准化成为可能。 5.强抗干扰能力 不断加强抗干扰能力是单片机进一步发展的必然趋势。st microelectnics 公司推出的 st62 系列单片机在这方面是佼佼者,其优良的抗 干扰能力使得许多大公司将其应用在系统中的关键部件上。许多单片机开发商 也正朝着这个方向努力。 6.朝着系列化、全面化方向发展 各大单片机开发商在增加产品功能的同时效力于形成产品的系列化、全面 化,以满足各种控制领域的要求,这也是单片机发展的趋势之一。日本 toshba 公司开发了从 4 位到 64 位的多系列单片机,日立公司也有从 4 位到 32 位的单 片机,目前还没有哪个厂家生产的单片机比东芝公司的种类多。 随着单片机性能的不断提高,不断的克服和弥补自身的不足。在各种控制 领域,单片机将拥有更加广阔的使用天地。在很长的一段时间内,它将一直是 湖南人文科技学院毕业设计 25 工程设计人员的首选控制芯片之一。 7.at89s51 特征: (1)4000 字节在系统可编程(isp)的快闪记忆体-耐力:1000 写/擦除 周期; (2)4.0v 至 5.5v 的经营范围; (3)完全静态操作:0hz 到 33mhz; (4)三级程序存储器锁定; (5)1288 位内部 ram; (6)32 个可编程 i/o 线; (7)两个 16 位定时器/计数器; (8)6 个中断源; (9)全双工异步串行通道; (10)低功耗空闲和断电状态下; (11)中断恢复掉电模式; (12)看门狗定时器; (13)双数据指针; (14)断电检举; (15)快速编程时间; (16)灵活的 isp 编程(字节和页模式) ; 8.at89s51 描述: at89s51 是一个低功耗,高性能 cmos8 位微控制器与 4000 字节的系统内可 编程闪存存储器。该设备的生产使用 atmel 的高密度非易失性存储器技术和符 合产业尝试标准 80c51 指令集和引脚。片上闪存允许程序内存重新编程的系统 或通过传统的非易失性内存亲语法。通过结合通用 8 位中央处理器的系统内可 编程闪存的单片芯片, atmel 公司 at89s51 是一个功能强大的微控制器,提供 了一个高度灵活的和具有成本效益的解决办法,许多嵌入式控制应用。在 at89s51 提供以下标准功能:4000 字节的 flash,128 字节的内存,32 个 i/o 线,看门狗定时器,两个数据指针,两个 16 位定时器/计数器,5 向量两级中 断结构,全双工串行接口,片上振荡器和时钟电路。此外,at89s51 设计的静 态逻辑 operationdown 零频率和支持两种软件可选的节电模式。空闲模式停止 的 cpu,同时允许的 ram,定时器/计数器,串行端口,并中断系统继续运作。 在掉电模式保存在 ram,但冻结振荡器,停用所有其他芯片的功能,直到下一 个外部中断或硬件复位。 26 附录 2 英文资料 micro - more processors personality development trends: 1. advanced structure in order to achieve high performance in the last period of time, single-chip instruction speed 10mips has been following this industry for applications in the field of control of the single chip is enough, but when a single machine used in the field of communications and dsp as a high-speed computing, encoding or decoding, as a result of instructions will be run at lack of restrictions on 湖南人文科技学院毕业设计 27 single-chip and application of the case and therefore increase the speed of single-chip instruction has become an urgent need to be addressed. 2. 80c51 to further reduce power consumption based on the philips low-power, low-cost system microcontroller 51lpc series is the industrys promotion of low- power single chip to the direction of one of the leading single-chip family. 51lpc series single-chip three ways to reduce power consumption: (1) into the system so that the idle mode in idle mode, only the peripheral devices in the work of any disruption can be reset and the end of the idle mode. (2) into the system so that low-power mode, low-power mode, the oscillator to stop working, is to minimize power consumption. (3) into the system so that low-voltage eprom operation; eprom includes analog circuits, when vcc higher than 4v, the software can make these analog circuits to reduce power consumption down, in the case of electrical system could withdraw from the model. 3. use of flash memory with the semiconductor process technology advances, mpu the flash version of a gradual replacement of the original version of the otp. flash mpu has the following advantages: with a number of window-programmable eprom compared, flash mpu much lower cost; in-system programming as well as the ability to produce products that provide the flexibility, as flash mpu can be programmed in the back again with a new program to re-code; can reduce the devices programming has been scrapped and inventory; help manufacturers shorten the design cycle, so that the end-user products and more competitive. 4. integrate more functions and compatibility of the other single-chip current trends in the chip more. if the analog functions, including analog comparator, a / d and d / a converters and so on. this is specifically manifested in: the compatibility of the design as the first consideration; additional new feature is transparent; with the use of a programmer; otp device to enable rapid and enhance the standardization possible. 5. strong anti-interference ability to continue to strengthen the anti-interference ability to further develop single-chip is an inevitable trend. st microelectronics has introduced the st62 series mcu is a leader in this area, and its excellent anti- interference ability of many large companies make their application in the systems key components. many single-chip developers are moving in that direction. 28 6. serialization of north korea, major comprehensive development of single- chip developers in the functions of the product at the same time increase the effectiveness of the product in the form of serialized = be comprehensive in order to meet the requirements of the various areas of control, which is single-chip development one of the trends. toshba japan has developed from a 4-64 multi- family single-chip, hitachi also from the 4. bit to 32-bit microcontroller, which has not yet produced single-chip factory than toshibas variety. with the continuous improvement in the performance of single-chip, and continue to make up their own to overcome the deficiencies. in a variety of areas of control, single-chip will have more extensive use of heaven and earth. in a very long period of time, it has been the projects designer of choice for control of one of the chips. 7. at89s51 features (1)4k bytes of in-system programmable (isp) flash memoryendurance: 1000 write/erase cycles; (2)4.0v to 5.5v operating range; (3)fully static operation: 0 hz to 33 mhz; (4)three-level program memory lock; (5)128 x 8-bit internal ram; (6)32 programmable i/o lines; (7)two 16-bit timer/counters; (8)six interrupt sources; (9)full duplex uart serial channel; (10)low-power idle and power-down modes; (11)interrupt recovery from power-down mode; (12)watchdog timer; (13)dual data pointer; (14)power-off flag; (15)fast programming time; (16)flexible isp programming (byte and page mode); 8. at89s51 description the at89s51 is a low-power, high-performance cmos 8-bit microcontroller with 4kbytes of in-system programmable flash memory. the device is 湖南人文科技学院毕业设计 29 manufactured usingatmels high-density nonvolatile memory technology and is compatible with the indus-try-standard 80c51 instruction set and pinout. the on-chip flash allows the programmemory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. by combining a versatile 8-bit cpu with in-system programmable flash on a monolithic chip, the atmel at89s51 is a powerful microcontroller which provides ahighly-flexible and cost-effective solution to many embedded control applications.the at89s51 provides the following standard features: 4k bytes of flash, 128 bytes of ram, 32 i/o lines, watchdog timer, two data pointers, two 16-bit timer/counters, a five-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, andclock circuitry. in addition, the at89s51 is designed with static logic for operationdown to zero frequency and supports two software selectable power saving modes.the idle mode stops the cpu while allowing the ram, timer/counters, serial port, and interrupt system to continue functioning. the power-down mode saves the ram con-tents but freezes the oscillator, disabling all other chip functions until the next external nterrupt or hardware reset. 30 附录 3 电路原理图 湖南人文科技学院毕业设计 31 附录 4 软件程序 描述:lcd1602 显示,sht11 采集温湿度,湿度超过限值,启动加湿功能。 引用端口:p0,p2 控制 1602 液晶屏,p1.5 模拟时钟线,p1.6 模拟数据线.。 湖南人文科技学院毕业设计 1 #include #include #include #include #include #define uchar unsigned char #define uint unsigned int typedef unsigned char byte; typedef unsigned int word; typedef bit bool; int th,tl;float hh,hl;/温湿度上 下限(全局变量) sbit buzzer=p24; /1602 相关控制信号及变量 sbit rs=p20; sbit rw=p21; sbit ep=p22; byte dis116; byte dis216; byte dis316; / /eeprom24c01 相关控制信号及变量 / sbit data=p16; sbit sck =p15; /p1.5 模拟时钟线;p1.6 模拟数据线 sbit wp =p14; / /按键相关控制信号及变量 / sbit k1 =p10;/
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 高中生物期末复习提纲课件
- 2025年专业足浴场所员工培训与发展规划及成果评定协议
- 2025医疗设备租赁与深度定制化售后技术支持合同样本
- 2025年城市中小学短期学科教师聘任合同书
- 2025年智慧校园安防监控系统设备供应及施工安装合同
- 2025年油气田区块收购与矿权质押融资服务合同
- 2025年重型货车抵押借款债权回购服务合同
- 2025年新能源汽车抵押个人消费贷款合同范本
- 2025年北京高端住宅物业管理服务合同
- 2025年大型会展活动餐饮服务及食品安全监督合同
- 初中地理学科课程规划方案
- 皖2015s209 混凝土砌块式排水检查井
- 食品安全责任保险课件
- CML慢性髓系白血病医学教学课件
- 塑胶模具类中英文对照专业术语
- 安全- 中国移动认证考试L1题库(附答案)
- 干部民主推荐表(样式)
- 【公开课】社区教案
- 平面磨床操作时注意事项
- GB/T 29651-2013锰矿石和锰精矿全铁含量的测定火焰原子吸收光谱法
- GB/T 13275-1991一般用途离心通风机技术条件
评论
0/150
提交评论