单片机交通灯课程设计报告 下载本文

内容发布更新时间 : 2024/5/18 8:34:46星期一 下面是文章的全部内容请认真阅读。

单片机课程设计

题 目:基于单片机的智能交通灯的设计

学 院 机电与信息工程学院 专 业 电子信息工程 年 级 2015级 学 号172015114006、

172015114029

姓 名 张晋笙、张榜 指 导 教 师 邓凌云 成 绩

2017年 12 月 27 日

1

摘要

随着社会主义的建设,城市的规模在不断扩大,城市的交通也在不断的提高和改进,交通的顺畅已经成为制约社会主义建设的一个重要因素。本系统采用单片机AT89S52来设计交通灯控制器,实现了能根据实际车流量通过AT89S52芯片的P1口设置红、绿灯燃亮时间的功能;红绿灯循环点亮,倒计时剩5秒时黄灯闪烁警示。本系统实用性强、操作简单、扩展功能强。 关键词: AT89S52单片机;交通灯;倒计时;时间显示

Abstract

With the construction of socialism, the city scale in expanding constantly, urban traffic is also in constant improvement and improvement, traffic flow restriction of socialist construction has become one of the important factors. The system USES the monolithic integrated circuit ATAT89S52 to design and realize the traffic light controller can according to actual traffic through the mouth AT89S52 chip set red, green P1 burning time function; Traffic lights circulation lighted, with 5 seconds countdown yellow lights flashing warning. This system is practical, simple operation and function expansion is strong.

Keywords: AT89S52 microcontroller, Traffic lights, The countdown, Time display

2

目录

第一章 绪 论----------------------------------------------5 1.1背景----------------------------------------------- 5 1.2单片机概述 ----------------------------------------5 1.3 目的与意------------------------------------------5 1.4方案的设计与论证-----------------------------------6 第二章 总体设计---------------------------------------- 6 2.1总体设计-------------------------------------------6 2.2 单片机的选择-------------------------------------- 7 第三章 硬件设计 ----------------------------------------9 3.1 最小系统------------------------------------------9 3.2 按键电路-----------------------------------------10 3.3 显示模块电路设计---------------------------------10 3.4 pcb图-------------------------------------------11 第四章 交通信号灯控制系统的设计(软件设计)--------------12

4.1 十字路口交通信号灯具体的控制要求------------------12 4.2十字路口交通信号灯示意图---------------------------12 4.3 软件设计应用环境--------------------------------- 13 4.4 软件设计流程------------------------------------- 14 4.5 程序分段作用解释----------------------------------16 4.6 仿真----------------------------------------------16 第五章 参考文献-------------------------------------- 17

3