目录前言...............................................................1 第一章 FPGA及Verilog HDL..........................................2 1.1 FPGA简介.....................................................2 1.2 Verilog HDL 概述.............................................2 第二章数字频率计的设计原理........................................3 2.1 设计要求.....................................................3 2.2 频率测量.....................................................3 2.3.系统的硬件框架设计..............................................4 2.4系统设计与方案论证............................................5 第三章数字频率计的设计............................................8 3.1系统设计顶层电路原理图........................................8 3.2频率计的VHDL设计.............................................9 第四章软件的测试...............................................15 4.1测试的环境——MAX+plusII.....................................15 4.2调试和器件编程...............................................15 4.3频率测试.....................................................16基于FPGA的等精度频率计的设计与实现摘要:本文详细介绍了一种基于FPGA的高精度频率计。
首先论文概述了等精度测量频率的原理,该原理具有在整个测试频段内保持高精度频率测量的优点。
对于频率测量的一些主要参数、技术进行了讨论。
同时在该原理基础上,利用VHDL语言设计实现频率计内部功能模块;采用AT89S52单片机进行数据运算处理,利用液晶显示器对测量的频率、占空比等进行实时显示,可读性好;还使用C语言设计了该等精度频率计的主控程序以提高测量精度。
充分发挥FPGA的高速数据采集能力和单片机的高效计算与控制能力,使两者有机地结合起来。
在MUX+PULSⅡ EDA(电子设计自动化)开发平台上进行仿真、测试、并最终下载到FPGA芯片内部。
本设计实现了对频率变化范围较大的信号进行频率测量,能够满足高速度、高精度的测频要。
文章的最后总结了整个系统的性能和特点,提出了值得进一步研究和优化的地方,并展望了其应用前景。
利用等精度测量原理,通过FPGA 运用VHDL编程设计一个数字式频率计,精度范围在DC~100 MHz,给出实现代码和仿真波形。
设计具有较高的实用性和可靠性。
关键词:FPGA;等精度;频率计;VHDLDesign and Realization ofFrequency Meter with EqualPrecisionMeasurementon FPGAElectrical engineering and automation xu gangTutor yan shao minAbstract:This paper describes an FPGA-based high-precision frequency counter. First of all, such as paper provides an overview of the principle of frequency measurement accuracy, the principle of the test in the whole band has to maintain the advantages of high precision frequency measurement. Frequency measurement for some of the key parameters, technology is discussed. At the same time, based on the principle of the use of VHDL language design and implementation of the internal functions of the frequency module; using AT89S52 Single-chip data processing, the use of liquid crystal display of the measured frequency, duty cycle, such as real-time display, good readability; Also designed using the C language of the accuracy of frequency control procedures to enhance measurement accuracy. Give full play to the FPGA's high-speed data acquisition capabilities and high-performance single-chip computation and control, so that the two combine. In MUX + PULS Ⅱ EDA (electronic design automation) simulation platform to develop, test, and ultimately downloaded to the FPGA chip. Design and Implementation of the changes in the frequency range of signal frequency measurement, to meet the high-speed, high-precision frequency measurement should be. The lastarticle summarizes the overall system performance and characteristics of a worthy of further study and optimization of the place, and look forward to the prospect of its application.A digitalfrequency meter isdesigned by using equalprecision measurementtheory,pass FPGA and program projectonVHDL in this paper.The frequency meter′precision extension is DC~100 MHz.The paper give realization code and simulationwaveform,the system have upper practicability and dependability.Keywords:FPGA;equalprecision measurement;frequency meter;VHDL1. 前言1.1课题研究的目的和意义在电子技术中,频率是最基本的参数之一,并且与许多电参量的测量方案、测量结果都有十分密切的关系,因此,频率的测量就显得更为重要。
测量频率的方法有多种,其中电子计数器测量频率具有精度高、使用方便、测量迅速,以及便于实现测量过程自动化等优点,是频率测量的重要手段之一。
数字式频率计的测量原理有两类:一是直接测频法,即在一定闸门时间内测量被测信号的脉冲个数;二是间接测频法即测周期法,如周期测频法。
直接测频法适用于高频信号的频率测量,通常采用计数器、数据锁存器及控制电路实现,并通过改变计数器阀门的时间长短在达到不同的测量精度;间接测频法适用于低频信号的频率测量,本设计中使用的就是直接测频法,即用计数器在计算1S内输入信号周期的个数。
数字频率计是数字电路中的一个典型应用,实际的硬件设计用到的器件较多,连线比较复杂,而且会产生比较大的延时,造成测量误差、可靠性差。
随着现场可编程门阵列FPGA的广泛应用,以EDA工具作为开发手段,运用Verilog HDL等硬件描述语言语言,将使整个系统大大简化,提高了系统的整体性能和可靠性。
1.2基于FPGA的等精度频率计的发展现状采用FPGA现场可编程门阵列为控制核心,通过硬件描述语言Verilog HDL编程,在MAX+PLUSII仿真平台上编译、仿真、调试,并下载到FPGA芯片上,通过严格的测试后,能够较准确地测量方波、正弦波、三角波、矩齿波等各种常用的信号的频率,而且还能对其他多种物理量进行测量。
现场可编程门阵列FPGA(Field Programmable GateArray)属于ASIC产品,通过软件编程对目标器件的结构和工作方式进行重构,能随时对设计进行调整,具有集成度高、结构灵活、开发周期短、快速可靠性高等特点,数字设计在其中快速发展。
1. FPGA及Verilog HDL1.1 FPGA的简介:FPGA是英文Field Programmable Gate Array 的缩写,即现场可编程门阵列,它是在PAL、GAL、EPLD等可编程器件的基础上进一步发展的产物。
它是作为专用集成电路(ASIC)领域中的一种半定制电路而出现的,既解决了定制电路的不足,又克服了原有可编程器件门电路数有限的缺点。
FPGA采用了逻辑单元阵列LCA(Logic Cell Array)这样一个新概念,内部包括可配置逻辑模块CLB(Configurable Logic Block)、输出输入模块IOB(Input Output Block)和内部连线(Interconnect)三个部分。