《单片机交通灯课程方案设计书2.pdf》由会员分享,可在线阅读,更多相关《单片机交通灯课程方案设计书2.pdf(19页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、课程设计课程名称:交通信号灯设计学院:专业:姓名:学号:年级:任课教师:2011 年 7 月 8 日目录一、摘要.1 二、任务分析与设计思路.2 三、总体设计 .3 四、详细设计.4 1、设计电路.4 2、交通灯连接电路.4 3、倒计时电路.5 4、仿真电路及效果图.6 5、元件清单.7 6、软件框图.8 7、程序及其清单.9 五、调试与运行.11 六、参考资料及参考文献.11 七、心得体会.12 文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
2、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
3、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
4、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
5、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
6、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
7、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
8、9R2Y9P6R3 ZH4D6T5Z8G8一、摘要在日常生活中,交通灯作为管理交通、调协车辆的一个便捷的手段,起着很大的作用。各种交通工具、行人都要根据交通灯的变化来决定是否前行,通行的时间的规定协调了它们的步伐,极大的减少了由于交通混乱引起的各种事故的发生。因此,一个完善的交通系统中,交通灯是必不可少的设备,一个完善的交通灯程序会更有效的管理当前道路中出现的实际情况,使车辆、行人的行进变得更顺畅、更和谐。信号灯的出现,使交通是得以有效管制,对于疏导交通流量、提高道路通行能力,减少交通事故有明显效果。1986 年,联合国道路交通和道路标志信号协定对各种信号灯的含义做了规定。绿灯是通行信号,面对
9、绿灯的车辆可以直行,左转弯和右转弯。左右转弯的车辆都必须让合法的正在路口内行驶的车辆和过人行横道的行人优先通行。红灯是禁行信号,面对红灯的车辆必须在交叉路口的停车线后停车。黄灯是警告信号。近年来随着科技的发展,单片机的应用正在不断地走向深入。二、任务分析与设计思路1、任务分析:本次设计要求:运用所学单片机原理、模拟和数字电路等方面的知识,设计出一台交通信号灯,模拟路口交通信号。交通灯要求如下:1)交通信号灯能够控制东西、南北两个方向的交通,红绿黄灯用对应颜色的发光二极管代替;2)用四个2 位数码管分别显示东、南、西、北方向的通行时间,东西或南北通行时间为 25 秒,红绿灯切换中间黄灯闪烁5 秒
10、。目前,我们接触到的交通灯都位于十字路口,假设实际情况为东西南北走向的十字路口,如下图:文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
11、 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5
12、Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
13、 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5
14、Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
15、 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5
16、Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8东西南北各三盏灯,每三盏分别为红、黄、绿三种颜色,总共十二盏灯,而实际情况下,东西方向灯亮灭一致,南北方向灯亮灭一致,故只需要按东西为一组,南北为一组,两组交错亮灭来设计控制系统,即可达到交通灯系统的控制目的。根据以上分析那么只需要控制东南或者西北六盏灯亮灭规律就能实现控
17、制,另外两组对应一致就行了。根据设计要求,要求东西或者南北通行25 秒,红绿灯切换中间黄灯闪烁5 秒。那么要求绿灯亮放行,放行线,绿灯持续亮(通行时间)25秒,黄灯亮(警告提醒时间)5 秒,红灯亮禁止通行,禁止线,为了简化设计,也为25 秒。切换过程东西南北均为黄灯闪烁。2、设计思路基于完成以上任务分析,结合所学有关知识,尤其是本学期所学关于单片机的中断系统和定时/计数器的相关知识及应用,我们知道对于红、绿、黄两组各三盏灯的控制,可以通过把这六盏灯分别接到单片机的六个输出引脚,若用P1口进行输出,则分配如下:AT89C51 P 1.0P 1.1P 1.2P1.3P 1.4P 1.5 L1 L2
18、 L3 L4 L5 L6(东西红)(东西黄)(东西绿)(南北红)(南北黄)(南北绿)LED 显示分布文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5
19、V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 Z
20、H4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5
21、V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 Z
22、H4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5
23、V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 Z
24、H4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8通过对 P1口 P0P5编程从而实现控制。而时间的各盏灯的熄灭时间的延时情况,则用定时/计数和中断结合应用实现控制。而输出的时间显示则每个方向分别用两个发光二极管显示,十位接在P0口,个位接在 P2口,对 P0口 P2口编程即可实现控制。三、总体设计1、单片机
25、内部资源分布图:2、硬件原理框图:3、软件结构图:时钟电路振荡电路上 电复位 电路 AT89C51 交通灯 LED 数码管文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
26、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
27、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
28、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
29、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G
30、8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG
31、9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G83、软件结构框图:4、软硬件分工硬件实现实物连接,软件与硬件连接相对应,通过编写程序,使硬件实现期望的功能。说的形象些,软件相当于其内在本质功能,而硬件是将该功能表现出来,让人们可见罢了。三、详细设计本设计使用的单片机为AT89C51。A
32、T89C51 是带有 4K 字节闪存的低电压高性能微处理器。其主要特性:与 MCS-51 兼容1、工作电压5V 2、工作频率范围:024MHZ 3、应用程序空间:4K 字节 4、RAM:256 字节 5、4 个 8 位并行 I/O 接口 6、2 个 16 位定时器/计数器 7、5 个中断源 8、用单一+5v 电源 9、片内振荡器和时钟电路 10、低功耗的闲置和掉电模式1、设计电路:设计电路主要由两部分组成,一部分为P1 口与十二个发光二极管连接电路,另一部分是 P0、P2口与八个七段显示器相连的电路,下面分别详细说明。2、交通灯电路:设计中采用发光二极管作为交通灯来使用,单片机的I/O 接口直
33、接和交通灯(发光二极管)连接。在十字路口的四组红、黄、绿三色交通灯中,东西方向道路上的两组同色灯连接在一起,南北方向道路上的两组同色的灯也彼此连接在,受单片机 P1.0P1.5控制。单片机的I/O 接口与交通灯电路的具体连接方式为:P1.0P1.2分别接东西方向的红、黄、绿共6 个放光二极管,P1.3P1.5分别接南北方向的红、黄、绿共6 个发光二极管。12个发光二极管采用了共阳极的连接方式,因此I/O 口输出低电平时,与之相连的发光二极管会亮,I/O 口输出高电平时,相应的发光二极管会灭。交通灯电路如图所示主程序显示子程序调用实现功能模块文档编码:CG4C5V8J4C4 HG9R2Y9P6R
34、3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG
35、4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R
36、3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG
37、4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R
38、3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG
39、4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R
40、3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G83、倒计时显示电路:该显示装置选用七段数码管来显示交通灯转换的剩余时间,根据控制要求,每个路口需要两个数码管,这样四个路口就要求八个数码管。有序AT89C51单片机的 I/O 作为输出时,具有较强吸收电流能力,因此我们可以选用共阳型数码管,这样由单片机的I/O 就可以直接驱动,从而简化硬件电路的设计。四个路口倒计时显示被置在同一时刻显示相同的数字,期中P0口用来显示时间的十位,P2口用来显示时间的个位。电路如下
41、图所示文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
42、HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z
43、8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
44、HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z
45、8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4
46、HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z
47、8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G84、仿真电路及效果图:(1)仿真电路:(2)仿真效果:文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 Z
48、H4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5
49、V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 Z
50、H4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5V8J4C4 HG9R2Y9P6R3 ZH4D6T5Z8G8文档编码:CG4C5