毕业设计基于单片机的交通灯系统的设计.doc

上传人:文库蛋蛋多 文档编号:3975334 上传时间:2023-03-30 格式:DOC 页数:21 大小:739.50KB
返回 下载 相关 举报
毕业设计基于单片机的交通灯系统的设计.doc_第1页
第1页 / 共21页
毕业设计基于单片机的交通灯系统的设计.doc_第2页
第2页 / 共21页
毕业设计基于单片机的交通灯系统的设计.doc_第3页
第3页 / 共21页
毕业设计基于单片机的交通灯系统的设计.doc_第4页
第4页 / 共21页
毕业设计基于单片机的交通灯系统的设计.doc_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《毕业设计基于单片机的交通灯系统的设计.doc》由会员分享,可在线阅读,更多相关《毕业设计基于单片机的交通灯系统的设计.doc(21页珍藏版)》请在三一办公上搜索。

1、课程设计(论文)题 目 名 称 基于AT89C51单片机的交通灯系统的设计 课 程 名 称 单片机原理及应在电气测控学科中的应用 学 生 姓 名 吴霞 学 号 0941201250 系 、专 业 电气工程系、09电气测控类 指 导 教 师 唐宏伟 2011年6月30日 摘 要近年来随着科技的飞速发展,单片机的应用正在不断深入,同时带动传统控制检测技术日益更新。在实时检测和自动控制的单片机应用系统中,单片机往往作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构软硬件结合,加以完善。本文将介绍一种基于AT89C51单片机设计的交通灯系统对于交通的控制,12个不同颜色的发光二极管

2、来模拟东南西北四个方向的交通的,并通过单片机写入程序,来控制这些灯发光或者熄灭。十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。那么靠什么来实现这井然秩序呢?靠的就是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本系统采用MSC-51系列单片机89c51系列单片机设计交通灯控制器,实现了能根据实际车流量通过89c51芯片的p0口设置红、绿灯燃亮时间的功能;红绿灯循环点亮,倒计时剩5秒时黄灯闪烁警示;车辆闯红灯报警;绿灯时间可检测车流量并可通过双位数码管显示。本系统实用性强、操作简单、扩展功能强。.信号灯的出现,使交通得以有效管制,对于疏导交通流量、提高道路通行能力,减少交通事故有

3、明显效果。所以用单片机系统设计的交通灯对于控制交通系统至关重要。关键字:交通灯;单片机;闪烁邵阳学院课程设计(论文)任务书年级专业09电气测控类学生姓名吴霞学 号0941201250题目名称基于单片机的交通灯系统的设计设计时间2011年6月20日2011年7月1日课程名称单片机原理及在电气测控学科中的应用课程编号121200105设计地点数字控制与PLC实验室创新实验室(214)(305)一、 课程设计(论文)目的课程设计是在校学生素质教育的重要环节,是理论与实践相结合的桥梁和纽带。单片机课程设计,要求学生更多的完成软硬结合的动手实践方案,解决目前学生课程设计过程中普遍存在的缺乏动手能力的现象

4、. 单片机课程设计是继电子技术、和单片机原理与应用课程之后开出的实践环节课程,其目的和任务是训练学生综合运用已学课程“电子技术基础”、“单片机原理及应用”的基本知识,独立进行单片机应用技术和开发工作,掌握单片机程序设计、调试和应用电路设计、分析及调试检测。二、 已知技术参数和条件1、MCS-51单片机;2、KEIL 软件;Wave软件;Proteus软件3、THKSCM-1型单片机实验系统。三、 任务和要求任务:设计一个十字路口的红、绿、黄三色信号交通灯控制器要求:1东西方向为A车道,南北方向为B车道,每次通行时间为30秒;2换向时要有5秒的黄灯期;3时钟指示灯每秒亮一次注:1此表由指导教师填

