1、 单片机技术课程设计说明书单片机技术课程设计说明书 基于单片机的交通灯设计 院 、 部: 电气与信息工程学院 学生姓名: 指导教师: 职称 讲师 专 业: 电子信息工程 班 级: 学 号: 完成时间: 2013 年 6 月 10 日 I 摘 要 随着人们社会活动的日益频繁,无论是上班、旅游等等,都离不开交通。为 了减少交通事故,让交通有秩序,交通信号灯有很大的作用,近年来单片机的应 用正在不断深入,同时带动传统控制检测技术日益更新。所以本人用单片机技术 来制作一个交通灯。 本系统采用单片机 AT89S52 为中心器件来设计交通灯控制器。 本设计就是采 用单片机模拟十字路口交通灯的各种状态显示以
2、及倒计时时间。 该系统由单片机 I/O 口扩展系统、交通灯状态显示系统、LED 数码显示系统、复位电路等几大部 分组成。系统除基本的交通灯功能外,还具有倒计时等功能,较好的模拟实现了 十字路口可能出现的状况。 关键字:交通灯; AT89S52; I/O 口;LED II ABSTRACTABSTRACT As peoples social activities have become increasingly frequent, whether it is work, tourism and so on, are inseparable from the traffic. In order t
3、o reduce traffic accidents, let the traffic order, traffic signal lights have great role, in recent years the monolithic integrated circuit application unceasingly thorough, traditional control detection technology is updated. So I use single-chip technology to the production of a traffic light. The
4、 system uses a single-chip AT89S52 as the center device to design the traffic light controller. This design is the use of single-chip simulation of traffic lights at the crossroads of various state display and countdown time. The system consists of single chip I/O port expansion system, the traffic
5、light state display system, LED digital display system, the reset circuit and components. In addition to the basic traffic light function, but also has a countdown function, to achieve a better simulation of the situation that may arise at a crossroads. Keywords: traffic lights; AT89S52; I/O; LED 目目
6、 录录 1 设计课题设计要求及总体方案介绍. 1 1.1 设计课题任务. 1 1.2 功能要求说明. 1 1.3 交通灯总体方案介绍及工作原理说明. 1 2 交通灯硬件系统的设计 3 2.1 交通灯硬件系统各模块功能简要介绍. 3 2.2 交通灯电路原理图、PCB 图、元器件分布图 . 4 2.3 交通灯元器件清单 4 3 交通灯软件系统的设计. 5 3.1 单片机资源使用情况 5 3.2 软件各模块简要介绍 5 3.3 交通灯程序流程图 5 3.4 交通灯设计程序清单 7 4 交通灯设计结论. 8 4.1 使用说明. 8 4.2 系统调试. 8 4.4 设计体会 8 结束语 9 致 谢 10 参考文献 11 附录 A:PCB 图 . 12 附录 B:元器件分布图 13 附录 C:元器件清单 14 附录 D:程序清单 15 1 1 设计课题设计要求及总体方案介绍设计课题设计要求及总体方案介绍 1.1 设计课题任务设计课题任务 设计一个具有特定功能的十字路