摘 要 单片机是一种集接口和中断系统等部分于一体的型器件,只需要外加电源和晶振就可以实现对数字信息的处理和控制。因此,单片机广泛用于控制系统中。 本论文介绍了“节能灯(发光二极管)亮度控制和故障检测”的设计与实现。 系统首先介绍从上位机(PC机)通过串行通信把数据发送到主控机(单片机 8051),主控机接收到数据,然后把从上位机来的数据,通过电力线传输到电力载波模块,再经过电力载波模块,发送到从控机(单片机8051),进行对信号进行译码,最后通过从控机对发光二极管进行控制。本文重点介绍8051,MAX232,LM1893等芯片的结构和功能,并介绍了PROTEL99软件原理图设计的过程。提出了发光二极管亮度控制和故障检测设计的基本模型,并将此流程图应用于系统软件设计。通过调试,实验结果表明了系统的功能。 本文详细简述了系统的设计和实现。在文章后面还附有从控机部分的原理图。 关键词:电力载波;PWM;串行通信 ABSTRACT A machine is a kind of gather to connect and break off the system etc. the part is in the integral whole of a machine piece, need the in addition power supply and to flap only and then can carry out the processing and the control of thelogarithms word information.Therefore, a machine useds for the control system extensively in. This thesis introduced the design and the realization of" give out light a control of diode and break down the examination". The system introduces to went the correspondence to send out the data to the lord to control the machine( a machine 8051) through a string from the place of honor machine( PC machine) first, the lord controled the machine to receive the data, then chased the data that comes from the place of honor machine, deliver the electric power to carry a mold piece through the electric power line, then the process electric power carries a mold piece, send out from control the machine( a machine 8051), carry on carrying on translating the code to the signal, pass finally from control the machine to carry on the control towards giving out light the diode.This text point introduce 8051, MAX232, the structure and functions of LM1893 etc. chip, and introduced the process of the PROTEL99 software principle diagram design.Put forward to give out light the basic model that a control of diode and breakdowns examine the design, and apply this flow chart to design in the system software.Pass to adjust to try, experiment the result to express the function of the system. Detailed Chien of this text said the design and the realization of the system.The behind returns in the article fish-eye from control the principle diagram of the machine part. Keywords:power line carrier communication; PWM;serial communication 目 录 第1章 绪论 1 1.1单片机的发展和前景 1 1.1.1单片机发展历程 1 1.1.2单片机前景 1 1.1.3单片机的特点 2 1.2发光二极管的历史回顾和未来展望 2 1.2.1发光二极管的历史回顾 2 1.2.2 LED发展和应用前景 3 1.3本章小节 3 第2章 基本基础理论知识 4 2.1单片机基础知识的介绍 4 2.1.1 MCS-51单片机主要应用特性 4 2.1.2 MCS-51单片机内部结构 5 2.1.3 MCS-51单片机的指令时序 7 2.1.4 MCS-51单片机存储器结构 8 2.1.5 MCS-51定时/计数器 9 2.1.6 MCS-51的中断结构 13 2.2 LED发光二极管特性 15 2.2.1发光二极管的特性 15 2.3单片机实现PWM 18 2.4 三极管放大原理和特性 19 2.4.1 三极管的放大原理 19 2.4.2 三极管特性 21 2.5本章小结 22 第3章 标准接口总线、载波及电源模块介绍 23 3.1 RS-232标准接口总线 23 3.1.1 RS-232C接口的具体规定如下 23 3.1.2电气特性与电平转换 24 3.1.3 RS-232C的主要特点 24 3.1.4 MAX232芯片简介 25 3.2调制解调 25 3.3稳压电源的电路设计 26 3.3.1 滤波、稳压原理 27 3.4本章小结 28 第4章 系统硬件电路设计 29 4.1系统硬件电路的结构 29 4.2系统工作原理 31 4.3实验时注意事项 32 4.4 本章小节 32 第5章 系统软件设计的实现 33 5.1串行通信程序 33 5.1.1串行通信发送程序 34 5.1.2串行通信接收程序 35 5.2电力载波模块(LM1893)程序 37 5.2.1 接收程序 37 5.2.2接收端口程序编程 38 5.3 从控机程序 39 5.4本章小结 41 第6章 PROTEL制作电路原理图 42 6.1 电路板设计步骤 42 6.1.1原理图的设计 42 6.1.2 产生网络表 42 6.2绘制简单电路图 42 6.3 本章小结 43 结论 44 参考文献 45 致谢 46 第1章 绪论 1.1单片机的发展和前景 1.1.1单片机发展历程 单片机的出现时随着微型计算机及其CPU芯片在 只能测控系统中的应用而发展起来的,从时间上来讲,可从8为单片机芯片出现开始,大致可归纳为三大阶段: 第一阶段:初级阶段(1976-1978年),该阶段时以较简单的8为低档单片机为主,其主要代表芯片为InteL公司的MCS-8048,该芯片内主要集成由8位CPU.并行I/O接口,8位定时计数器,寻址范围最大4KB,不带有串行口。 第二阶段:普及阶段(1978年后)。该阶段还是以8位机为主主要增加了串行口,多级中断处理系统,16位定时/计数器,除片内RAM,ROM容量加大,片外寻址可达64Kb,有的片内还常有A/D,D/A转换通道。 第三阶段:1982年以后,推出了高性能16位单片机。该单片机不但性能更加提高,并主频增加,运算速度加快。更加适用于快四速度,高精度,快响应的场合。 目前,各种高性能单片机芯片在市场十分活跃,新的技术不断采用,更加使单片机的种类,性能以及应用领域不断扩大和提供。 1.1.2单片机前景 |