5、写,经系、教研室审批,指导教师、学生签字后生效;2此表1式3份,学生、指导教师、教研室各1份。四、参考资料和现有基础条件(包括实验室、主要仪器设备等)1、单片机课程设计指导,中南大学出版社,张一斌等2009年9月2、单片机实验与实践教程,北京航空航天大学出版社,何立民等2004年7月3、THKSCM-1型单片机实验系统实验指导书、KEIL 软件,WAVE 软件4、数字控制与PLC实验室”THKSCM-1型单片机实验系统”。五、进度安排2011年6月20日-22日:收集和课程设计有关的资料,熟悉课题任务何要求2011年6月23日-24日:总体方案设计2011年6月25日-26日:硬件电路设计20

6、11年6月27日-28日:软件设计2010年6月29日:系统调试改进2010年6月30日:整理书写设计说明书2010年7月1日:答辩并考核六、教研室审批意见教研室主任(签名): 年 月 日七|、主管教学主任意见 主管主任(签名): 年 月 日八、备注目 录1 AT89C51简介7主要特性:81P0口8 P0口有八条端口线,命名为P0.0P0.7,其中P0.0为低位,P0.7为高位。每条线的结构组成如图2.3所示。它由一个输出锁存器,两个三态缓冲器,输出驱动电路和输出控制电路组成。P0口是一个三态双向I/O口,它有两种不同的功能,用于不同的工作环境。第一个功能是作普通I/O口,另一种是当系统外扩

7、存储器时,P0口作系统扩展后的数据总线口和地址总线口分时使用,首先输出低8位的地址A7A0,作地址总线;然后输入或输出数据,作数据总线。8.191、引言1.1简介近年来随着科技的飞速发展,单片机的应用正在不断深入,同时带动传统控制检测技术日益更新。在实时检测和自动控制的单片机应用系统中,单片机往往作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构软硬件结合,加以完善。十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。那么靠什么来实现这井然秩序呢?靠的就是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本系统采用MSC-51系列单片机89c51系列单片机设计交通灯控

8、制器,实现了能根据实际车流量通过89c51芯片的p0口设置红、绿灯燃亮时间的功能;红绿灯循环点亮,倒计时剩5秒时黄灯闪烁警示;车辆闯红灯报警;绿灯时间可检测车流量并可通过双位数码管显示。本系统实用性强、操作简单、扩展功能强。.信号灯的出现,使交通得以有效管制,对于疏导交通流量、提高道路通行能力,减少交通事故有明显效果。1968年,联合国道路交通和道路标志信号协定对各种信号灯的含义作了规定。绿灯是通行信号,面对绿灯的车辆可以直行,左转弯和右转弯,除非另一种标志禁止某一种转向。左右转弯车辆都必须让合法地正在路口内行驶的车辆和过人行横道的行人优先通行。红灯是禁行信号,面对红灯的车辆必须在交叉路口的停

9、车线后停车。黄灯是警告信号,面对黄灯的车辆不能越过停车线,但车辆已十分接近停车线而不能安全停车时可以进入交叉路口。1.2设计任务设计一个十字路口的红、绿、黄三色信号交通灯控制器要求:1东西方向为A车道,南北方向为B车道,每次通行时间为30秒;2换向时要有5秒的黄灯期;3时钟指示灯每秒亮一次2、方案论证与设计整个设计以AT89C51单片机为核心,设计流程如图南北绿灯亮,东西红灯亮,延时南北黄灯闪烁,东西红灯亮,延时 南北红灯亮,东西绿灯亮,延时南北红灯亮,东西黄灯闪烁,延时 开 始设置定时,显示初始化3、系统硬件设计3.1AT89c51芯片的介绍AT89C51简介AT89C51是一种带4K字节F

10、LASH存储器(FPEROMFlash Programmable and Erasable Read Only Memory)的低电压、高性能CMOS 8位微处理器,俗称单片机。AT89C2051是一种带2K字节闪存可编程可擦除只读存储器的单片机。单片机的可擦除只读存储器可以反复擦除1000次。该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准的MCS-51指令集和输出管脚相兼容。由于将多功能8位CPU和闪烁存储器组合在单个芯片中,ATMEL的AT89C51是一种高效微控制器,AT89C2051是它的一种精简版本。AT89C单片机为很多嵌入式控制系统提供了一种灵活性高且价廉的方案。

