基于FPGA的VGA接口设计 精品 下载本文

I

基于FPGA的VGA接口设计

摘 要

VGA(Video Graphics Array 视频图形阵列)是一种标准的显示接口。伴随着嵌入式系统的迅速发展,尤其是高速图像处理的发展,对可以将实时图像处理进行显示有了更多的需求。VGA广泛应用于机场、车站等公共场所的广告宣传和文字提示。本文基于Altera公司的Cyclone II系列FPGA(现场可编程门阵列)、依据VGA接口时序采用Verilog HDL语言设计了VGA显示模块,并验证了设计结果。通过采用FPGA设计VGA 接口使系统具有成本低、结构简单、应用灵活的优点。 关键词:FPGA,VGA接口,Verilog

II

Design of VGA Interface Based on FPGA

ABSTRACT

As a standard display interface, VGA has been widely used. As the fast development of embedded system, especially the development of high speed image processing, there are more and more need in displaying the result of the process in real time. VGA is widely used in airports, railway stations and other public places advertising and text prompts .The design of VGA display interface and control module is introduced in this paper which based on Altera's Cyclone II series FPGA, according to the principle of VGA display, an interface of VGA with the Verilog HDL is designed. VGA Interface through the use of FPGA design the system with low cost, simple structure, flexible application advantages. KEY WORDS: FPGA,VGA Interface ,Verilog

III

目 录

摘 要 .................................................................... I ABSTRACT ................................................................ II 1 概述 ................................................................... 1

1.1 选题背景 .......................................................... 1 1.2 发展趋势 .......................................................... 2 1.3 研究方法和手段 .................................................... 3 1.4 研究预期成果 ...................................................... 4 2 硬件电路设计 ........................................................... 5

2.1 系统整体结构框架 .................................................. 5

2.1.1 系统硬件结构 ................................................ 5 2.1.2 系统拓展硬件结构 ............................................ 5 2.2 总体设计原理图 .................................................... 6 2.3 主控制器固件模块 .................................................. 7

2.3.1 DE2开发板介绍 ............................................... 7 2.3.2 Cyclone Ⅱ系列芯片介绍 ...................................... 8 2.3.3 外部时钟 .................................................... 9 2.4电源模块 ......................................................... 10 2.5 D/A转换电路模块 ................................................. 10

2.5.1 ADV7132视频D/A转换器 ...................................... 10 2.6 VGA显示模块 ..................................................... 12

2.6.1 VGA接口 .................................................... 12 2.6.2 VGA常用模式 ................................................ 13 2.6.3 VGA工作原理 ................................................ 13 2.6.4 RGB数据帧的结构 ............................................ 15

3 固件代码设计 .......................................................... 16

3.1. Quartus Ⅱ及Verilog语言介绍 .................................... 16

3.1.1 Quartus Ⅱ软件介绍 ......................................... 16 3.1.2 Verilog HDL语言介绍 ........................................ 17 3.2 VGA代码设计 ..................................................... 17

3.2.1 VGA的显示时序程序 .......................................... 18 3.2.2 时钟、频率程序 ............................................. 21 3.2.3 SRAM程序 ................................................... 22