基于单片机的交通灯控制系统优化设计.doc
文本预览下载声明
摘 要
交通灯安装在各个路口上,成为疏导交通工具有效的手段,单片机是微型计算机的一个重要分支,特别适用于控制领域,故又称为微控制器,对基于单片机的交通灯控制系统进行了设计。
本设计选用公司的单片机作为控制核心东西南北四个方向设置了LED时间显示和交通灯显示时间显示采用位LED显示器,交通灯显示则采用红绿色高亮发光二极管来模拟。软件采用了模块化的设计方法,主要分为主程序、定时器中断服务子程序、倒计时显示子程序、交通灯模拟显示子程序四部分。在对系统功能分析的基础上,了三种设计方案,经比较,选择性能较优的LED动态循环显示方案进行了设计。设计包括硬件和软件两大部分。硬件包括单片机、时间显示、交通灯显示部分。Abstract
The traffic lights installed in each intersection, and to be facilitating traffic tools effective means of single chip microcomputer, is an important branch of, especially suitable for control field, so it is also called the controller to the traffic lights, based on single chip microcomputer control system design.
The design of the chip technology companies choose macro STC12C5A60S2 single chip microcomputer as control core, the thing north and south four directions and set the time to show and that LED traffic lights, time to show the two LED display, the traffic lights are red, green, yellow showed the monochrome highlight leds to simulate. Software using modular design method, the main points of the main routine, timer interrupt service procedure, the countdown show subroutines, light model shows that subroutine four parts. The single-chip microcomputer system of dc power supply.
In the system function on the basis of analysis, discusses three designs,by comparison, choose has a better performance LED dynamic cyclic display design scheme. Design including the hardware and software of two parts. Hardware part includes single chip clock circuit, time to show, light show, alarm module parts.
Keywords:Traffic light; STC12C5A60S2;LED目录
第1章 概述 1
1.1课题研究的目的和意义 1
1.2 STC12C5A60S2单片机简介 2
1.3交通灯控制系统实现的功能 3
1.4课题研究主要内容 4
第2章 交通灯控制系统的整体设计 5
2.1控制系统的总体结构与基本工作原理 5
2.2 LG5011BSR LED显示模块 6
2.3发光二极管 8
2.4蜂鸣器模块 10
2.5本章小结 12
第3章 交通灯控制系统的硬件设计 13
3.1 LED数码显示模块 13
3.2蜂鸣器报警 19
3.3最小系统电路设计 19
3.4发光二极管 21
3.5本章小结 22
第4章 交通灯控制系统的软件设计 23
4.1系统总体软件设计流程图 23
4.2发光二极管模块程序设计 25
4.3 LED七段码模块程序设计 29
4.4蜂鸣器报警模块程序设计 35
4.5本章小结 36
结论 37
参考文献 38
致 谢 39
附录1 部分交通灯的控制系统软件程序设计 40
附录2 交通灯控制系统硬
显示全部