11、外形及引脚排列如图所示 主要特性:1P0口 P0口有八条端口线,命名为P0.0P0.7,其中P0.0为低位,P0.7为高位。每条线的结构组成如图2.3所示。它由一个输出锁存器,两个三态缓冲器,输出驱动电路和输出控制电路组成。P0口是一个三态双向I/O口,它有两种不同的功能,用于不同的工作环境。第一个功能是作普通I/O口,另一种是当系统外扩存储器时,P0口作系统扩展后的数据总线口和地址总线口分时使用,首先输出低8位的地址A7A0,作地址总线;然后输入或输出数据,作数据总线。2、P1口口有八条端口线,命名为P1.0P1.7,每条线的结构组成如图2.4所示。P1口是一个准双向口,只作普通的I/O口使

12、用,其功能与P0口的第一功能相同。作输出口使用时,由于其内部有上拉电阻,所以不需外接上拉电阻;作输入口使用时,必须先向锁存器写入“1”,使场效应管T截止,然后才能读取数据。3、P2口P2口有八条端口线,命名为P2.0P2.7,每条线的结构如图2.5所示。P2口也是一个准双向口,它有两种使用功能:一种是当系统不扩展外部存储器时,作普通I/O口使用,其功能和原理与P0口第一功能相同,只是作为输出口时不需外接上拉电阻;另一种是当系统外扩存储器时,P2口作系统扩展的地址总线口使用,输出高8位的地址A7A15,与P0口第二功能输出的低8位地址相配合,共同访问外部程序或数据存储器(64 KB),但它只确定

13、地址并不能像P0口那样还可以传送存储器的读写数据。4、P3口P3口有八条端口线,命名为P3.0P3.7,每条线的结构如图2.6所示。P3口是一个多用途的准双向口。第一功能是作普通I/O口使用,其功能和原理与P1口相同。第二功能是作控制和特殊功能口使用,这时八条端口线所定义的功能各不相同,如表2.3所示。RST:复位输入。当振荡器复位器件时,要保持RST脚两个机器周期的高电平时间。 ALE/PROG:当访问外部存储器时,地址锁存允许的输出电平用于锁存地址的地位字节。在FLASH编程期间,此引脚用于输入编程脉冲。在平时,ALE端以不变的频率周期输出正脉冲信号,此频率为振荡器频率的1/6。因此它可用

14、作对外部输出的脉冲或用于定时目的。然而要注意的是:每当用作外部数据存储器时,将跳过一个ALE脉冲。如想禁止ALE的输出可在SFR8EH地址上置0。此时, ALE只有在执行MOVX,MOVC指令是ALE才起作用。另外,该引脚被略微拉高。如果微处理器在外部执行状态ALE禁止,置位无效。 /PSEN:外部程序存储器的选通信号。在由外部程序存储器取指期间,每个机器周期两次/PSEN有效。但在访问外部数据存储器时,这两次有效的/PSEN信号将不出现。 /EA/VPP:当/EA保持低电平时,则在此期间外部程序存储器(0000H-FFFFH),不管是否有内部程序存储器。注意加密方式1时,/EA将内部锁定为R

15、ESET;当/EA端保持高电平时,此间内部程序存储器。在FLASH编程期间,此引脚也用于施加12V编程电源(VPP)。 XTAL1:反向振荡放大器的输入及内部时钟工作电路的输入。 XTAL2:来自反向振荡器的输出。 振荡器特性: XTAL1和XTAL2分别为反向放大器的输入和输出。该反向放大器可以配置为片内振荡器。石晶振荡和陶瓷振荡均可采用。如采用外部时钟源驱动器件,XTAL2应不接。有余输入至内部时钟信号要通过一个二分频触发器,因此对外部时钟信号的脉宽无任何要求,但必须保证脉冲的高低电平要求的宽度。3.2电路原理图该电路应用AT89c51为模板,P0口为输出端口,分别连接到对应的交通灯上,然

