交通灯单片机控制系统设计.doc
毕业设计说明书GRADUATE DESIGN设计题目:交通灯单片机控制系统设计学生姓名: 专业班级: 学 院:指导教师:欲得本设计全部资料 QQ 摘要近年来随着科技的飞速发展,单片机的应用不断深入,带动传统控制技术日益更新。在实时和自动控制的单片机应用系统中,单片机往往作为一个核心部件使用,承担控制的主要任务。同时,还要根据具体的功能要求配以各种外部设备共同完成使命。此时,仅单片机方面知识是不够的,还应根据具体硬件结构软硬件结合,达到最优设计。 十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。靠什么来实现这井然秩序呢?靠的就是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本系统采用PIC16F87X系列单片机中档系列中的PIC16F877和I/O目前常用的三态8D锁存器74LS373、可编程并行接口芯片8255A作为中心器件来设计十字路口交通灯控制器,实现了能根据实际车流量人为通过单片机的B端口设置东西南北两方向的红绿灯燃亮时间,进行实时的交通控制确保畅通;红绿灯循环点亮,倒计时两秒时相应颜色灯闪烁,随后黄灯警示;紧急车辆通行时,其他车辆禁止通行等功能。另外也对车辆直行道设置的人行道口处交通灯控制进行了设计,除了采用常用控制方式还增加了报警器警示远距离车辆减速来保证道路交通的安全。本系统实用性强、操作简单、扩展功能强。 关键词:PIC单片机;交通灯;实时控制;通行时间修改;紧急车辆通行;十字路口;人行道AbstractIn recent years, with the rapid development of science and technology, SCM applications are continually deepening, and promote the traditional control skills updated. In real-time control and the MCU applications, MCU is often used as a core component, assume control of the main tasks. At the same time, but also based on specific functional requirements supported by various external equipment common to complete the mission. At this point, only SCM knowledge is not enough, but also based on specific hardware and software combination of hardware structure, to achieve optimal design. Crossroads of the shuttle vehicles, pedestrians crowed, companies lanes, people walkways, in an orderly manner. What then oral order to achieve this?Is the traffic lights on the automatic command system. There are many ways to control traffic lights. The system uses PIC16F87X MCU midrange series of PIC16F877 and I / O now commonly used three-state 8 D latch 74 LS373, programmable chips 8255 A parallel interface device designed as the central controller of traffic lights, can be achieved in accordance with B actual traffic flow through the port settings are things the two north-south direction of traffic lights shine time, real-time traffic control to ensure smooth; cycle traffic lights lit, the countdown to two seconds at the corresponding color lights flashing, and then yellow light warning; when emergency vehicles. , To prohibit passage of other vehicles, and other functions. The system practical, simple, strong expansion. KeyWords:PIC Microcontroller, Traffic lights, Real-time, control Crossing will be amended, Emergency vehicles目录1引言11.1交通灯的发展11.2单片机的概述22 交通灯控制系统的方案设计分析32.1交通灯控制系统的功能分析32.1.1十字路口交通灯控制系统32.1.2人行道口交通灯控制系统42.2交通灯制系统的功能设计要求分析42.3总体方案设计52.3.1 十字路口交通灯控制方案设计52.3.2 人行道口交通灯控制方案设计63 交通灯控制系统硬件电路设计83.1 电路模块设计原则83.2十字路口交通灯控制电路设计93.2.1主控制模块93.2.2复位模块113.2.3时钟振荡电路模块123.2.4显示模块133.2.5 I/O端口模块173.2.6控制时间调整外部电路模块203.3人行道口交通灯控制电路设计234 交通灯控制系统软件设计254.1十字路口交通灯系统软件模块设计254.1.1主模块设计254.1.2 中断服务模块设计274.1.3显示模块设计334.1.4 其它小型常用子程序模块344.2人行道口交通灯控制软计模块设计364.2.1主控制模块设计364.2.2中断模块设计364.3软件可靠性措施365 系统的组装与调试385.1 硬件系统的组装与调试385.1.1 断电调试385.1.2 通电调试385.2 软件系统的调试39结 论41参考文献42致 谢44附录A交通灯控制程序45