基于FPGA的交通灯设计
摘要
交通信号指示灯是城市中交通指挥疏导中不可缺少的智能工具。以前用到的大多数交通灯的控制系统都是采用单片机或者PLC进行设计开发的。本文将采用VHDL硬件描述语言来论述各模块代码,并在Quartus II开发环境下进行编译,在硬件板子上进行调试和演示。在计算机上运行成功并生产生成顶层文件后下载在FPGA器件EP2C5T144开发板子上进行验证。通过调试结果显示,本文的设计完全可以满足现在交通指挥的需求,包括时间提示显示、相关状态控制和主、支干道的红、黄、绿灯交替显示功能。本文在交通灯控制的基础上,对硬件描述语言以及其设计流程做了简单介绍。
EDA工具是一种十分重要的VHDL语言开发工具,它是一款能够对设计过程中任何一个环节或者阶段进行计算机模拟的强大工具,因而,该工具能够确保准确的设计,减少设计周期,大大降低成本。基于FPGA的交通灯控制器具有较高的可靠性、擦写迅速、高效的运算能力、故障少、设计简单、质量轻以及体积不大等优势。本次设计将采用EP2C5T144最小系统开发板,因为它的体积不大,可以轻松嵌入到外围电路中,完全可以快速进行逻辑判断,数据计算以及系统运算等。本文采用QuartusII软件进行开发,运用自顶向下的新型设计方法。
关键词:自动、逻辑、交通灯、EDA、FPGA
-I-
基于FPGA的交通灯设计
Abstract
Traffic light controller plays a very important role in the regulation of urban traffic. The traditional traffic light controller is based on single-chip microcomputer or PLC. This paper introduces a scheme based on FPGA technology and II Quartus development platform to realize the intersection traffic light controller. Using VHDL hardware description language description of the module program, and in the II Quartus environment to compile, simulate, generate the top level files downloaded in the FPGA device EPF10K10LC84 FLEX for verification. The verification results show that the basic design to achieve the control of traffic light controller, including the countdown time display function and main function, the special state control, a road of red, yellow, and green light display function alternately, indicating that the design scheme is correct. In this paper, the design process of the traffic light controller, and briefly introduces the hardware description bright prospect in the digital system design of VHDL language structure model and process design, VHDL design advantages and the language and an important position.
EDA tools for electronic design personnel is extremely important, it can in each stage of electronic design, the level of computer simulation and verification, to ensure the design accuracy and can shorten the design cycle and reduce design cost. Can realize the automatic control of traffic lights crossroads traffic lights. Based on the FPGA design of traffic lights system has high reliability, real-time flash, high operation speed, the failure rate is low, the circuit is simple, and the volume is small. This design uses Altera cycloneii series ep2c5t144 chip as the core of the minimum system, it can easily embed into the actual traffic lights application system, can realize the function of the simple logic control, data acquisition, signal processing and mathematical computing; using QuartusII software as a development platform; using top-down design Keywords: automatic, logic, traffic lights, EDA, FPGA
-II-
基于FPGA的交通灯设计
目录
摘要 .................................................................................................... I Abstract .......................................................................................... II 目录 ................................................................................................. III 前言 ................................................................................................... 1 1 绪论 ............................................................................................... 2 1.1论文研究背景及意义 .............................................................. 2 1.2 FPGA开发的历史及简介 ....................................................... 3 1.3 EP2C5T144最小系统介绍 ..................................................... 4 1.4 本文研究的主要内容 ............................................................. 5 2 硬件设计 ....................................................................................... 7 2.1硬件开发环境介绍 .................................................................. 7 2.2硬件开发环境平台搭建 .......................................................... 7 2.3原理图设计 ............................................................................ 12 3 软件设计 ..................................................................................... 16 3.1软件开发平台介绍 ................................................................... 16 3.2软件开发平台搭建 ................................................................... 17 3.3程序设计 ................................................................................... 18 3.3.1 程序设计分析 .................................................................... 18 3.3.2 程序设计中需要注意的问题 ............................................ 19 4 实物模型展示 ............................................................................. 23 4.1 实物模型介绍 .......................................................................... 23 4.2 实物模型演示方法 .................................................................. 24 4.2 仿真说明 .................................................................................. 24
-III-
基于FPGA的交通灯设计
总结 ................................................................................................. 26 参考文献 ......................................................... 错误!未定义书签。 致谢 ................................................................. 错误!未定义书签。 附件1 部分程序源代码 ................................ 错误!未定义书签。
-IV-
基于FPGA的交通灯设计
前言
交通灯控制指挥系统,其本质就是规范和管理行人和车辆穿越路口的行为,从确保人和车辆能够安全、快速、合理和有效通过。在现在,交通灯控制器安装在各个路口上,大大提高了路口行人和车辆的通行安全性和规范性,减少了交通事故的发生几率。目前实现交通灯控制有很多方案,比如采用PLC[1](可编程序控制器)、标准逻辑器件、51单片机[2]等方案来进行开发。若采用单片机平台进行开发设计,其大致电路框架包括基于单片机的主控电路、电源电路、显示电路和无线收发控制电路四个部分组成。控制电路的芯片为51单片机或者STC单片机都可以。同时需要一个3.3V或者5.5CV的DCDC,数码管显示电路和无线收发控制电路是由数据发射模块和编码芯片两部分组成。电路设计相对复杂不说,而且还需要进行软件的设计。虽然基于单片机的交通灯控制系统具有运行稳定,功能较多,灵活性比较好等优势,但是任然存在许多问题。特别是电路的修改比较花费时间,设计比较繁琐,在一定程度下增加了设计成本和维护周期。可编程控制器PLC的优势在于是可靠性较好和稳定性较高,但是其也有诸多问题。PLC是一个封闭的结构,所以不同PLC控制器的兼容性较差,而且不同的PLC在程序设计上也存在着差异。这就意味着,一旦选择一种PLC之后,就只能按照该型号PLC的相关方式进行编编程,而且需要学习相关的设计语言规律,这些问题大大的的限制了PLC的灵活性和多元性。与前两者相比,基于FPGA的开发方案,不仅具有很好灵活性,稳定性,而且编程语言是完全统一性,而且更简单和稳定。因而,此次交通灯的控制器开发设计采用基于VHDL语言,FPGA的方式进行设计,不仅经济节约和而且更加可靠稳定。其开发设计也相对更加简单,故障维护也比较容易,更加适合目前城市交通指挥的需求。
-1-