16、后由程序控制,红绿等交替点亮25秒,中间黄灯闪烁5次,时间为5秒。3.3仿真图通电,东西方向通行。经过25秒后,绿灯熄灭,黄灯开始闪烁。黄灯闪烁5次(5秒)后,南北方向开始通车,通行时间为25秒。25秒之后,黄灯开始闪烁。整个周期完成。4.系统的软件设计4.1程序流程南北绿灯亮,东西红灯亮,延时南北黄灯闪烁,东西红灯亮,延时 南北红灯亮,东西绿灯亮,延时南北红灯亮,东西黄灯闪烁,延时 开 始设置定时,显示初始化4.2源程序#includereg52.h#define uint unsigned int #define uchar unsigned charsbit hong1=P00;sbit

17、 huang1=P01;sbit lu1=P02;sbit hong2=P03;sbit huang2=P04;sbit lu2=P05;void delay_50ms(uint z) uint x,y;for(x=z;x0;x-) for(y=5600;y0;y-);void lu() lu1=0; hong1=1; lu2=1; hong2=0; delay_50ms(450); lu1=1; huang1=0; delay_50ms(15); huang1=1; delay_50ms(15); huang1=0; delay_50ms(15); huang1=1; delay_50ms(

18、15); huang1=0; delay_50ms(15); huang1=1; delay_50ms(15); huang1=0; delay_50ms(15); huang1=1; delay_50ms(15); huang1=0;待添加的隐藏文字内容2 delay_50ms(15); huang1=1; delay_50ms(15);void hong() lu1=1; hong1=0; hong2=1; lu2=0; delay_50ms(450); lu2=1; huang2=0; delay_50ms(15); huang2=1; delay_50ms(15); huang2=0;

19、 delay_50ms(15); huang2=1; delay_50ms(15); huang2=0; delay_50ms(15); huang2=1; delay_50ms(15); huang2=0; delay_50ms(15); huang2=1; delay_50ms(15); huang2=0; delay_50ms(15); huang2=1; delay_50ms(15);void main() while(1) lu(); hong(); 邵阳学院课程设计(论文)评阅表学生姓名 吴霞 学 号 0941201250 系 电气工程系 专业班级 电本三班 题目名称 基于单片机的

20、交通灯系统的设计 课程名称 单片机原理及其接口技术 一、学生自我总结在本次的课程设计中, 学生签名:吴霞 年 月 日二、指导教师评定评分项目平时成绩论文答辩综合成绩权 重304030老师填写等级:优、良、中、及格、不及格单项成绩指导教师评语: 指导教师(签名): 年 月 日注:1、本表是学生课程设计(论文)成绩评定的依据,装订在设计说明书(或论文)的“任务书”页后面;2、表中的“评分项目”及“权重”根据各系的考核细则和评分标准确定。Employment tribunals sort out disagreements between employers and employees.You ma

21、y need to make a claim to an employment tribunal if: you dont agree with the disciplinary action your employer has taken against you your employer dismisses you and you think that you have been dismissed unfairly.For more information about dismissal and unfair dismissal, seeDismissal.You can make a

22、claim to an employment tribunal, even if you haventappealedagainst the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any compensation awarded to you as a result of your failure to appeal.Remember that in most cases you must make an ap

23、plication to an employment tribunal within three months of the date when the event you are complaining about happened. If your application is received after this time limit, the tribunal will not usually accept i.If you are worried about how the time limits apply to you, take advice from one of the

24、organisations listed underFurther help.Employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation.Most people find making a claim to an employment tribunal challenging. If you are thinking about making

25、a claim to an employment tribunal, you should get help straight away from one of the organisations listed underFurther help.If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your compensation if you win the case. This is

26、 known as adamages-based agreement. In England and Wales, your solicitor cant charge you more than 35% of your compensation if you win the case.If you are thinking about signing up for a damages-based agreement, you should make sure youre clear about the terms of the agreement. It might be best to g

