首页 一氧化碳报警器设计——软件设计

一氧化碳报警器设计——软件设计

举报
开通vip

一氧化碳报警器设计——软件设计一氧化碳报警器设计——软件设计 东南大学成贤学院毕业设计报告(论文) 诚 信 承 诺 本人承诺所呈交的毕业设计报告(论文)及取得的成果是在导师指导下完成,引用他人成果的部分均已列出参考文献。如论文涉及任何知识产权纠纷,本人将承担一切责任。 学生签名: 日 期: urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban...

一氧化碳报警器设计——软件设计
一氧化碳报警器 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 ——软件设计 东南大学成贤学院毕业设计报告(论文) 诚 信 承 诺 本人承诺所呈交的毕业设计报告(论文)及取得的成果是在导师指导下完成,引用他人成果的部分均已列出参考文献。如论文涉及任何知识产权纠纷,本人将承担一切责任。 学生签名: 日 期: urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 摘要 随着社会的进步和人们生活水平的提高,煤气或天然气已经成为多数家庭的燃料,由于煤气泄露和使用天然气不当而引起的火灾给人们的生命财产安全带来了极大的隐患。防止煤气中毒与爆炸已成为人们的迫切需要,为此,我们设计了一种一氧化碳报警器。 鉴于单片机AT89S52具有高集成度等优点,我们设计了一种基于AT89S52的一氧化碳报警器。该报警器对一氧化碳(CO)进行实时控制,当一氧化碳的浓度超过允许值时进行报警。为了提高系统的灵敏度和准确性,系统采用了一种十分稳定的传感器MQ-7。该传感器将置于测试环境中待测气体的浓度转换为模拟电压,再由模/数转换器ADC0809将模拟电压转换为数字信号,然后送入单片机AT89S52中进行处理。本设计正是实现ADC0809与AT89S52单片机的有机结合。此外还结合存储器AT24C02、液晶显示器LCD1602分别对检测数据进行存储和显示。 关键词:一氧化碳;单片机;报警器;传感器;模数转换器;存储器;液晶显示器 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 Abstract With the social progress and the improvement of people's living standards, gas or natural gas has become the fuel of most families, the fire caused due to the gas leaking and the improper use of natural gas has brought great risks to people's lives and property. To prevent gas poisoning and explosions have become the urgent needs of the people, for which we developed a carbon monoxide alarm. In view of the MCU AT89S52 has the advantages of high integration, we develop and design a carbon monoxide alarm based on it. The alarm does a real-time control on carbon monoxide (CO), and alarms when the carbon monoxide concentration exceeds the allowable value. In order to improve the sensitivity and accuracy of the system, the system uses a very stable sensor MQ-7. The sensor will convert the concentrations of the gas, which is in the test environment, to analog voltage. And afterwards the analog voltage will be converted to a digital signal through the Analog to Digital Converter ADC0809, and then processed in the microcontroller AT89S52. This design is just to achieve the organic combination of the ADC0809 and AT89S52 microcontroller. In addition, the design also combines the memory AT24C02, LCD monitor LCD1602 to respectively storage and display the detection data. Key words:Carbon monoxide; MCU; Alarm; Sensor; Analog to Digital Converter;Memory; LCD monitor urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spaI tial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 目录 工贸企业有限空间作业目录特种设备作业人员作业种类与目录特种设备作业人员目录1类医疗器械目录高值医用耗材参考目录 摘要 ............................................................................................................................................. Abstract ....................................................................................................................................... I 第一章 绪论............................................................................................................................... 0 1.1 课题背景和意义 ............................................................................................................ 0 1.2 应用前景....................................................................................................................... 0 1.3 一氧化碳报警器的概述.................................................................................................. 1 4 本次课题设计的目的 ..................................................................................................... 1 1. 1.5 本次设计的主要任务 ..................................................................................................... 1 第二章 器件介绍........................................................................................................................ 2 2.1 AT89S52单片机介绍 ...................................................................................................... 2 2.1.1 主要性能 ............................................................................................................. 2 2.1.2 与其它单片机相比的优缺点 ................................................................................. 3 2.1.3 端口功能 ............................................................................................................. 3 2.2 一氧化碳传感器介绍 ..................................................................................................... 4 2.2.1 传感器的定义和作用............................................................................................ 4 2.2.2 传感器的分类 ...................................................................................................... 5 2.2.3 传感器的发展趋势 ............................................................................................... 5 2.2.4 一氧化碳气体传感器MQ,7介绍 ........................................................................ 6 2.3 模数转换器ADC0809介绍 ............................................................................................ 7 2.3.1 内部结构 ............................................................................................................. 7 2.3.2 引脚功能 ............................................................................................................. 8 2.3.3 工作过程 ............................................................................................................. 9 2.3.4 特性参数 ............................................................................................................. 9 2.3.5 ADC0809转换结束信号的处理 ............................................................................. 9 2.4 存储器AT24C02 介绍..................................................................................................10 2.4.1 引脚功能 ............................................................................................................10 2.4.2 AT24C02的读写时序 ........................................................................................... 11 22.4.3 IC 接口介绍.......................................................................................................12 2.5 字符液晶显示器LCD1602的介绍 .................................................................................13 2.5.1 LCD1602的功能及引脚说明 ................................................................................13 2.5.2 LCD1602的指令说明及时序 ................................................................................14 2.6 带汉字库的液晶显示器LCD12864的介绍.....................................................................16 2.7 LED数码管介绍 ...........................................................................................................18 2.8 8155扩展并口介绍........................................................................................................19 2.8.1 功能说明 ............................................................................................................19 2.8.2 8155的结构及引脚 ..............................................................................................19 2.8.3 8155的使用.........................................................................................................22 第三章 硬件连接原理图 ............................................................................................................24 3.1 8155接口电路...............................................................................................................24 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 3.2 ADC0809接口电路........................................................................................................24 3.3 主控模块与复位电路及晶振接口电路............................................................................25 3.4存储器AT24C02接口电路 ............................................................................................26 3.5 一氧化碳传感器与模/数转换器接口电路 .......................................................................27 3.6 报警模块接口电路........................................................................................................27 3.7 键盘接口电路...............................................................................................................27 3.8 LCD1602接口电路........................................................................................................29 第四章 方案 气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载 设计.......................................................................................................................30 4.1 设计要求......................................................................................................................30 4.2 系统组成......................................................................................................................30 第五章 软件设计.......................................................................................................................31 5.1 主程序流程图...............................................................................................................31 5.2 ADC0809程序流程图 ....................................................................................................32 5.3 存储器AT24C02程序流程图 ........................................................................................32 5.4 LCD1602液晶显示器程序流程图...................................................................................33 5.5 键盘程序流程图 ...........................................................................................................34 第六章 调试..............................................................................................................................37 6.1 系统调试过程...............................................................................................................37 6.1.1 硬件调试 ............................................................................................................37 6.1.2 软件调试 ............................................................................................................37 6.2 Keil 的使用 ..................................................................................................................37 6.2.1 概述 ...................................................................................................................37 6.2.2 使用方法 ............................................................................................................37 6.3 Proteus 的使用 ..............................................................................................................39 6.3.1 概述 ...................................................................................................................39 6.3.2 PROTEUS使用方法简介......................................................................................39 总结 ..........................................................................................................................................41 致谢 ..........................................................................................................................................42 附录 ..........................................................................................................................................43 参考文献 ...................................................................................................................................51 III urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 第一章 绪论 1.1 课题背景和意义 随着国家经济水平的不断的提高,现代化、智能化的多功能建筑越来越多,对建筑的防火安全设计要求也越来越高。近年来,全国燃气行业发展迅猛,液化气、天然气、煤制气等城市燃气作为清洁能源已在工商业和城镇居民用户中得到广泛应用,特别是随着“西气东输”工程的快速进展,燃气行业发展潜力巨大。以“西气东输工程”为开端的大规模天然气利用工程的实施,意味我国城市燃气将大踏步的进入“天然气时代”。我国天然气市场将迎来一个千载难逢的机会,城市燃气需求的主要增长点将体现在天然气上。2000年党中央国务院提出“西部大开发”的重大战略部署,特别是2002年“西气东输”第一期工程正式开工,这无疑为发展西部地区的燃气产业带来了历史性的机遇。西气东输工程,在西部优势资源和东部广阔市场之间建立起了一座“金桥”,西气东输工程投入使用后,每年供应长江三角洲地区100亿立方米天然气。城市燃气的普及与应用无疑对改善城市的环境质量和提高居民的生活质量发挥了巨大的作用。 但是随着燃气的广泛使用,由于燃气泄漏所引发的爆炸、中毒和火灾等事故也时有发生,这在某种程度上增加了城市的不安全和不稳定因素。一氧化碳(CO)为无色、无味、无刺激性气体,比重0.967,几乎不溶于水,不易被活性炭吸附。当碳物质燃烧不完全时,可产生CO,如人体短时间内吸收较高浓度的C0,或浓度虽低,但吸时间较长,均可造成急性中毒。CO与血红蛋白结合能力超过氧和血红蛋白的结合能力的200-300倍,当CO与血红蛋白结合形成的碳氧血红蛋白含量达到5%时,就会对人体产生慢性损害,达到60%时就会昏迷,达到90%就会死亡。在不同浓度下,人体吸入一氧化碳时间和中毒症状如下表1-1所示: 表1-1 不同浓度下一氧化碳中毒 CO空气中的含量 吸入时间和中毒显示症状 成年人置身其中所允许的最大含量 50ppm (2~3h)后有轻微头痛、头晕、恶性 200 ppm 2h后前额痛、3h后有生命危险 400 ppm 45min头痛、恶性,2~3h内死亡 800 ppm 20min头痛、恶性,1h内死亡 1600 ppm 为了使燃气更好地造福于民,造福于社会 ,减少并杜绝各种因燃气泄漏而引发的爆炸及火灾事故,各燃气使用单位及居民用户选择一种适合的燃气报警器实为必要之举。 1.2 应用前景 日本早在1980年1月开始实施安装城市煤气、液化石油气报警器的法规。1986年5月日本通产省又实施了安全器具普及基本方针。美国目前已有7个州11个城市通过立法,规定家庭、公寓等都要安装一氧化碳报警器。 随着城市燃气化的扩大,我国已有北京市、辽宁省、黑龙江省、山西省、哈尔滨市、青岛市、等相继发布燃气安全管理文件,做到政府立法和百姓自身提高安全保护意识有机结合。为了保障更广大人民群众的生命财产安全,一氧化碳报警器在更大范围内被使用是大势所趋。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 1.3 一氧化碳报警器的概述 首先我们应该对国家标准规定的燃气报警器的种类有所了解。燃气报警器分为可燃气体泄漏仪(简称“检漏仪”),可燃气体报警控制器(简称“控制器”)、可燃气体探测器(简称“探测器”)、家用可燃气体报警器(简称“报警器”)四大系列产品。报警器为居民家庭用的燃气报警器,一般安装在厨房,遇燃气泄漏时,报警器报警,以提醒居民。 燃气报警器的核心是气敏传感器,俗称“电子鼻”。当气敏传感器遇到燃气时,传感器电阻随燃气浓度的变化而变化,随之产生电信号,供燃气报警器处理。处理后变成浓度成比例变化的电压信号,由线性电路加以补偿,使信号线性化,再经微机处理、逻辑分析,输出各种控制信号,当燃气浓度达到报警设定值时,燃气报警器发出报警信号。 1.4 本次课题设计的目的 本次设计的目的是设计出性能可靠,经济实惠的一氧化碳报警器。 目前,现有一氧化碳检测仪器主要是面对工矿企业或者公共场所的检测,价格高昂,对家庭不适用。因此,本次设计所面对的是广大居民,其优点在于: (1)成本低廉并能对一氧化碳准确报警。 (2)无需专业人员操作,只要放在合适位置,通电即可,连续使用、方便简捷。 (3)能起到预防一氧化碳中毒事件的发生。该产品能够有效预防广大农村居民冬季燃煤取暖时一氧化碳中毒事件的发生,同时也能够给城镇居民安全使用天然气提供有力的保障。 1.5 本次设计的主要任务 本次设计利用单片机电路制作一氧化碳报警器,且侧重于软件设计。因此设计过程中最关键的部分就是“软件的设计”。这也是在设计过程中需要解决的最关键的问题。 软件设计主要由“键盘控制程序”、“ADC0809信号转换程序”、“AT24C02存储器存储程序”、“LCD液晶显示器显示程序”四个部分组成。首先,键盘是人机交互最基本的途径。键盘模块设计的好坏,直接关系到系统的可靠性和稳定性。其次,传感器检测到的数据是模拟信号,而单片机只能处理数字信号,因此需要模数转换器ADC0809进行信号转换,然后将转换得到的数据输出给单片机,由单片机进行数据处理,当浓度超过给定值时,控制报警器报警。此外传感器模块检测得到的数据还需要用存储器储存起来,以供需要时参考使用,也就是还需要用显示器把这些数据显示出来。 1 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 第二章 器件介绍 2.1 AT89S52单片机介绍 AT89S52单片机是MCS-51系列产品的升级版,由世界著名半导体公司ATMEL在购买MCS-51设计机构后,利用自身优势技术——(掉电不丢数据)闪存生产技术对旧技术进行改进和扩展,同时使用新的半导体生产工艺,最终得到的成型产品。根据不同场合的要求,这款单片机提供了多种封装,本次设计根据最小系统有需要更换单片机的具体情况,使用双列直插DIP—40封装,如下图2-1所示: PDIP (T2)P1.0 1 40 VCC (T2EX)P1.1 39 P0.0(AD0) 2 P1.2 38 P0.1(AD1) 3 P1.3 37 P0.2(AD2) 4 P1.4 P0.3(AD3) 5 36 (MOSI)P1.5 P0.4(AD4) 6 35 (MISO)P1.6 P0.5(AD5) 34 7 (SCK)P1.7 33 P0.6(AD6) 8 RST 32 P0.7(AD7) 9 (RXD)P3.0 31 /VPP EA 10 PROGALE/(TXD)P3.1 30 11 29 PSEN 12 28 )P3.3 P2.7(A15) (INT1 13 27 (T0)P3.4 14 P2.6(A14) P2.5(A13) (T1)P3.5 26 15 16 25 P2.4(A12) 17 ()P3.7 P2.3(A11) RD24 18 XTAL2 P2.2(A10) 23 19 XTAL1 P2.1(A9) 22 GND P2.0(A8) 21 20 图2-1 AT89S52引脚图 DIP封装 2.1.1 主要性能 它是一款低功耗、高性能CMOS 8位微控制器,片内集成256字节程序运行空间、具有8K在系统可编程Flash 存储器、1000次擦写周期、支持最大64K外部存储扩展,与工业80C51 产品指令和引脚完全兼容。根据不同的运行速度和功耗的要求,时钟频率可以设置在0,33MHZ之间。片内资源有4组I/O控制端口、3个16位定时器/计数器、8个中断源、双全工UART串行通道、软件设置低功耗空间、断电保护(掉电模式具有掉电标识符、掉电后可唤醒)、看门狗定时器和双数据指针。可以在4V, urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 5.5V宽电压范围内正常工作。不断发展的半导体工艺也让该单片机支持计算机并口下载,简单的数字芯片就可以制成下载线。片上Flash允许程序存储器在系统可编程,亦适于常规编程器。在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得AT89S52在众多嵌入式控制应用系统中得到广泛应用。 2.1.2 与其它单片机相比的优缺点 (1)优点: ? 功能比标准51强那么一点点,多128字节RAM、多一个定时器、多512字节EEPROM、内置8KROM 足够容纳一般程序; ? 容易买到; ? 资料众多,编程与51兼容,最适合学生或者初学者使用; ? 支持ISP下载,使用很方便; ? FLASHROM可下载10000次以上; ? 可靠性不错 (2)缺点: ? 性能低,现在新型51单片机比AT89S52强的不是一两个,N多。 ? 性价比不高,这样的功能,6-8块的价格不算便宜,STC单片机功能一样,价格只有它的一半; ? 封装是DIP40,太大了,不利于工业生产。 2.1.3 端口功能 P0口:P0口是一个8位漏极开路的双向I/O口。作为输出口,每位能驱动8个TTL逻辑电平。对P0端口写“1”时,引脚用作高阻抗输入。 当访问外部程序和数据存储器时,P0口也被作为低8位地址/数据复用。在这种模式下,P0不具有内部上拉电阻。在FLASH编程时,P0口也用来接收指令字节。在程序校验时,输出指令字节。程序校验时,需要外部上拉电阻。 P1口:P1口是一个具有内部上拉电阻的8 位双向I/O 口,P1输出缓冲器能驱动4个TTL 逻辑电平。对P1端口写“1”时,内部上拉电阻把端口拉高,此时可以作为输入口使用。作为输入使用时,被外部拉低的引脚由于内部电阻的原因,将输出电流(IIL)。 此外,P1.0和P1.1分别作定时器/计数器2的外部计数输入(P1.0/T2)和定时器/计数器2 的触发输入(P1.1/T2EX)。在FLASH编程和校验时,P1口接收低8位地址字节。 P1端口引脚第二功能: P1.0 T2(定时器/计数器T2的外部计数输入),时钟输出 P1.1 T2EX(定时器/计数器T2的捕捉/重载触发信号和方向控制) P1.5 MOSI(在系统编程用) P1.6 MISO(在系统编程用) P1.7 SCK(在系统编程用) P2口:P2口是一个具有内部上拉电阻的8 位双向I/O 口,P2输出缓冲器能驱动4个TTL逻辑电平。对P2端口写“1”时,内部上拉电阻把端口拉高,此时可以作为输入口使用。作为输入使用时,被外部拉低的引脚由于内部电阻的原因,将输出电流(IIL)。在访问外部程序存储器或用16位地址读取外部数据存储器(例如执行MOVX @DPTR) 时,P2 口送出高八位地址。在这种应用中,P2口使用很强的内部上拉发送1。在使用8位地址(如MOVX @RI)访问外部数据存储器时,P2口输出P2锁存器的内容。在flash编程和校验时,P2口也接收高8位地址字节和一些控制信号。 3 P3口:P3口是一个具有内部上拉电阻的8位双向I/O 口,P3输出缓冲器能驱动4个TTL逻辑电平。对P3端口写“1”时,内部上拉电阻把端口拉高,此时可以作为输入口使用。作为输入使用时,被外部拉低的引脚由于内部电阻的原因,将输出电流(IIL)。 P3口亦作为AT89S52特殊功能(第二功能)使用,如下表所示。在FLASH编程和校验时,P3口也接收一些控制信号。 P3端口引脚第二功能: P3.0 RXD(串行输入口) P3.1 TXD(串行输出口) P3.2 INT0(外中断0) P3.3 INT1(外中断1) P3.4 TO(定时/计数器0) P3.5 T1(定时/计数器1) P3.6 WR(外部数据存储器写选通) P3.7 RD(外部数据存储器读选通) 此外,P3口还接收一些用于FLASH闪存编程和程序校验的控制信号。 RST:复位输入。当振荡器工作时,RST引脚出现两个机器周期以上高电平将是单片机复位。 ALE/PROG:当访问外部程序存储器或数据存储器时,ALE(地址锁存允许)输出脉冲用于锁存地址的低8位字节。一般情况下,ALE仍以时钟振荡频率的1/6输出固定的脉冲信号,因此它可对外输出时钟或用于定时目的。要注意的是:每当访问外部数据存储器时将跳过一个ALE脉冲。对FLASH存储器编程期间,该引脚还用于输入编程脉冲(PROG)。如有必要,可通过对特殊功能寄存器(SFR)区中的8EH单元的D0位置位,可禁止ALE操作。该位置位后,只有一条MOVX和MOVC指令才能将ALE激活。此外,该引脚会被微弱拉高,单片机执行外部程序时,应设置ALE禁止位无效。 PSEN:程序储存允许(PSEN)输出是外部程序存储器的读选通信号,当AT89S52由外部程序存储器取指令(或数据)时,每个机器周期两次PSEN有效,即输出两个脉冲,在此期间,当访问外部数据存储器,将跳过两次PSEN信号。 EA/VPP:外部访问允许,欲使CPU仅访问外部程序存储器(地址为0000H-FFFFH),EA端必须保持低电平(接地)。需注意的是:如果加密位LB1被编程,复位时内部会锁存EA端状态。如EA端为高电平(接Vcc端),CPU则执行内部程序存储器的指令。FLASH存储器编程时,该引脚加上+12V的编程允许电源Vpp,当然这必须是该器件是使用12V编程电压Vpp。 XTAL1:振荡器反相放大器和内部时钟发生电路的输入端。 XTAL2:振荡器反相放大器的输出端。 2.2 一氧化碳传感器介绍 当今时代是高新技术迅速发展的信息时代。在这个时代里,获取准确可靠的信息成为做好一切工作的前提。要获取信息则离不开传感器。传感器在最近20多年获得了长足的发展。它在与国民经济相关的各个领域中的应用日益广泛,是信息采集和信息转换的重要部件,是测量和控制系统的首要环节,测试计量和工业自动化、智能化的关键技术。在世界范围内,一个国家的一项工程设计中所用传感器的数量和水平直接标志着这个国家科学技术的先进程度,因此世界各国自20世纪80年代开始都将其列为重点发展的关键技术,其也逐渐成为信息时代的焦点。 2.2.1 传感器的定义和作用 人用五官感受外界信息,将所得到的信息送入大脑并进行思维和判断,然后大脑命令四肢完成某种 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 动作。表观上传感器能够代替人的五官完成感受外界信息的功能,成为传送感觉的一种器件。 然而“五官”感受的外界信息范围很窄,只是对人体无害的信息。但还有很多无法或难以感知的被测量,如紫外光、红外光、电磁场、无味无嗅的气体及特高温、剧毒物和各种微弱信号等,而这些信息传感器都可以感知。因为电信号具有高精度、高灵敏度,可测量控制的范围宽,便于传递、放大及反馈并连续可测、可遥测、可存储等很多优点,所以人们希望传感器还能将感知的信号放大、传输、存储及显示输出。于是,更广义地可以把传感受器归纳为一种能感受外界信息(力、热、声、光、磁、气体、湿度等等),并按一定的规律将其转换成易处理的电信号的装置。 若被测量是电量,可直接与各种智能仪器(计算机和机器人)连接,并进行信号处理。若被测量是非电量,如物理量(力学量、湿度、流量、物位、光学量和温度),化学量(成份、酸碱度和反应速度),生物量(血压、人体反应)等,则必须通过相应的传感器将它们转换成电量,再送入计算机进行处理。也就是说,能把被测物理量或化学量转换为与之有确定对应关系的电量输出的装置,就称之为传感受器,它通常由敏感元件和转换元件组成。其中,敏感元件是指传感器中能直接感受或响应被测量的部分;转换元件是指传感器中能将敏感元件感受或响应的被测量转换成适于传输或测量的电信号部分。随着电子集成技术的发展,测量处理电路也成为传感器的一部分,如下图 2-2所示。当传感器的输出为标准化信号(例如0V,5V,或4mA,20mA)时,则称为变送器。 传感器输出 被测量 敏感元件 转换元件 测量电路 辅助电源 图2-2 传感器的组成 传感器的作用就是测量。没有传感器就不能实现测量;没有测量,也就没有科学技术。它主要表现在以下几个方面: (1)信息的收集。 (2)信息数据的转换。 (3)控制信息的采集。 2.2.2 传感器的分类 由于被测信号的各类很多,而且一种被测量可以用不同种类的传感器来测量,一种传感器也可以测量几种被测信号,所以传感器的种类繁多,目前尚没有统一的分类方法,但常用的分类方法归纳如下: 按工件机理分类,传感器分为物质型传感器和结构型传感器;按能源分类,传感器分为有源传感器和无源传感器;按被测量范畴分类,传感器分为物理量传感器、化学量传感器和生物量传感器;按工作原理分类,传感器又分为电阻式传感器、电压式传感器、电容式传感器等。 总之,为了使用的方便,不同的行业依据的分类方式不同,而且会随着传感器的发展而出现更新的种类。 2.2.3 传感器的发展趋势 随着时代的不断发展,科技的不断进步,传感器正努力向着以下几个趋势发展: (1)努力实现传感器的新特性; (2)确保传感器的可靠性,延长其使用寿命; (3)提高传感器集成化及功能化的程度; 5 (4)努力实现传感器的微型化; (5)努力实现新型功能的材料的研发; (6)努力发展仿生物传感器; (7)努力实现多传感器信息的融合。 2.2.4 一氧化碳气体传感器MQ,7介绍 MQ,7是本次设计所使用的传感器,它是一种半导体传感器。半导体传感器是典型的物质型传感器。这类传感器主要以半导体为敏感材料,在各种物理量的作用下引起半导体材料内载流子浓度或分布的变化,通过检测这些物理特性的变化即可反映被测量参数值。半导体传感器由于具有灵敏度高、响应快、使用寿命长、成本低等优点,特别是它可以由电阻值的变化直接实现气—电转换,可实现气体的自动检测和远距离临检与报警,而且它便于集成化和智能化,因此,在传感器技术中,半导体传感器具有非常重要的地位,近年来受到普遍的重视,并得到了迅速的发展和广泛的使用。 更准确的说,MQ,7是一种半导体气敏传感器。半导体气敏传感器主要使用半导体气敏材料,利用其与气体接触时使半导体的导电率等物理性质发生变化来检测待测气体的成分和浓度。自从1962年半导体金属氧化物气敏传感器问世以来,由于其具有灵敏度高、响应时间和恢复时间快、使用寿命长、价格低等优点,得到了广泛的应用,目前已成为世界上产量最大、使用最广的传感器之一。按照使用的基本材料,半导体气敏传感器可分为SnO系列、ZnO系列、FeO系列等。 223 MQ,7所使用的气敏材料是在清洁空气中电导率较低的二氧化锡(SnO)。采用高低温循环检测方2 。低温(1.5V加热)检测一氧化碳时,传感器的电导率随空气中一氧化碳气体浓度增加而增大,高式 温(5.0V加热)清洗低温时吸附的杂散气体。使用简单的电路即可将电导率的变化,转换为与该气体浓度相对应的输出信号。MQ-7气体传感器对一氧化碳的灵敏度高,这种传感器可检测多种含一氧化碳的气体,是一款适合多种应用的低成本传感器。 1、MQ,7的应用及特点 MQ,7主要用于家庭、商业、工业环境的一氧化碳、煤气探测装置。它的特点主要有以下几个方面: (1)对一氧化碳的高灵敏度; (2)优异的稳定性; (3)长寿命; (4)大的电信号输出; (5)优异的选择性。 2、MQ,7的基本规格 MQ,7的规格如下表2-1所示: 表2-1 MQ,7的规格 适用气体 一氧化碳CO 探测范围 10,1000ppm 特征气体 100ppm一氧化碳 灵敏度 R in air/R in typical gas?5 敏感体电阻 1KΩ,20KΩ in 100ppm CO 响应时间 ?150s(70% Response) 恢复时间 ?150s(70% Response) 加热电阻 31Ω?3Ω 加热电流 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 加热电压 5.0V?0.2V/1.5V?0.1V 加热功率 约350mW 测量电压 ?24V 环境温度:-20?,+55? 工作条件 湿度:?95%RH 环境含氧量:21% 温度: -20?,+70? 贮存条件 湿度:?70%RH 3、MQ,7的基本测试回路 MQ,7的基本测试回路如下图2-3所示: 1 VCC 4 1 A B 6 3 A B R22 RES1 2 5 VCC 图2-3 基本测试回路 4、MQ,7的工作原理 因为一氧化碳传感器MQ-7内部有电阻丝,所以在工作前要预热2分钟。MQ-7的工作过程是:当MQ-7 检测腔内,空气有敏感气体或烟雾时,A、B电极的电阻就会下降,然后负载电阻分压得到输出电压,然后把输出电压送给比较器反相输入端。比较器的同相输入端为比较参考电压,调制PR1电位器就可以调制比较基准,即传感器灵敏度。 2.3 模数转换器ADC0809介绍 2.3.1 内部结构 ADC0809是一种8路模拟输入8位数字输出的逐次逼近式A/D转换器。目前在8位单片机系统中有着广泛的使用。其内部结构如下图2-4所示。 由图可知,ADC0809主要包括:一个8路模拟开关、一个3位地址锁存和译码器、一个A/D转换器和一个三态输出锁存缓冲器。 (1)8路模拟开关:可对8路0,5V的输入模拟电压信号分时进行转换。 (2)3位地址锁存和译码器:当地址锁存允许信号ALE有效时,将3位地址ADDC,ADDA锁入地址锁存器中,经译码器选择8路模拟量IN0,IN7中的一路通过8位A/D转换器转换输出。 (3)A/D转换器:实现A/D转换功能。 (4)三态输出锁存缓冲器:对变换数据进行锁存,因内部有缓冲器,故可以直接与CPU系统总线相连接。 7 START CLK 接口控制逻辑 EOC IN0 IN1 8路 Vin + 三态模拟逐次变换 … - 输出 D0 开关 寄存器 …锁在 IN7 缓冲D7 ADDA 器 地址锁A/D变换器 ADDB ADDC 存译码 ALE OE 图2-4 ADC0809内部结构图 2.3.2 引脚功能 如下图2-5所示,ADC0809芯片是CMOS型单片双列直插式模/数转换器件,具有28个引脚。ADC0809可用单5V电源工作,模拟信号输入范围为0,5V,输出与TTL兼容。各引脚功能如下。 IN0-IN7:模拟量输入通道。ADC0809对输入模拟量的要求主要有:信号单极性,电压范围0,5V,若信号过小还需进行放大。另外,在A/D转换过程中,模拟量输入的值不应变化太快,因此,对变化速度快的模拟量,在输入前应增加采样保持电路。 ADDA、ADDB、ADDC:地址线。ADDA为低位地址,ADDC为高位地址,用于对模拟通道进行选择。如下表2-2所示。 表2-2 地址信号与选中通道的关系 地 址 选中通道 ADDC ADDB ADDA 0 0 0 IN0 0 0 1 IN1 0 1 0 IN2 0 1 1 IN3 1 0 0 IN4 1 0 1 IN5 1 1 0 IN6 1 1 1 IN7 ALE:地址锁存允许信号。在对应ALE上跳沿,ADDA、ADDB、ADDC地址状态送入地址锁存器中。 START:转换启动信号。START上跳沿时,所有内部寄存器清0;START下跳沿时,开始进行A/D转换;在A/D转换期间,START应保持低电平。 D0,D7:数据输出线。其为三态缓冲输出形式,可以和计算机的数据线直接相连。 OE:输出允许信号。其用于控制三态输出锁存器向单片机输出转换得到的数据。OE=0,输出数据线呈高电阻;OE=1,输出转换得到的数据。初始化时START和OE要全为低电平。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 EOC:是否转换完毕我们根据EOC信号来判断。EOC=0,正在进行转换;EOC=1,转换结束。当 EOC为1时,这时给OE为1,转换的数据就输出给单片机了。 (REF):参考电源。参考电压用来与输入的模拟信号进行比较,作为逐次逼近的基准,其典型VREF 值为+5V(V(+)=+5V,V (-)=0V)。 REFREF 26 21 D0 IN0 20 D1 27 19 IN1 D2 18 D3 28 8 IN2 D4 15 D5 1 14 IN3 D6 17 D7 2 IN4 7 EOC 3 25 IN5 ADDA 24 ADDB 4 IN6 23 ADDC 5 22 IN7 ALE 9 OE 16 V(-) REF 6 START 12 10 (+) CLOCK VREF 图2-5 ADC0809引脚图 2.3.3 工作过程 CPU送地址ADDC,ADDA、ALE,外设送模拟IN,IN选通IN接到V,接着START、CLK启07iin动转换,转换结束后,送出EOC信号,CPU中断/查询获取EOC后,送出OE打开三态门,CPU从三 态门输出口上读取D0,D7,重复下一通道。 对输入V,理想转换码: in VV,,()inREF (2-1) N,,256VV()(),,,REFREF 2.3.4 特性参数 (1)分辨率为8位。 (2)最大不可调误差上1LSB。 , (3)单电源+5V。 (4)可锁存三态输出,输出与TTL电平兼容。 (5)当用+5V电源供电时,模拟输入电压范围为0,5V。 00,40,85(6)温度范围C,C。 (7)功耗为15mW。 (8)转换速度取决于芯片的时钟频率,其时钟频率范围为10kHz,1280kHz,若CLK=500kHz, 转换速度为128us。 2.3.5 ADC0809转换结束信号的处理 不同的处理方式对应的程序设计方法不同,有以下四种处理方法。 (1)查询方式:把结束信号作为状态信号。 9 (2)中断方式:把结束信号作为中断请求信号。 (3)延时方式:不使用转换结束信号。 (4)DMA方式:把结束信号作为DMA请求信号。 2.4 存储器AT24C02 介绍 以单片机为核心的应用系统经常要处理大量的数据,而单片机本身的数据存储空间是有限的,所以存储器模块在单片机系统中是一个经常被用到的模块。 AT24Cxx系列芯片是Atmel公司生产的EEPROM存储器件,采用IIC总线技术,主要应用在存储一些掉电后还要保存数据的场合。在上次运行时保存的数据,掉电后在下一次上电时还能够调出。目前广泛使用的接触式IC卡、密码锁等都使用到了该系列芯片。 AT24C02是2K位的串行EEPROM器件,采且低功耗CMOS技术,内部含有256个8位字节,每页8字节的页写存储单元。该器件通过IIC总线接口进行操作,具有专门的写保护功能,可以擦除100万次,写入数据可以保存100年。其引脚如下图5-1所示。A2、A1、A0为地址输入端,SDA为串行数据输入/输出端,SCL为串行时钟输入端,WP为写保护控制端(WP=1时写保护有效,此时器件被设置为只读),VCC接+1.8V~6.0V工作电压,VSS接地。 1 A0 8 VCC A1 2 7 WP AT24C02 A2 6 3 SCL GND 5 4 SDA 图2-6 AT24C02的引脚图 2.4.1 引脚功能 AT24C02支持IIC总线数据传送 协议 离婚协议模板下载合伙人协议 下载渠道分销协议免费下载敬业协议下载授课协议下载 ,总线协议规定任何将数据传送到总线的器件作为发送器,任何从总线接收数据的器件为接收器。数据传送是由产生串行时钟和所有起始停止信号的主器件控制的。主器件和从器件都可以作为发送器或接收器,但由主器件控制传送数据(发送或接收)的模式,通过器件地址输入端A0、A1和A2可以实现将最多8个AT24C02器件连接到总线上。如果只有一个AT24C02被总线寻址,三个地址输入引脚A0、A1、A2可悬空或连接到GND。 SCL 串行时钟:AT24C02串行时钟输入管脚用于产生器件所有数据发送或接收的时钟,这是一个输入管脚。 SDA 串行数据/地址:AT24C02 双向串行数据/地址管脚用于器件所有数据的发送或接收,SDA 是一个开漏输出管脚,可与其它开漏输出或集电极开路输出进行线或(wire-OR)。 A0、A1、A2 器件地址输入端:这些输入脚用于多个器件级联时设置器件地址,当这些脚悬空时默认值为0。当使用AT24C02时最大可级联8个器件。如果只有一个AT24C02被总线寻址,这三个地址输入脚(A0、A1、A2 )可悬空或连接到Vss。 WP 写保护:如果WP管脚连接到Vcc,所有的内容都被写保护,只能读。当WP管脚连接到Vss 或悬空,允许器件进行正常的读/写操作 存储结构与寻址:AT24C02的存储容量为2KB,内容分成32页,每页8B,共256B,操作时有两种寻址方式:芯片寻址和片内子地址寻址。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 (1)芯片寻址:AT24C02的芯片地址为1010,其地址控制字格式为1010 A2 A1 A0 R/W。其中A2,A1,A0为可编程地址选择位。A2,A1,A0引脚接高、低电平后得到确定的三位编码,与1010形成7位编码,即为该器件的地址码。R/W为芯片读写控制位,该位为0,表示芯片进行写操作。 (2)片内子地址寻址:芯片寻址可对内部256B中的任一个进行读/写操作,其寻址范围为00~FF,共256个寻址单位。 2.4.2 AT24C02的读写时序 IIC总线上,主机送出的命令只能被其中的一个器件接收并执行,主机对挂接的多个IIC从器件AT24C02是通过发送一个8位控制字来识别的,控制字中含有所要寻址的从机地址以及读写操作标志,寻址控制字结构如下表2-2所示。 表2-2 AT24C02的寻址控制字结构 D7 D6 D5 D4 D3 D2 D1 D0 读/写 1 0 1 0 A2 A1 A0 高四位D7,D4是针对不同类型器件的特征码,对于串行EEPROM为1010;D3,D1由引脚A2、A1、A0确定;最低位D0为读写控制,D0=1为读操作,D0=0为写操作。 AT24C02的控制字由8位二进制数构成,在开始信号发出以后,主机便会发出控制字,以选择从机,并控制总线传送的方向。比如芯片AT24C02的地址AAA=010,进行读操作时发送的控制字应为210 1010 0101B(A5H),进行写操作时发送控制字应为1010 0100B(A4H)。若总线上只有一个AT24C02,则一般将A2、A1、A0均接地,故读控制字为1010 0001B(A1H),写控制字为1010 0000B(A0H)。 (1)对AT24C02写操作 对AT24C02执行写操作分为字节写和页写两种方式。因为本次我们只用字节写,故此处只介绍字节写方式。 字节写就是一次写入一个字节数据。在字节写模式下,主器件发送起始命令和从器件地址信息给从器件;在从器件产生应答信号后,主器件发送要写入AT24C02的存储单元地址;主器件在收到从器件的另一个应答信号后,再发送数据到被寻址的存储单元;AT24C02再次应答并在主器件产生停止信号 -7所示。 后开始内部数据的擦写,在内部擦写过程中不再应答主器件的任何请求。字节写时序如下图2 W S R T S I A T T R O SLAVE BYTE E T ADDRESS DATA P ADDRESS SDA A A A C C C K K K 图2-7 字节写时序 (2)对AT24C02执行读操作有三种不同的方式,分别是读当前地址内容、读指定地址中的内容、读连续地址中的内容。同样,由于需要我们只介绍第二种,即读指定地址中的内容。 11 主器件首先通过发送起始信号、写控制字和要读取的字节数据的地址执行一个伪写操作。在AT24C02应答之后,主器件重新发送起始信号和读控制字,AT24C02输出主器件所要读取的一个8位字节数据,主器件发送非应答信号并产生一个停止信号。其操作时序如下图2-8所示。 S S W R S T T R E T A A I A R O R T SLAVE SLAVE BYTE ADDRESS T P D ADDRESS E T DATA n ADDRESS n SDA A A A N C C C O K K K A C K 图2-8 读指定地址时序 22.4.3 IC 接口介绍 IIC总线是Inter Integrated Circuit Bus的缩写,即“内部集成电路总线”。该总线是Philips公司推出的芯片中高性能的双向二线制串行传输总线,以SDA(数据线)和SCL(时钟线)两根线实现全双工同步数据传送,具有连线少、工作性能可靠等优点。目前Philips公司和其他集成电路制造商推出了很多基于IIC总线的外围器件,广泛应用于IC卡、音视频和家电等领域。 1、IIC总线规则 采用IIC总线进行数据通信,必须严格遵循以下基本时序进行操作。下面对这些时序进行介绍。 (1)启动时序 在初始状态时,SCL和SDA两根线都必须为高电平。当SCL为高电平时,如果SDA发生了从高到低的跳变,则把它作为起始信号。如下图2-9所示: SDA SCL 起始条件 停止条件 图2-9 启动/结束IIC总线时序 (2)当SCL为高电平时,如果SDA发生了从低到高的跳变,则把它看作是停止信号。如上图5-4所示。除此之外,在发送数据的过程中当SCL 为高电平时,SDA应保持稳定。 (3)IIC总线数据传送时,每成功地传送一个字节数据后,接收器都必须产生一个ACK应答信号,应答的器件在第9个时钟周期时将SDA线拉低,表示其已收到一个8位数据(SDA=0时表示应答;SDA=1 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 时为非应答)。如下图2-10所示。整个数据传输过程中,在收到最后一个字节后,接收器必须产生非应 答,表示终止传输。 SCL 1 8 9 SDA ACK 应答 图2-10 应答时序 2.5 字符液晶显示器LCD1602的介绍 2.5.1 LCD1602的功能及引脚说明 字符型液晶显示器是一种专门用于显示字母、数字、符号等的点阵式LCD,目前常用16×1、16 ×2、20×2和40×2等模块。LCD1602属于16×2型,即实现2行、每行16个显示,分为带背光和不 带背光两种,带背光的比不带背光的厚。 LCD1602的主要技术参数如下表2-3所示。 表2-3 LCD1602主要技术参数 显示容量 16×2个字符 芯片工作电压 4.5V,5.5V 工作电流 2.0mA(5.0V) 模块最佳工作电压 5.0V 字符尺寸 2.95×4.35(W×H)mm LCD1602采且标准的14引脚(无背光)或16引脚(有背光)接口,各引脚说明见下表2-4。 表2-4 LCD1602引脚功能表 引脚号 引脚名称 引脚功能 电源地 1 VSS 电源正极 2 VDD 液晶显示偏压 3 V L 数据/指令选择 4 RS 读/写选择 5 R/W 使能信号 6 E 数据最低位 7 D0 数据 8 D1 数据 9 D2 数据 10 D3 数据 11 D4 数据 12 D5 数据 13 D6 数据最高位 14 D7 背光源正极 15 BLA 背光源负极 16 BLK 下面对需要与单片机接口的引脚的使用做详细说明。 13 第3脚:V为液晶显示器对比度调整端,接正电源时对比度最弱,接地时对比度最高。对比度过L k,高时会产生“鬼影”,使用时可以通过一个10的电位器调整对比度。 第4脚:RS为寄存器选择端,高电平时选择数据寄存器,低电平时选择指令寄存器。 第5脚:R/W读写信号线,高电平时进行读操作,低电平时进行写操作。当RS和R/W都为低电平时可以写入指令;当RS为高电平,R/W为低电平时,可以写入数据 ;当RS为低电平,R/W为高电平时,可以读忙信号。 第6脚:E端为使能端,当E端由高电平跳变成低电平时,液晶模块执行命令。 第7,14脚:D0,D7为8位双向数据线。 2.5.2 LCD1602的指令说明及时序 (1)LCD1602的控制指令 LCD1602液晶显示模块内部的控制器共有11条控制指令,见下表2-5。 表2-5 LCD1602指令表 序号 指令 RS R/W D7 D6 D5 D4 D3 D2 D1 D0 清显示 1 0 0 0 0 0 0 0 0 0 1 光标复位 2 0 0 0 0 0 0 0 0 1 * 显示模式设置 3 0 0 0 0 0 0 0 1 I/D S 显示开/关控制 4 0 0 0 0 0 0 1 D C B 光标或字符移位 5 0 0 0 0 0 1 S/C R/L * * 功能设置 6 0 0 0 0 1 DL N F * * CGRAM地址设置 CGRAM地址 7 0 0 0 1 DDRAM地址设置 DDRAM地址 8 0 0 1 读忙标志或AC地址 计数器AC值 9 0 1 BF 写数据 写入的数据内容 10 1 0 读数据 读出的数据内容 11 1 1 每条指令的详细说明如下。 指令1:清显示,指令码01H。功能为清屏,光标复位到液晶显示屏的左上角,将地址计数器AC置0。 指令2:光标复位,光标返回到地址00H。 指令3:光标和显示模式设置。I/D控制光标移动方向,I/D=1光标右移,I/D=0光标左移;S为屏幕上所有显示内容是否移动,S=1时移动,S=0时不移动。 指令4:显示开关控制,用于设置显示、光标及闪烁。D=1开显示,D=0关显示;C=1有光标,C=0无光标;B=1光标闪烁,B=0光标不闪烁。 指令5:光标或显示字符移位。S/C=1时整个画面移动一位,S/C=0时移动光标一位;R/L=1右移,R/L=0左移。 指令6:功能设置命令。DL=1时为8位总线,DL=0时为4位总线;N=0时单行显示,N=1时双行显示;F=0时显示5×7的点阵字符,F=1时显示5×10的点阵字符。 指令7:CGRAM地址设置。D5,D0范围00H,3FH。 指令8:DDRAM地址设置。对于LCD1602,双行显示时,首行D6,D0范围是00H,0FH,次行D6,D0范围是40H,4FH。 指令9:读忙信号标志BF和计数器AC值。BF=1表示忙,此时模块不能接收命令或者数据,BF=0表示不忙。 指令10:写数据。将字符码写入DDRAM,以使液晶显示屏显示出相对应的字符,将使用者自己 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 设计的图形存入CGRAM。 指令11:读数据。读取DDRAM或CGRAM中的内容。 按上述指令说明,得到的相关指令设置如下。 清屏:0000 0001(01H)——清DDRAM和AC值 归位:0000 0010(02H)——AC=0,光标、画面回HOME位 显示模式设置:0000 0100(04H)——数据读写操作画面不动,AC自动减1 0000 0101(05H)——数据读写操作画面平移,AC自动减1 0000 0110(06H)——数据读写操作画面不动,AC自动加1 0000 0111(07H)——数据读写操作画面平移,AC自动加1 显示开关控制:0000 1DCB——D—C—B(显示开关——光标开关——闪烁开关) 0000 1100(0CH)——开显示,关光标,关闪烁 0000 1101(0DH)——开显示,关光标,开闪烁 0000 1110(0EH)——开显示,开光标,关闪烁 0000 1111(0FH)——开显示,开光标,开闪烁 光标画面移位:0001 0000(10H)——光标右移一个字符 0001 0100(14H)——光标左移一个字符 0001 1000(18H)——画面右移一个字符 0001 1100(1CH)——画面左移一个字符 功能设置:001—DL—N—F— * * 0010 0000(20H)——4位数据接口,1行显示,5×7点阵字符 0011 1000(38H)——8位数据接口,2行显示,5×7点阵字符 (2)LCD1602的读写时序 对LCD1602的操作应严格遵守图2-11所示的读操作时序和图2-12所示的写操作时序,对读/写时 序的说明见表2-6。 RS R/W E 有效数据 DB0,DB7 图2-11 LCD1602的读操作时序 RS 15 R/W 图2-12 LCD1602的写操作时序 表2-6 读/写时序说明列表 功能 RS R/W E 高电平 读忙标志或地址AC 0 1 高电平 读数据 1 1 下降沿 写指令 0 0 下降沿 写数据 1 0 2.6 带汉字库的液晶显示器LCD12864的介绍 LCD12864汉字图形点阵液晶显示模块,可显示汉字及图形,内置8192个中文汉字(16×16点阵)、128个字符(8×16点阵)及64×256点阵显示RAM(GDRAM)。每屏可显示4行8列共32个16×16点阵人汉字,每个显示RAM可显示1个中文字符或2个16×8点阵全高ASCII码字符,即每屏最多可实现32个中文字符或64个ASCII码字符的显示。利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互界面,也可完成图形显示。 字符显示是通过将字符显示编码写入该字符显示RAM实现的。根据写入内容的不同,可分别在液晶屏上显示CGROM(中文字库)、HCGROM(ASCII码字库)及CGRAM(自定义字形)的内容。字符显示RAM在液晶模块中的地址为80H,9FH。字符显示的RAM的地址与32个字符显示区域有着一一对应的关系。其对应关系见下表2-7。 表2-7 LCD12864的显示RAM地址列表 1列 2列 3列 4列 5列 6列 7列 8列 1行 80H 81H 82H 83H 84H 85H 86H 87H 2行 90H 91H 92H 93H 94H 95H 96H 97H 3行 88H 89H 8AH 8BH 8CH 8DH 8EH 8FH 4行 98H 99H 9AH 9BH 9CH 9DH 9EH 9FH 单片机与LCD12864的数据传输有两种模式,一种是并行通信模式,另一种是串行通信模式,此处只介绍并行通信模式: (1)LCD12864的并行接口引脚定义及功能说明 LCD12864的并行接口引脚定义及功能说明见下表2-8。 表2-8 LCD12864的并行接口引脚及功能 引脚号 引脚名称 电平 功能说明 模块的电源地 1 VSS 0V 模块的电源端 2 VDD +5V — LCD驱动电压输入端,对比度(亮度调整) 3 VO urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 数据/指令选择端:RS=“H”,表示DB0,DB7为数据;RS=“L”,4 RS H/L 表示DB0,DB7为指令 读/写选择信号:H为读操作;L为写操作 5 R/W H/L 并行的使能信号(脉冲有效) 6 E H/L 7,14 DB0,DB7 数据位0,数据位7 H/L 并/串行接口选择:H—并行;L—串行 15 PSB H/L 空脚 16 NC 复位,低电平有效 17 /RST H/L 空脚 18 NC — 背光源正极 19 LED_A — 背光源负极 20 LED_K 注 H表示高电平,L表示低电平 (2)LCD12864的控制指令 LCD12864液晶模块控制芯片提供基本指令和扩充指令两套控制命令,此处只详细说明一下基本指令部分。见下表2-9。 表2-9 LCD12864基本指令集 指令码 功能说明 指令 RS RW D7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 将DDRAM填满“20H”,并且设定清屏 0 0 0 0 0 0 0 0 0 1 DDRAM的地址计数器(AC)到“00H” 设定DDRAM的地址计数器(AC)到地址归位 00H,并且将游标移到原点位置,这个指0 0 0 0 0 0 0 0 1 X 令并不改变DDRAM的内容 进入点设指定在资料的读取与写入时,设定游标0 0 0 0 0 0 0 1 I/D S 定 移动方向及指定显示的移位 D=1:整体显示ON; 显示状态C=1游标显示 0 0 0 0 0 0 1 D C B 开/关 B=1游标位置ON 游标、显设定游标的移动与显示的移位控制位示移位控0 0 0 0 0 1 S/C R/L X X 元;这个指令不改变DDRAM的内容 制 DL=0/1:4/8位数据 0 功能设定 RE=1:扩充指令集动作 0 0 0 0 1 DL X X X RE RE=0:基本指令集动作 设定 设定CGRAM地址到地址计数器(AC) CGRAM0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 地址 设定设定DDRAM地址到地址计数器(AC)DDRAM0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 设定DDRAM地址(起始显示位置) 地址 读取忙碌读取忙碌标志(BF)可以确认内部动作标志是否完成,同时可以读出地址计数器0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0 (BF)和(AC)的值 地址 将D7,D0写入到内部的RAM写资料到1 0 D7 D6 D5 D4 D3 D2 D1 D0 (DDRAM/CGRAM/IRAM/GDRAM) RAM 17 读出从内部RAM读取资料到D7,D0、RAM的1 1 D7 D6 D5 D4 D3 D2 D1 D0 (DDRAM/CGRAM/IRAM/GDRAM) 值 (3)LCD12864的读写时序 对LCD12864的操作应严格遵守图2-13所示的读操作时序和图2-14所示的写操作时序。 RS R/W E 有效数据 DB0,DB7 图2-13 LCD12864的读操作时序 RS R/W E 有效数据 DB0,DB7 图2-14 LCD12864的写操作时序 2.7 LED数码管介绍 LED数码管实际上是由七个发光管组成8字形构成的,加上小数点就是八个。这些段分别由字母 a,b,c,d,e,f,g,dp来表示。当数码管特定的段加上电压后,这些特定的段就会发亮,以形成我们眼睛看到 的字样了。LED数码管引脚定义图如下图2-16所示 。 a f b g e c dp d 图2-16 LED数码管引脚定义图 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 LED数码管有一般亮和超亮等不同之分,也有0.5寸、1寸等不同的尺寸。小尺寸数码管的显示笔画常用一个发光二极管组成,而大尺寸的数码管由二个或多个发光二极管组成,一般情况下,单个发光二极管的管压降为1.8V左右,电流不超过30mA。发光二极管的阳极连接到一起连接到电源正极的称为共阳数码管,发光二极管的阴极连接到一起连接到电源负极的称为共阴数码管。 LED数码管要正常显示,就要用驱动电路来驱动数码管的各个段码,从而显示出我们要的数字,因此根据LED数码管的驱动方式的不同,可以分为静态式和动态式两类。 静态驱动也称直流驱动。静态驱动是指每个数码管的每一个段码都由一个单片机的I/O端口进行驱动,或者使用如BCD码二—十进制译码器译码进行驱动。静态驱动的优点是编程简单,显示亮度高,缺点是占用I/O端口多,如驱动5个数码管静态显示则需要5×8=40根I/O端口来驱动,要知道一个AT89S52单片机可用的I/O端口才32个,实际应用时必须增加译码驱动器进行驱动,增加了硬件电路的复杂性。 LED数码管动态显示接口是单片机中应用最为广泛的一种显示方式之一,动态驱动是将所有数码管的8个显示笔划"a,b,c,d,e,f,g,dp"的同名端连在一起,另外为每个数码管的公共极COM增加位选通控制电路,位选通由各自独立的I/O线控制,当单片机输出字形码时,所有数码管都接收到相同的字形码,但究竟是那个数码管会显示出字形,取决于单片机对位选通COM端电路的控制,所以我们只要将需要显示的数码管的选通控制打开,该位就显示出字形,没有选通的数码管就不会亮。通过分时轮流控制各个数码管的的COM端,就使各个数码管轮流受控显示,这就是动态驱动。在轮流显示过程中,每位数管的点亮时间为1,2ms,由于人的视觉暂留现象及发光二极管的余辉效应,尽管实际上各位数码管码 并非同时点亮,但只要扫描的速度足够快,给人的印象就是一组稳定的显示数据,不会有闪烁感,动态显示的效果和静态显示是一样的,能够节省大量的I/O端口,而且功耗更低。 2.8 8155扩展并口介绍 2.8.1 功能说明 8155是由Intel公司研制的通用I/O接口芯片,52单片机和8155相连不仅可以为外设提供两个8位的I/O端口(A口和B口)和一个6位I/O端口(C口),也可以为52单片机提供一个256B的RAM和一个14位的定时计数器。 2.8.2 8155的结构及引脚 8155的内部结构及引脚分布分别如下图2-17和图2-18所示: IO/M 19 A口 AD0,AD7 PA0,PA7 256K 图2-17 8155的内部结构 8155有要由三个并端口A、B、C,一个14位定时计数器、256B SRAM组成,各个部分的结构以及功能说明如下。 , 定时器 定时器由2个8位寄存器构成,其中低14位组成计数器,最高的两个位定义计数器的输出形式。最高位组合的模式意义如下:M2M1=00,输出单个方波;M2M1=01,输出连续方波;M2M1=10,输出单个脉冲;M2M1=11,输出连续脉冲。 , 端口A、B、C 8155芯片有2个8位和1个6位的可编程并行I/O端口。端口A和B都是8位,端口C为6位口,都可以作为输入或输出。A口和B口作为选通输入或输出口时,C口与A、B配合,作为它们的控制信号或状态信号。 A口和B口有两种工作方式:基本I/O和选通I/O;C口只有基本I/O工作方式。当A口或B口以选通工作方式传送数据时,C口作联络信号。 , 8155共有256个RAM单元,52单片机扩展8155芯片时,可以将该256B RAM作为片外数据 存储单元,使用MOVX指令或XBYTE即可。 8155 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district PC3 40 VCC 1 PC2 39 PC4 2 PC1 TIMER IN 38 3 东南大学成贤学院毕业设计报告 图2-18 8155的引脚分布 8155的引脚功能介绍如下。 , AD0,AD7:地址/数据复用线。与单片机的低8位地址/数据总线(P0口)相连。单片机与8155 之间的地址、数据、命令与状态信息都是通过这个总线口传送的。 , CE片先信号:低电平有效,由它启动单片机和8155的通信。在单片机应用系统中,8155是 按外部数据存储器统一编址的,为16位地址,其高8位由片选线CS提供,当CE,0,选中 该片。 当 CE,0,IO/M ,0时,选中8155片内RAM,这时8155只能作片外RAM使用,其RAM 的低8位编址为00H,FFH;当 CE,0,IO/M ,1时,选中8155的I/O口,其端口地址的低 8位由AD7,AD0确定,其中AD7,AD3任选,AD3,AD0如下表6-1所示。这时,A、B、 C口的口地址低8位分别为01H、02H、03H(设地址无关位为0)。 , IO/M:IO端口和8155片内的SRAM选择线,当IO/M=1时,对8155的IO口和计数器进行 读/写,AD0,AD7和的地址为其端口地址;当IO/M=0时,对8155的RAM进行读/写,AD0, AD7和的地址为RAM的单元地址,地址范围为00H,FFH。 8155片内的计数器低8位、计数器高8位等6个可编址单元,且低3位地址对端口进行编址,6 个端口的地址为00H,05H,具体对应如下表2-10所示: 21 表2-10 8155端口的编址 端口 A2 A1 A0 命令状态寄存器 0 0 1 端口A 0 0 1 端口B 0 1 0 端口C 0 1 1 计数器低8位 1 0 0 计数器高6位 1 0 1 , RST复位信号:高电平有效。复位后,它清除命令状态寄存器和置A、B、C三个I/O口均为输入 方式。 , RD读选通信号:控制对8155的读操作,低电平有效。 , WR写选通信号:控制对8155的写操作,低电平有效。 , ALE:地址锁存信号。8155内部设有地址锁存器,在ALE的下降沿将单片机P0口输出的低8位 地址信息及CE、IO/M的状态都锁存到8155内部锁存器。因此,P0口输出的低8位地址信号不需 外接锁存器。 , PA0,PA7:8位通用I/O口,其输入、输出的流向可由程序控制。 , PB0,PB7:8位通用I/O口,功能同A口。 , PC0,PC5:有两个作用,既可作为通用的I/O口,也可作为A口和B口在选通工作方式时的状态 控制信号线,这些可通过程序控制。当C口作为状态控制信号时,其每位线的作用如下: PC0:INTRA(A口中断请求线) PC1:BFA(A口缓冲器满信号) PC2:A口选通信号 PC3:INTRB(B口中断请求线) PC4:BFB(B口缓冲器满信号) PC5:B口选通信号 , TIMER IN:定时/计数器脉冲输入端。 , TIMER OUT:定时/计数器输出端。 , VCC:,5V电源。 2.8.3 8155的使用 52单片机外部扩展使用8155并口芯片时,8155的I/O工作方式选择以及工作状态查询是通过对8155内部命令状态寄存器设定控制字实现的。8155的命令状态寄存器实际上为两个寄存器,分别存放命令字和状态字。命令控制字用于设定8155的工作方式,命令寄存器只能写入,不能读出;状态寄存器用于锁存输入/输出口和定时/计数器的当前状态,供CPU查询用。状态寄存器的端口地址与命令寄存器相同,低8位也是00H,状态寄存器的内容只能读出,不能写入。所以可以认为8155的I/O口地址00H是命令/状态寄存器的地址,对其写入时作为命令寄存器;而对其读出时,则作为状态寄存器。 , 8155命令字 命令字写入命令寄存器,用于定义并行I/O端口及定时器的工作方式。其格式如下图2-19所示。 D7 D6 D5 D4 D3 D2 D1 D0 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 0——输入 A口方式 1——输出 B口方式 东南大学成贤学院毕业设计报告 图2-19 8155端口及定时器的工作方式设置(8155命令寄存器格式设置) 如果选择8155芯片工作于基本的输入输出端口方式,A、B口为输出,C口为输入,禁止A口、B口中断,定时器无操作,则命令控制字为00000011B。 , 8155状态字 状态字从状态寄存器读出,用于寄存端口A、端口B和定时器的工作状态,状态寄存器格式如下图2-20所示。 D7 D6 D5 D4 D3 D2 D1 D0 × INTRA 1—A口有中断请求;0—无 BFA 1—A口缓冲器满;0—空 INTEA 1—允许A口中断;0—禁止 1—B口有中断请求;0—无 INTRB BFB 1—B口缓冲器满;0—空 INTEB 1—允许B口中断;0—禁止 INTER 1—定时/计数器溢出,产生中断 图2-20 8155端口及定时器的工作状态寄存器 通过对8155命令状态寄存器的读写,可以设置8155的内部资源按照指定的工作方式正常工作,需要说明的是:8155的复位时间比较长,待其复位稳定后方可对其命令寄存器进行设定,以使8155正常工作。体现在系统设计中就是52单片机复位后适当延时以等待8155的正常复位。 23 第三章 硬件连接原理图 第二章主要是一些器件及其使用的介绍。本章将把它们连接起来,给出它们的硬件连接原理图。 3.1 8155接口电路 8155接口电路如下图3-1所示。 图3-1 8155接口电路 3.2 ADC0809接口电路 AT89S52与ADC0809接口时必须弄清楚并处理好三个问题: (1)要给START线送一个100ns宽的启动正脉冲。 (2)获取EOC线上的状态信息,因为它是A/D转换的结束标志。 (3)要给“三态输出锁存器”分配一个端口地址,也就是给OE线上送一个地址译码器输出信号。 将单片机的P3.3、P3.4、P3.5与ADC0809的ADDA、ADDB、ADDC相连接,控制选择ADC0809的采集通道IN0,IN7。单片机的P0口作为地址/数据复用口通过8155与ADC0809相连。ADC0809 CLK 上的时钟频率为500KHZ。为得到此频率,因为AT89S52采用12MHZ的时钟频率,然后经过2个74LS74 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 芯片4分频得到500KHZ,此时的转换速度128us。在程序运行时,利用P3.2检测ADC0809的EOC接口,判断0809是否转换结束,若EOC输出一个正脉冲,则申请中断,将转换的数据送给单片机。ADC0809内部带有输出锁存器,所以可以和单片机直接相连,当然,也可以和扩展口如8155相连,电路图如下图3-2所示。 图3-2 ADC0809接口电路 3.3 主控模块与复位电路及晶振接口电路 本系统采用晶振时钟电路。外部晶振以及电容 C1和C2成并联谐振电路,接在放大器的反馈回路中。对外接电容的值虽然没有严格要求,但电容的大小多少会影响震荡器频率的高低,外接晶振时,C1和C2通常选择30Pf,晶振采用12MHZ。 复位是单片机的初始化操作,只要给 RESET 引脚加上 2 个机器周期以上的高电平信号,就可使单片机复位。复位的主要功能是把 PC初始化为0000H ,使单片机从0000H单元开始执行程序。除了进入系统的正常初始化之外,当由于程序运行出错或操作错误是系统处于死锁状态,为摆脱死锁状态,也需要复位键重新启动。复位电路必须确保上电时能够自动复位,在必要时还可以手动复位。 上电自动复位电路的基本功能是:系统上电时提供复位信号,直至系统电源稳定后,撤销复位信号,为了可靠起见,电源稳定后,还要经过一定的延时才能撤销复位信号以防电源开关或电源插头分-合过程中引起的抖动而影响复位。为了实现这种功能,本设计采用了一种RC定时电路,其时间常数τ=RC。 25 系统上电时,两端的电压为零,单片机的复位端的电平为高电平,单片机复位,经过4-5个 t后,C两端的电压约等于电源电压,单片机的复位端的电平为低电平,单片机退出复位状态。 手动复位电路采用的是按键复位电路。在按键按下时,单片机的复位端的电平为高电平,单片机复位,在按键松开时,单片机的复位端的电平为低电平,单片机退出复位状态。 AT89S52与复位电路及晶振的接口电路图如下图3-3所示。 VCC 图3-3 AT89S52与复位电路及晶振接口电路图 3.4存储器AT24C02接口电路 存储器采用AT24C02,它和单片机的接口电路如下图3-4所示。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 图3-4 存储器AT24C02接口电路 3.5 一氧化碳传感器与模/数转换器接口电路 传感器MQ—7的输出是模拟量,要通过ADC0809转换成数字量,再送由单片机进行处理。传感器与模/数转换器的接口电路如下图3-5所示。 图3-5 传感器MQ—7与ADC0809接口电路 3.6 报警模块接口电路 本设计采用峰鸣器报警电路。通过编程让传感器的数据和给定值进行比较。如果大于给定值则蜂鸣 -6所示。 器报警。接口电路如下图3 图3-6 报警模块接口电路 3.7 键盘接口电路 在单片机应用系统中,除了完成基本的功能外,另一个最重要的任务是设计优秀的人机交互接口。人机交互接口用来实现控制命令及数据的输入,并且将系统运行信息显示反映给操作者。键盘以按键的形式来设置控制功能或数据,是人机交互最基本的途径。键盘模块设计的好坏,直接关系到系统的可靠 27 性和稳定性。 在单片机应用系统中,有两种常用的键盘结构,独立式按键和矩阵式按键。其中,独立式按键比较简单,适合于较少开关量的输入场合,而矩阵式键盘则适合于输入命令或者数据较多、功能复杂的系统。采用矩阵式键盘结构可以最大限度地使用单片机的引脚资源,因此应用十分广泛。 本次设计采用矩阵式按键。如下图3-7所示,在矩阵式键盘中,每条水平线和垂直线在交叉处不直接连通,而是通过一个按键加以连接。这样,P1口就可以构成4×4=16个按键,比之直接将端口线用于键盘多出了一倍。其工作原理为:将矩阵式键盘的行线通过上拉电阻接正电源。此时,如果没有按键按下,则对应的行线为高电平;如果有按键按下,对应交叉点的行线和列线短路,行线的输出依赖于与此行连接的列的电平状态。这样,通过读入行列线的状态就可以得知是否有键按下了。 图3-7 键盘接口电路图 键盘模块的键值安排如下图3-8所示。 2 3 测试 1 5 4 6 锁定 8 9 7 设置 . 删除 0 确认 图3-8 键盘示意图 每个按键的功能说明如下: (1)0,9、.键:设置报警值。 (2)测试键:控制传感器开始检测一氧化碳浓度。 (2)锁定键:控制液晶显示器显示数值保持不变。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 (3)设置键:开始自定义设置报警值。 (5)删除键:删除一位设置错误的报警值。 (6)确定键:确定设置报警值结束。 3.8 LCD1602接口电路 1 VSS 如下图3-9所示,本论文的设计采用LCD1602液晶显示器作为显示模块。这种显示器最大的优点2 VDD 就是使用口资源比较少,显示位数多,显示比较清晰,界面友好,段码从P0口输出。输出内容为英文3 VL 提示、实时浓度值。 4 P2.1 RS 5 P2.2 RW 6 P2.3 E LCD1602 7 PB0 D0 8 PB1 D1 9 PB2 D2 PB3 10 D3 11 PB4 D4 PB5 12 D5 PB6 13 D6 14 PB7 D7 +5V +5V 15 BLA 16 BLK 图3-9 LCD1602液晶显示器接口电路 液晶显示模块是一个慢显示器件,所以编程时应注意,在执行每条指令之前一定要确认模块的忙标志为低电平(表示不忙),或进行适当的延时,以确保前一个指令执行完毕,否则可能造成指令失效。另外,显示字符时要先发送控制指令,即输入显示字符地址,告诉模块在哪个位置显示字符。LCD1602第一行的首地址指令是80H(ox80),第二行首地址指令是C0H(oxC0)。 29 第四章 方案设计 设计就是根据题目的要求对软件进行规划,并选择最合适的软件程序来达到目的。 4.1 设计要求 设计的报警器应能实现如下功能:报警器需在一氧化碳浓度达到100ppm时启动报警。 具体实现如下功能: (1)系统要求设置正常工作状态,除正常工作状态外蜂鸣器处于关闭状态。 (2)当室内一氧化碳浓度达到100ppm时系统应启动蜂鸣器报警。 4.2 系统组成 本次设计是单片机在系统检测以及工程控制方面的应用。它是以AT89S52单片机为核心构成的单片机系统。在此系统中,检测信号进入单片机进行运算处理。为了更好的理清设计思路,将整个系统细分为七个部分进行说明。整个报警器由七个部分组成,即分为七大模块:主控模块、8155扩展并口、键盘模块、浓度检测模块、存储模块、显示模块和报警模块。在本次设计中,使用的核心器件是单片机和一氧化碳传感器。为了保证整个系统的可靠运行,设计中必须明确这七大部分的实际联系:以单片机为中心,其它各大模块一一展开。其中,主控模块以单片机为主,对其它模块的运行进行控制;键盘模块用来实现控制命令及数据的输入;浓度检测模块所实现的功能是将房间中的一氧化碳浓度值转换成为单片机能够处理的数字信号,并且通过显示模块将浓度值显示出来;存储模块主要用来 记录 混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载 存储浓度检测模块所检测的气体浓度的数据;显示模块由LCD液晶显示器构成,主要用来显示浓度检测模块检测的气体浓度;报警模块是此系统的外部电路,它的功能是实现报警。因为本次设计要用到模数转换器ADC0809,所以AT89S52的32个口不够用,因此要用到8155扩展并口。综上,本设计的系统框图如下图4-1所示。 键盘模块 浓度检测模块 存储模块 AT89S52 8155 报警模块 显示模块 图4-1 一氧化碳报警器系统组成框图 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 第五章 软件设计 5.1 主程序流程图 主程序的设计流程图如下图5-1所示,当一氧化碳浓度检测系统接通电源时,AT89S52单片机自动复位,然后开始运行主程序。该程序首先对系统进行初始化,然后给出开机显示,告知系统已经通电,可以开始工作了;接着对键盘进行扫描,判断是否有键输入,如果有按键按下,就进行键处理,键处理是包含在键盘扫描中的;再接着测一氧化碳浓度并对数据进行存储和显示;再接着进行数据处理,判断是否需要报警,如果单片机从传感器接受来的数据符合报警条件,单片机就控制报警器报警,最后返回到键盘扫描处,如果不需要报警,则直接返回到键盘扫描处,重新循环。 开始 初始化 键盘扫描 浓度数据采集 数据存储和显示 数据处理 NO 是否需要报警 YES 报警器报警 图5-1主程序流程图 31 5.2 ADC0809程序流程图 ADC0809的A/D启动端START由单片机的P2.7与写控制信号/WR经过或非门后控制,转换完成 后ADC0809的EOC端信号反向后送入单片机的INT0端,触发单片机外部中断服务程序,在中断程序 当中读取A/D。程序流程图如下图5-2所示。 开始 选定通道0 启动A/D转换 延时1ms等待EOC出现高电平 给OE置1,转换后的数据传给单片机 结束 图5-2 模/数转换程序流程图 5.3 存储器AT24C02程序流程图 存储器程序设计时,要特别注意以下两个问题: (1)AT24C02有一个约10ms的片内写周期 。在该周期内,AT24C02不对外界的操作作出反应。 (2)在发送数据的过程中,要确保当SCL为高电平时,SDA保持稳定。 程序设计分两个过程:写数据过程和读数据过程 (1)在写数据周期依次执行以下过程 , 发“起始位”。 , 发“写入代码”(8bit),1010(A2A1A0)0。 , 收“ACK”应答(1bit)。 , 发“EEPROM”片内地址(即要写入EEPROM的位置)(8bit)。从00到FF中的任意一个, 对应EEPROM中的相应位。 , 收“ACK”应答(1bit)。 , 要发送的数据(8bit),即要存储到EEPROM中的数据。 , 发“停止位”。 (2)在读数据周期依次执行以下过程 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 , 发“起始位”。 , 发“写入代码”(8bit),1010(A2A1A0)0。 , 收“ACK”应答(1bit)。 , 发“EEPROM”片内地址(即要写入EEPROM的位置)(8bit)。从00到FF中的任意一个, 对应EEPROM中的相应位。 , 收“ACK”应答(1bit)。 , 发“起始位”。 , 发“读出代码”(8bit),1010(A2A1A0)1。 , 接收。 , 发“ACK”应答。 , 发“停止位”。 向AT24C02写数据程序流程图如下图5-3所示。 开始 发送起始位 接收ACK应答 检测AT24C02是否准备好 发送数据 NO NO 准备好 发送完 YES YES 向AT24C02发送“写入”代码 接收非应答位 接收ACK应答 发送停止位 向AT24C02发送存储地址 结束 图5-3 向AT24C02写数据程序流程图 从AT24C02读取数据的程序流程图和写入数据的流程图类似,此处不再缀述。 5.4 LCD1602液晶显示器程序流程图 液晶显示器程序流程图如下图5-4所示。 33 开始 写第一行首地址 向第一行写入数据 NO 写完 YES 写第二行首地址 向第二行写入数据 NO 写完 YES 结束 图5-4 LCD1602液晶显示器程序流程图 5.5 键盘程序流程图 对于键盘的程序设计,需要及时并且准确地响应按键的动作。在进行单片机键盘接口设计的时候,需要注意如下几个方面。 1、合理的按键编码 按键编码也就是在单片机程序中,每个按键动作对应的键值。当按键按下的时候,键盘将向单片机发送该按键对应的键值,单片机程序对不同的键值做出不同的响应。因此,要求每个按键对应一个唯一的键值。 在硬件结构上,键盘按键使用单片机的I/O线与CPU进行通信,而单片机I/O线接受的是高低逻辑电平信号。因此,不同的键值可以表示为I/O线上不同的高低电平的组合。键盘编码设计的首要任务就是选择合理的键盘结构,为每个按键分配不同的键值,以供单片机程序识别和响应。 2、可靠的输入检测 可靠的输入检测是让单片机程序能够正确无误地识别是否有按键动作,以及是哪个按键按下。键盘的可靠输入是键盘接口设计的关键点。由于键盘的按键均为机械触点,根据触点的机械弹性效应,在按键按下和断开的时候,接触点处会出现抖动,这样可能导致误响应或者多次响应等。因此,对于键盘输入的可靠识别和检测需要在程序中做如下两方面的处理。 (1)消除抖动影响。由于材料机械弹性效应的不同,按键的抖动时间长短不等,一般大致在5ms,10ms之间。根据这个特征,可以在硬件或者软件中采取相应的措施来消除抖动的影响。通常来说,采 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 用延时程序可以同时达到去抖动。采用这种方法时,当程序检测到有键按下,便执行一个10ms的延时程序,然后再检测一次,看是否该键仍然闭合。如果仍然闭合则可以确认该按键确实被按下,从而可以消除抖动的影响,便可以执行相对应的操作。 (2)一次按键处理。手工操作需要一定的时间,大致为0.1s,2s,这相对于单片机的运行频率来说是非常慢的。当按键按下之后,有可能导致单片机程序对该按键操作响应多次。在程序中可以增加相应的识别按键松开的检测程序,来避免对一次按键输入的多次响应。 3、单片机对键盘输入的响应可以采用两种方式:查询和中断。查询方式适用于一般用途的程序,需要在程序中循环查询每一个按键的状态,因此会占用大量的CPU处理时间。中断法适用于一些对实时性要求较高的复杂单片机系统,只有按键按下的时候才向CPU申请中断进而执行相应的程序段,平时不会占用CPU处理时间。 总的来说,在单片机程序中,对键盘的处理主要包括如下几个方面。 (1)检测按键是否按下。 (2)如果按键被按下,执行延时程序,用来实现软件消除抖动的影响。 (3)扫描按键,准确判断被按下的按键的键值。 (4)转向相应的按键处理子程序。在按键处理子程序中,不能执行过于繁重的任务而延误了对下一次按键动作的响应。 本次设计单片机对键盘输入的响应采用扫描方式。程序流程图如下图5-5所示。 假设行线从上到下依次为X0,X3,列线从左到右依次为Y0,Y3,则程序执行的步骤如下: (1)判断按键是否按下。在程序中将列线(Y0,Y3)全部输出为0,此时读行线(X0,X3)的状态。如果行线全为1,则表示此时没有任何按键按下;如果行线不全为1,则表示有按键按下。进而继续执行下面的步骤。 (2)按键去抖动。当判断有按键按下之后,程序中延时10ms左右的时间,然后再次判断键盘的状态。如果仍然处于按键按下的状态,则便可以肯定有按键按下,否则将当作按键的机械抖动。 (3)扫描按键的位置,这是扫描法的主要步骤。程序中,首先先令列线Y0输出0,其余3根列线均输出1。然后读取行线的状态,如果行线(X0,X3)均为高电平,则Y0这一列上没有按键按下,如果行线(X0,X3)不全为高电平,则表示其中为低电平的行线与Y0相交的按键被按下。如果列Y0没有按键按下,然后按照同样的方法依次检查Y1、Y2和Y3列有没有按键按下。这样通过逐列扫描,便可以找到按键的坐标位置(X,Y),也就是键值。 (4)按键程序处理。根据按键的键值,执行相应的程序处理子程序。有的时候,为了保证一次按键只执行一次程序处理,可以判断按键是否释放,如果按键释放则再次开始按键扫描操作。 35 开始 键盘扫描 NO 是否有键按下 YES 延时10ms,去抖动 NO 是否有键按下 YES 扫描按键位置 按键程序处理 返回 图5-5 键盘扫描法程序流程图 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 第六章 调试 6.1 系统调试过程 系统调试分为硬件调试和软件调试两个部分,两者一般需要配合进行调试。 6.1.1 硬件调试 首先,检查电路。任何组装好的电子电路,在通电调试之前,必须认真检查电路连线是否有错误。对照电路图,按一定的顺序逐级对应检查。特别要注意检查电源是否接错,电源与地是否有短路,二极管方向和电解电容的极性是否接反,集成电路和晶体管的引脚是否接错,轻轻拔一拔元器件,观察焊点是否牢固,等等。 然后,通电观察。一定要调试好所需要的电源电压数值,并确定电路板电源端无短路现象后,才能给电路接通电源。电源一经接通,不要急于用仪器测试,而是要观察是否有异常现象,如冒烟、异常气味、放电的声光、元器件发烫等。然后,再测量每个集成块的电源引脚电压是否正常,以确信集成电路是否已通电工作。 而后,静态调试,先不加输入信号,测量各级直流工作电压和电流是否正常。动态调试加上输入信号,观测电路输出信号是否符合要求。 最后,拷入一段简单的程序,通电。测试键盘与液晶显示器是否可以正常运行。 6.1.2 软件调试 第一步,通过仿真技术,在具有 Proteus和Keil C51软件的主机上和系统连接起来,进行调试准备。 第二步,单步运行。所谓单步运行是指在程序开发中,为了找到程序的bug,通常采用的一种调试手段,一步一步地跟踪程序执行的流程,根据变量的值,找到错误的原因。 第三步,系统调试,即进行软件和硬件联合调试。 6.2 Keil 的使用 6.2.1 概述 单片机开发中除必要的硬件外,同样离不开软件,我们写的汇编语言源程序要变为CPU可以执行的机器码有两种方法,一种是手工汇编,另一种是机器汇编,目前已极少使用手工汇编的方法了。机器汇编是通过汇编软件将源程序变为机器码,用于MCS-51单片机的汇编软件有早期的A51,随着单片机开发技术的不断发展,从普遍使用汇编语言到逐渐使用高级语言开发,单片机的开发软件也在不断发展。Keil软件是目前最流行的开发MCS-51系列单片机的软件,这从近年来各仿真机厂商纷纷宣布全面支持Keil即可看出。Keil提供了包括C编译器、宏汇编、连接器、库管理和一个功能强大的仿真调试器等在内的完整开发方案,通过一个集成开发环境(uVision)将这些部份组合在一起。运行Keil软件需要Pentium或以上的CPU,16MB或更多RAM、20M以上空闲的硬盘空间、WIN98、NT、WIN2000、WINXP等操作系统。掌握这一软件的使用对于使用51系列单片机的爱好者来说是十分必要的,如果你使用C语言编程,那么Keil几乎就是你的不二之选,即使不使用C语言而仅用汇编语言编程,其方便易用的集成环境、强大的软件仿真调试工具也会令你事半功倍。 6.2.2 使用方法 Kei的使用分为以下几个步骤: 37 1、启动keil:双击桌面上的keil uVision3图标,或单击屏幕下方的“开始?程序?keil uVision3”。 2、建立一个工程:启动Keil后,单击菜单栏上的“Projict?New?uVision Project”。 3、选择工程保存位置:单击“Projict?New?uVision Project”后紧接着会弹出一个窗口,在该窗口中新建一个文件夹,双击打开,然后在下方文件名中随便定义一个名字,然后点击保存。 4、选择单片机(MCU)型号:点击保存后又会弹出一个窗口,在Date base中找到Atmel?AT89S52,然后点击确定,接着会弹出对话框询问是否将初始化代码一起加入工程。这里我们选择“否”。这个初始化代码就类似于我们用汇编的时候初始化CPU,让它从制定地址开始运行。我们用C语言编写程序,这个是不需要的。 5、现在就建立了一个工程。但是工程是空的,里面什么都没有。接下来我们就要新建一个*.C的文件,用来编程。 6、建立编程文件:点击菜单栏上的“File?New”会立即在当前窗口新建一个“文本文件”,然后点击保存,一定要把这个文件保存成*.C文件。比如,输入文件名的时候我们输入main.C(其他名字也可以,比如XiaoMao.C),总之一定要是C文件。 7、现在我们建立了这个用来编写程序的文件,但是这个文件是不在工程中的,我们需要把它添加进去。右键点击Project Workspace中的“Target 1?Souce Groupe 1”,然后左键单击“Add Files to Groupe ? Souce Groupe 1?” 8、添加文件到工程中:紧接着会弹出一个窗口,选择要添加的文件,然后点击“Add”,文件就会被添加进去。 9、工程建立完毕,可以开始写程序了。写完程序后,就可以“编译”“链接”了。所谓的编译,就 ,编译程序把人们熟悉的语言换是把高级语言变成计算机可以识别的二进制语言,计算机只认识1和0 成二进制的。这个过程程序会告诉你,你写的程序哪里有错误。如果有错误,你可以按照提示,在第几行第几行,更改后可再次编译。 在Project Workspace的正上方有三个按钮,“编译”是按钮的第一个;第二个是“链接”按钮;第三个是“重新链接”。一般不用第二个按钮,直接点第三个就可以了。 10、编译成功,没有错误后,我们可以“链接”,让keil生成我们需要的文件。点击第二个(一般不用第一个和第二个,直接点击第三个就行了。因为“链接”过程也是先“编译”,也是包含了第一步的,如果有错误,同样会中断,并且给出提示的)。 11、到现在为止,这个程序算是写完了。但是我们往往需要看看这个程序运行的结果。比如我们将程序下载到单片机上,或是将程序导入别的仿真软件(比如proteus)中。当前的单片机下载器或是proteus,其实都是将keil最后生成的机器码导入其中,而不是将代码或是我们写的C文件倒进去。因为CPU是看不懂我们的代码的,CPU只能运行机器语言。这里,我们就需要设置一下,让keil替我们生成这个机器语言。如下图,右键点击Target 1,然后左键单击“Options for Target „Target 1?”。 12、在弹出的对话框中点击“Output”,对输出选项进行设置。然后在“Creat HEX File”前面的小对钩选中,这样在你点击“链接”按钮的时候,keil就会生成*.HEX文件。 13、设置好了点击“确定”,再点击一下“重新链接”按钮,这时可以看到多了这么一条信息“创建HEX文件“TEST”,这说明我们的设置起作用了。那生成的这个HEX文件在哪里呢,当然是在我们的工程目录下面了。 14、在工程目录下找到*.HEX文件。 15、看到HEX文件接下来,不管是要下载程序到实验板,还是要导入到proteus中仿真,都用这个HEX文件就可以了。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 6.3 Proteus 的使用 6.3.1 概述 PROTEUS是英国Labcenter electronics公司研发的多功能EDA软件,它具有功能很强的ISIS智能原理图输入系统,有非常友好的人机互动窗口界面,有丰富的操作菜单与工具。在ISIS编辑区中,能方便地完成单片机系统的硬件设计、软件设计、单片机源代码调试与仿真。 PROTEUS有三十多个元器件库,拥有数千种元器件仿真模型,有形象生动的动态器件库、外设库。特别是有从8051系列8位单片机至ARM7 32位单片机的多种单片机类型库。支持的单片机类型有:68000系列、8051系列、AVR系列、PIC12系列、PIC16系列、PIC18系列、Z80系列、HC11系列以及各种外围芯片。它们是单片机系统设计与仿真的基础。 PROTEUS有多达十余种的信号激励源,十余种虚拟仪器(如示波器、逻辑分析仪、信号发生器等),可提供软件调试功能,即具有模拟电路仿真、数字电路仿真、单片机及其外围电路组成的系统的仿真、 2RS232动态仿真、IC调试器、SPI调试器、键盘和LCD系统仿真的功能,还有用来精确测量与分析的PROTEUS高级图表仿真(ASF)。它们构成了单片机系统设计与仿真的完整的虚拟实验室。PROTEUS同时支持第三方的软件编译和调试环境,如Keil C51 uVision2等软件。 PROTEUS还有使用极方便的印刷电路板高级布线编辑软件(PCB)。特别指出,PROTEUS库中数千种仿真模型是依据生产企业提供的数据来建模的。因此,PROTEUS设计与仿真极其接近实际。目前,PROTEUS已成为流行的单片机系统设计与仿真平台,应用于各种领域。 实践证明:PROTEUS是单片机应用产品研发的灵活、高效、正确的设计与仿真平台,它明显提高了研发效率、缩短了研发周期,节约了研发成本。 至于Proteus的详细使用,本文将不做细致介绍,只将一些基本的操作作简要说明。 6.3.2 PROTEUS使用方法简介 1、进入Proteus ISIS 双击桌面上的ISIS 6 Professional图标或者单击屏幕左下方的“开始”?“程序”?“Proteus 6 Professional” ?“ISIS 6 Professional”。 2、工作界面 Proteus ISIS的工作界面是一种标准的Windows界面,如图10-1所示。包括:标题栏、主菜单、标准工具栏、绘图工具栏、状态栏、对象选择按钮、预览对象方位控制按钮、仿真进程控制按钮、预览窗口、对象选择器窗口、图形编辑窗口。 3、基本操作 (1)对象放置(Object Placement) 放置对象的步骤如下(To place an object): ?根据对象的类别在工具箱选择相应模式的图标(mode icon)。 ?根据对象的具体类型选择子模式图标(sub-mode icon)。 ?如果对象类型是元件、端点、管脚、图形、符号或标记,从选择器里(selector)选择你想要的对象的名字。对于元件、端点、管脚和符号,可能首先需要从库中调出。 ?如果对象是有方向的,将会在预览窗口显示出来,你可以通过预览对象方位按钮对对象进行调整。 ?指向编辑窗口并点击鼠标左键放置对象。 39 (2)选中对象(Tagging an Object) 用鼠标指向对象并点击右键可以选中该对象。该操作选中对象并使其高亮显示,然后可以进行编辑。 选中对象时该对象上的所有连线同时被选中。 要选中一组对象,可以通过依次在每个对象右击选中每个对象的方式。也可以通过右键拖出一个选 择框的方式,但只有完全位于选择框内的对象才可以被选中。 在空白处点击鼠标右键可以取消所有对象的选择。 (3)删除对象(Deleting an Object) 用鼠标指向选中的对象并点击右键可以删除该对象,同时删除该对象的所有连线。 (4)编辑对象(Editing an Object) 许多对象具有图形或文本属性,这些属性可以通过一个对话框进行编辑,这是一种很常见的操作, 有多种实现方式。 ?编辑单个对象的步骤是(To edit a single object using the mouse): a.选中对象 b.用鼠标左键点击对象。 ?连续编辑多个对象的步骤是(To edit a succession of objects using the mouse): a. 选择Main Mode图标,再选择Instant Edit图标。 b. 依次用鼠标左键点击各个对象 (5)画线(WIRING UP) ?画线(Wire Placement) PROTEUS ISIS没有画线的图标按钮,因为ISIS的智能化足以在画线时能自动检测。 ?在两个对象间连线(To connect a wire between two objects) a. 左击第一个对象连接点。 b. 左击另一个连接点。(如果你想自己决定走线路径,只需在想要拐点处点击鼠标左键) 一个连接点可以精确的连到一根线。在元件和终端的管脚末端都有连接点。一个圆点从中心出发有 四个连接点,可以连四根线。 由于一般都希望能连接到现有的线上,ISIS也将线视作连续的连接点。此外,一个连接点意味着3 根线交汇于一点,ISIS提供了一个圆点,避免由于错漏点而引起的混乱。 在此过程的任何一个阶段,你都可以按ESC来放弃画线。 (6)放置电源及接地符号 单击工具箱的终端按钮,对象选择器中将出现一些接线端。 在器件选择器里分别点工作界面“TERMNALS”栏下的“POWER”与“ GROUND”,再将鼠标 移到原理图编辑区,左键点击一下即可放置电源符号;同样也可以把接地符号放到原理图编辑区。 urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 总结 这学期刚开学我开始了毕业设计工作。时至今日,经过三个月的努力,设计和论文基本上完成了。从最初的茫然,到慢慢的进入状态,再到对思路逐渐的清晰,整个设计过程难以用语言来表达。回想这段日子的经历和感受,真的是感慨万千,在这次过程中,我拥有了无数难忘的回忆和收获。 上学期末学校开的毕业设计大会,我们和导师进行了第一次交流,然后每个人都有了自己的毕业设计课题。我的课题是:一氧化碳报警器——软件设计。这学期刚开学我们就正式开始进入紧张的设计阶段。前几个星期我们一直都徘徊在任务书和开题报告上,面对自己的论文题目都感到一片茫然,感到什么都不会,感到不知从何处下手,感到大学四年好像白念了。幸好有导师刘久付老师在,他一直都有条不紊的带领着我们,什么时候干什么事他都早已安排好,就像一个军师一样给我们指明方向。 在刘老师的指导下,任务书和开题报告一上交我们就开始搜集资料。在这段时期,我整天出入图书馆,一切能找的地方,所以相关的书籍我们都找了,找了一大堆。然后在刘老师的指导下,摒弃了一些无关紧要的内容,保留了有参考价值的资料作为备用。 接下来,我开始对所搜集的资料进行整理和分析,并制作了课题研究的方案。在此期间,我多次与刘老师用电话、短信或E-mail进行沟通,听取老师好的建议,积极采纳。 每个星期老师都会对我们的设计成果进行审查,然后将不足之处及时反馈给我们,然后我们才发现里面的漏洞,然后及时改正。至此,我发现,要干好一件事并非那么简单,但也不是很难,总之敷衍了事是万万不可的,对待任何事情都要认真去思考,用思想来完成任务。 一篇优秀的论文不是写出来的,而是修改出来的,这需要的是耐心,还要用心。在程序设计的过程中,我遇到的问题很多,有些是在自己知识所在范围之外的,每当无法实现自己的想法或者运行不下去的时候,我就会出现浮躁的情绪,但是我没有放弃,而是适时地调节自己的心态,在同学老师的帮助下,完成了初次的设计。越是不懂的东西才越要去学,在学习的过程中你会收获很多,其中一点就是互相学习是最好的学习途径,在学习之后你会感觉到很有成就感,这也是我在完成程序设计之后体会到的。 在整个毕业论文设计的过程中我学到了做任何事情所要有的态度和心态。首先我明白了做学问要一丝不苟,对于出现的任何问题和偏差都不要轻视,要通过正确的途径去解决,在做事情的过程中要有耐心和毅力,不要一遇到困难就打退堂鼓,只要坚持下去就可以找到思路去解决问题的。在工作中要学会与人合作的态度,认真听取别人的意见,这样做起事情来就可以事倍功半。 41 致谢 本次毕业论文能圆满完成,首先我要由衷地感谢我的指导老师刘久付老师。刘老师一直以来给予了 我许多的支持和帮助,帮我选定课题,教导我如何安排时间,按时检查我的工作进度,教我如何查找相 关文献,如何分析数据,论文写完后又帮我再三修改,从而让我顺利的完成本次毕业设计。在整个毕业 设计期间,其次我要衷心地感谢我的毕设伙伴,他们为我提供了大量的帮助,从而使我的毕业设计更加 完善。谢谢,谢谢大家~ urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 附录 (1)ADC0809进行1通道模拟信号采集程序 #include //包含51系列单片机相应的特殊寄存器 #include //包含允许直接访问8051不同存储区的宏定义,也就是第四句 #define uchar unsigned char #define IN0 XBYTE[0x7ff8] //设置ADC0809的通道0地址 sbit EOC=P3^2 ; //设置EOC状态位 void ad0809(uchar idata *x) //采样结果保存函数 { uchar xdata *ad_adr; ad_adr=&IN0; *ad_adr=0; //启动转换 while(EOC==0); //查询等待转换结束 *x=*ad_adr; //保存转换结果 } void main (void) {uchar idata ad[10]; while(1) //采集ADC0809的通道转换值 ad0809(ad); } (2)AT24C02存储器存储程序 #include #include //文件包含指示编译器产生嵌入原有代码的程序的原型 #define uchar unsigned char #define uint unsigned int #define WR_slave 0xA0 #define RD_slave 0xA1 IIC_Write(uchar addr,uchar n); IIC_Read(uchar addr,uchar n); void Start_IIC(); void Stop_IIC(); void Ack(bit a); bit checkAck(); void Write_8bit(uchar input); uchar Read_8bit(); count(); uchar receive_data[20]; sbit WP=P2^0; sbit SCL=P2^1; 43 sbit SDA=P3^6; main() {IIC_Read(0,8); while(1) {if(count()==1) IIC_Write(0,8); } } void Start_IIC() { SDA=1; SCL=1; _nop_(); _nop_(); SDA=0; _nop_(); _nop_(); SCL=0; _nop_(); _nop_(); } void Stop_IIC() {SDA=0; _nop_(); _nop_(); SCL=1; _nop_(); _nop_(); SDA=1; _nop_(); _nop_(); } void Ack(bit a) {SDA=a; _nop_(); _nop_(); SCL=1; _nop_(); _nop_(); SCL=0; _nop_(); _nop_(); } urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 bit checkAck() {bit ack; SDA=1; _nop_(); _nop_(); SCL=1; _nop_(); _nop_(); ack=SDA; SCL=0; _nop_(); _nop_(); return(ack); } void Write_8bit(uchar input) {uchar i; for(i=8;i!=0;i--) {SDA=(bit)(input&0x80); SCL=1; _nop_(); _nop_(); SCL=0; _nop_(); _nop_(); input=input<<1; } } uchar Read_8bit() {uchar temp=0,i; SDA=1; for(i=0;i<8;i++) {SCL=1; _nop_(); _nop_(); temp=temp<<1; if(SDA==1) temp=temp+1; SCL=0; _nop_(); _nop_(); } return(temp); } 45 IIC_Write(uchar addr,uchar n) {uchar i, write_data[8]; Start_IIC(); Write_8bit(WR_slave); if(checkAck()==1) return(0); Write_8bit(addr); if(checkAck()==1) return(0); for(i=0;i #include #define uchar unsigned char #define uint unsigned int sbit RS=P2^4; sbit RW=P2^5; sbit E=P2^6; uchar dis1[]="Gas Leaking!"; uchar dis2[]="Leaving!"; /*********主函数*************/ void main(void) {void delay(uint ms); bit Lcd_bz(); void Lcd_wcmd(uchar cmd); void Lcd_wdat(uchar dat); void Lcd_init(); uchar i; Lcd_init(); delay(10); Lcd_wcmd(0x80); i=0; while(dis1[i]!='\0') {Lcd_wdat(dis1[i]); i++; delay(100); } Lcd_wcmd(0xC0); i=0; while(dis2[i]!='\0') {Lcd_wdat(dis2[i]); i++; delay(100); } while(1); } /*********LCD初始化函数******/ void Lcd_init() {Lcd_wcmd(0x38); 47 delay(1); Lcd_wcmd(0x0c); delay(1); Lcd_wcmd(0x06); delay(1); Lcd_wcmd(0x01); delay(1); } /*********检测忙函数*********/ bit Lcd_bz() {bit result; RS=0; RW=1; E=1; _nop_(); _nop_(); result=(bit)(P0&0x80); _nop_(); _nop_(); E=0; return result; } /*********写指令函数*********/ void Lcd_wcmd(uchar cmd) {while(Lcd_bz()); RS=0; RW=0; P0=cmd; E=1; _nop_(); _nop_(); _nop_(); _nop_(); E=0; } /*********写数据函数*********/ void Lcd_wdat(uchar dat) { while(Lcd_bz()); RS=1; RW=0; P0=dat; E=1; _nop_(); _nop_(); _nop_(); _nop_(); E=0; urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 } /*********延时函数***********/ void delay(uint ms) {uchar k; while(ms--) {for(k=0;k<250;k++) {_nop_(); _nop_(); _nop_(); _nop_(); } } } (4)键盘列扫描子程序。 假设图3-8中,“.”对应的键值为10,“删除”对应的键值为11,“测试”对应的键值为12,“锁定”对应的键值为13,“设置”对应的键值为14,“确认”对应的键值为15。程序如下: int KeyScan() { unsigned char k,k_temp; P1=0xF0; //低四位置0,高四位置1,准查询按键 k=P1; //取得当前P1口的状态 if(k!=0xF0) { //如果有变化则表示有键按下 delay(10); //延时,进行去抖动 k_temp=P1; if(k==k_temp) { //确实有按键按下 k=oxFE; do { //循环扫描每一列 P1=k; if(k!=P1) { //如果有变化则表示Y0列有键下 switch(P1) //判断按键,并返回键值 { //第1列 case ox7D:{return 0;break;} case oxEE:{return 1;break;} case oxED:{return 2;break;} case oxEB:{return 3;break;} //第2列 case oxDE:{return 4;break;} case oxDD:{return 5;break;} case oxDB:{return 6;break;} case oxBE:{return 7;break;} 49 //第3列 case oxBD:{return 8;break;} case oxBB:{return 9;break;} case ox7E:{return 10;break;} case ox7B:{return 11;break;} //第4列 case oxE7:{return 12;break;} case oxD7:{return 13;break;} case oxB7:{return 14;break;} case ox77:{return 15;break;} } } k=_crol_(k,1); //移位,进入一一列扫描 }while(k!=0xEF); //超过范围,退出列扫描 } } } urban area 2.5.2 Yibin city in Yibin city, according to resource and environment characteristics Urban population and urban spatial distribution, spatial distribution of industries, major infrastructure Corridor layout, combined with the future development trend of synthetic judgments, planning, urban spatial structure of urban system can be summarized as: "a pole along the two axes". "A" refers to the metropolitan area along the Yangtze River, is the core area of the development of the city. Plans to build for the Yangtze River economic belt on the pillar, advancing along the ... Guanghe River, Yiliang, prestige of the external cohesion of zhaotong, Yunnan, internal connecting Yibin city to the North. The Sichuan-Yunnan-Guizhou border area of Yibin, in the city of zhaotong, liupanshui three, zhaotong city, the most populous and most extensive regions, the most economically backward, to the North in Wumeng mountain area of yanjin, shuifu, suijiang counties radiation power is relatively weak. Yibin city and infrastructure in such areas should be strengthened and docking, extending southward to public services, promote the development of mineral resources in Northeast Yunnan, expand our economic hinterland, driving synchronous lifting in Sichuan-Yunnan-Guizhou border area. This urban axis with mineral resource advantages, focus on the development of advanced technology, comprehensive utilization of resources of higher energy, new building materials, chemical industry, developing new energy and mining towns. Urban space organization-in gongxian County, Gao, junlian County Center for area organizations, improve, Gao, Gong, junlian County comprehensive services, and promoting regional economic development and population growth of the agglomeration. Along the main traffic arteries to implement "point-axis development" mode key repeatedly, Shahe town, Xiao Zhen, Luo table Zhen, Luo town, love Mu Zhen and other towns as district development focuses on cities and towns, promote the development of district 东南大学成贤学院毕业设计报告 参考文献 [1]朱蕴璞,孔德仁,王芳. 传感器原理及其应用. 北京:国防工业出版社,2005.8. [2]吕泉. 现代传感器原理及应用. 北京:清华大学出版社,2006.6. [3]全新实用电路集粹丛书编辑委员会.报警器、警示器应用电路. 北京:机械工业出版社,2005.2. [4]陈雷. C51单片机应用实训. 北京:中国电力出版社,2011.5. [5]夏彬彬,任明全,屈金学. PIC单片机常用模块与综合系统设计实例精讲. 北京:电子工业出版 社,2009.3. [6]雷伏容,张小林,崔浩. 51单片机常用模块设计查询手册. 北京:清华大学出版社,2010.1. [7]张靖武,周灵彬,方曙光. 单片机原理、应用与PROTEUS仿真. 北京:电子工业出版社,2011.12. [8]刘娟. 单片机C语言与PROTEUS仿真技能实训. 北京:中国电力出版社,2010.7. [9]崔纬. Protel 99 SE电路原理图与电路板设计教程. 北京:海洋出版社,2005.1. 51
本文档为【一氧化碳报警器设计——软件设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_266065
暂无简介~
格式:doc
大小:469KB
软件:Word
页数:0
分类:生活休闲
上传时间:2017-09-28
浏览量:16