1、 1 单片机原理及应用 课程设计报告 题 目:交通灯控制系统的设计 专 业:电子信息工程 年 级: 学 号: 学生姓名: 联系电话: 指导老师: 完成日期: 2012 年 1 月 6 日 2 交通灯控制系统的设计 摘要 本系统采用单片机 AT89S52 为中心器件来设计交通灯控制器, 系统实用性强、 操作简单、扩展性强。本设计就是采用单片机模拟十字路口交通灯的各种状态显 示以及倒计时时间。 本设计系统由单片机 I/O 口扩展系统、 交通灯状态显示系统、 LED 数码显示系统、复位电路等几大部分组成。系统除基本的交通灯功能外,还 具有倒计时等功能,较好的模拟实现了十字路口可能出现的状况。软件上采
2、用 C51 编程,主要编写了主程序,LED 数码管显示程序,中断程序延时程序等。 关键字: AT89S52 LED 交通灯 倒计时 ABSTRACT Single chip microcomputers are microcomputer as an important branch, is also a vitality of the model. Single chip microcomputer hereinafter referred to as the single chip microcomputer, is particularly applicable to control f
3、ield, so it is also called the micro controller. Usually, the single piece of single chip microcomputer integrated circuit chips, which contains internal the basic function of computer parts: the central processor, memory and I/O interface circuit, etc. Therefore, SCM only need and the appropriate s
4、oftware and external equipment combination, can become a single-chip microcomputer control system. The system USES the monolithic integrated circuit AT89S52 devices for the center to designing traffic light controller, the single chip microcomputer simulation crossroads of various states of the traf
5、fic lights and the countdown show time. This design by single-chip microcomputer system I/O mouth extended system, traffic lights state display system, LED digital display system and reset circuit as a major part. System besides basic traffic lights function outside, still have the countdown, and ot
6、her functions, good simulation realized the crossroads scenario. This system is practical, simple operation and strong function expansion. Key Words:SCM traffic lights traffic detection 3 目录目录 摘要. 2 ABSTRACT . 2 1 设计要求及方案选择. 4 1.1 设计要求 4 1.2 方案选择 4 2 理论分析与设计 4 2.1 主控电路的设计与分析. 4 2.2 支路电路的设计与分析. 5 3 电路设计 5 3.1 硬件电路的设计 . 5 3.2 软件的设计 7 4 系统测试 .16 4.1 调试所用的基本仪器清单 .16 4.2 调试结果 .16 4.3 测试结果分析 16 5 总结 .17 参考文献.17 4 1 设计要求及方案选择 1.1 设计要求 (1)完成