27、et advice from an experienced adviser, for example, at a Citizens Advice Bureau. To find your nearest CAB, including those that give advice by e-mail, click onnearest CAB.For more information about making a claim to an employment tribunal, seeEmployment tribunals.The (lack of) air up there Watch mCa

28、yman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Football Associations 150th anniversary celebrations and will attend Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.Fo

29、r me its about how he felt and I would like to speak to him first to find out what his experience was.Uefa hasopened disciplinary proceedings against CSKAfor the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an imm

30、ediate investigation into the referees actions.CSKA said they were surprised and disappointed by Toures complaint. In a statement the Russian side added: We found no racist insults from fans of CSKA.Age has reached the end of the beginning of a word. May be guilty in his seems to passing a lot of di

31、fferent life became the appearance of the same day; May be back in the past, to oneself the paranoid weird belief disillusionment, these days, my mind has been very messy, in my mind constantly. Always feel oneself should go to do something, or write something. Twenty years of life trajectory deeply

32、 shallow, suddenly feel something, do it.一字开头的年龄已经到了尾声。或许是愧疚于自己似乎把转瞬即逝的很多个不同的日子过成了同一天的样子;或许是追溯过去,对自己那些近乎偏执的怪异信念的醒悟,这些天以来,思绪一直很凌乱,在脑海中不断纠缠。总觉得自己自己似乎应该去做点什么,或者写点什么。二十年的人生轨迹深深浅浅,突然就感觉到有些事情,非做不可了。The end of our life, and can meet many things really do?而穷尽我们的一生,又能遇到多少事情是真正地非做不可?During my childhood, think

33、 lucky money and new clothes are necessary for New Year, but as the advance of the age, will be more and more found that those things are optional; Junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, sud

34、denly found that isnt really grow up, it seems is not so important; Then in high school, think dont want to give vent to out your inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pi

35、tch he has sweat profusely, looked at his thrown a basketball hoops, suddenly found himself has already cant remember his appearance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚会的时候最终

36、还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的球框时,突然间发现自己已经想不起他的容颜。Originally, this world, can produce a chemical reaction to an event, in addition to resolutely, have to do, and time.原来,这个世界上,对某个事件能产生化学反应的,除了非做不可的坚决,还有,时间。A persons time, your ideas are always special to clear. Want, want, line is clear, as if

37、 nothing could shake his. Also once seemed to be determined to do something, but more often is he backed out at last. Dislike his cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. Those who do, just green years oneself give oneself a

38、n arm injection, or is a self-righteous spiritual.一个人的时候,自己的想法总是特别地清晰。想要的,不想要的,界限明确,好像没有什么可以撼动自己。也曾经好像已经下定了决心去做某件事,但更多的时候是最后又打起了退堂鼓。嫌恶过自己的怯懦,最终却发现有很多缘分,有很多错过,好像冥冥之中真的已经注定。那些曾经所谓的非做不可,只是青葱年华里自己给自己注射的一支强心剂,或者说,是自以为是的精神寄托罢了。At the moment, the sky is dark, the air is fresh factor after just rained. Sudd

39、enly thought of blue plaid shirt; Those were broken into various shapes of stationery; From the corner at the beginning of deep friendship; Have declared the end of the encounter that havent start planning. Those years, those days of do, finally, like youth, will end in our life.此刻,天空是阴暗的,空气里有着刚下过雨之

40、后的清新因子。突然想到那件蓝格子衬衫;那些被折成各种各样形状的信纸;那段从街角深巷伊始的友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。Baumgartner the disappointing news: Mission aborted. r plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or

41、 humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising alti

42、tude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.The supersonic descent could happen as early as Sunda.The weatheThe balloon will slowly drift to the edge of space at 120,000

43、feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like diving int

44、o the deep end of a pool. It will be like he is diving into the shallow end. Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this will not be enough to stop him completely.If he goes too fast or spin

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号