脉冲信号发生器设计.docx

上传人:b****6 文档编号:16682469 上传时间:2023-07-16 格式:DOCX 页数:13 大小:149.95KB
下载 相关 举报
脉冲信号发生器设计.docx_第1页
第1页 / 共13页
脉冲信号发生器设计.docx_第2页
第2页 / 共13页
脉冲信号发生器设计.docx_第3页
第3页 / 共13页
脉冲信号发生器设计.docx_第4页
第4页 / 共13页
脉冲信号发生器设计.docx_第5页
第5页 / 共13页
脉冲信号发生器设计.docx_第6页
第6页 / 共13页
脉冲信号发生器设计.docx_第7页
第7页 / 共13页
脉冲信号发生器设计.docx_第8页
第8页 / 共13页
脉冲信号发生器设计.docx_第9页
第9页 / 共13页
脉冲信号发生器设计.docx_第10页
第10页 / 共13页
脉冲信号发生器设计.docx_第11页
第11页 / 共13页
脉冲信号发生器设计.docx_第12页
第12页 / 共13页
脉冲信号发生器设计.docx_第13页
第13页 / 共13页
亲,该文档总共13页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

脉冲信号发生器设计.docx

《脉冲信号发生器设计.docx》由会员分享,可在线阅读,更多相关《脉冲信号发生器设计.docx(13页珍藏版)》请在冰点文库上搜索。

脉冲信号发生器设计.docx

脉冲信号发生器设计

脉冲信号发生器

摘要:

本实验是采用fpga方式基于AlterCyclone2EP2C5T144C8的简易脉冲信号发生器,可以实现输出一路周期1us到10ms,脉冲宽度:

0.1us到周期-0.1us,时间分辨率为0.1us的脉冲信号,并且还能输出一路正弦信号(与脉冲信号同时输出)。

输出模式可分为连续触发和单次手动可预置数(0~9)触发,具有周期、脉宽、触发数等显示功能。

采用fpga计数实现的电路简化了电路结构并提高了射击精度,降低了电路功耗和资源成本。

关键词:

FPGA;脉冲信号发生器;矩形脉冲;正弦信号;

1方案设计与比较

脉冲信号产生方案:

方案一、采用专用DDS芯片的技术方案:

目前已有多种专用DDS集成芯片可用,采用专用芯片可大大简化系统硬件制作难度,部数字信号抖动小,输出信号指标高;但专用芯片控制方式比较固定,最大的缺点是进行脉宽控制,测量困难,无法进行外同步,不满足设计要求。

方案二、单片机法。

利用单片机实现矩形脉冲,可以较方案以更简化外围硬件,节约成本,并且也可以实现灵活控制、能产生任意波形的信号发生器。

但是单片机的部时钟一般是小于25Mhz,速度上无法满足设计要求,通过单片机产生脉冲至少需要三条指令,所需时间大于所要求的精度要求,故不可取。

方案二:

FPGA法。

利用了可编程逻辑器件的灵活性且资源丰富的特点,通过Quartus软件的设计编写,实现脉冲信号的产生及数控,并下载到试验箱中,这种方案电路简单、响应速度快、精度高、稳定性好故采用此种方案。

2理论分析与计算

脉冲信号产生原理:

输入量周期和脉宽,结合时钟频率,转换成两个计数器的容量,用来对周期和高电平的计时,输出即可产生脉冲信号。

脉冲信号的精度保证:

时间分辨率0.1us,周期精度:

+0.1%+0.05us,宽度精度:

+0.1%+0.05us,为满足精度要求,所以所选时钟频率至少1/0.05us=20MHZ,由于试验箱上大于10MHZ只有50MHZ,故选时钟信号50MHZ,此时精度1/50MHZ=0.02us<0.05us,满足精度要求。

正弦信号产生原理:

正弦信号的产生由DDS原理实现,频率由频率控制字M和时钟周期Fc决定,M=Fout*2^N/Fc,Fout=1/T,N即为相位累加器的位数,化简锝M=2^N/(5*T),即说明可以通过输入量周期控制正弦的频率,与脉冲达到同周期。

3程序设计

3.1系统框图如图3-1所示。

按键

输入

周期、脉冲二进制输出模块

脉宽、周期值

高、低电

平计数

脉冲

输出

计算模块

高低分位

显示查找表

周期值

M值运算模块

M值

+

相位累加器

DAC

正弦波形

相位存储器

正弦查找表

十进制显示

图3-1系统框图

按键输入模块:

通过不同的按键切换周期和脉宽、高低位输入数据。

(vhdl语言见附录1)

图3-2按键输入模块

显示模块:

采用查询ROM表的方法,二进制数值通过一个ROM表显示为十进制数值,在数码管上显示。

(Vhdl及rom表见附录2)

图3-3显示模块

高低电平计数模块:

计数器接时钟脉冲50MHZ,即每次计数0.02us,5次计数为0.1us,即为实验要求的时间精度0.1us,通过置入周期和脉宽放大5倍(周期和脉宽均以0.1us为单位)便可产生高低脉冲信号。

(Mk模块vhdl见附录三)

图3-4脉冲信号产生模块

正弦信号产生模块:

由DDS原理产生,频率控制字M=Fout*2^N/Fc,Fout=1/T,N即为相位累加器的位数,化简得M=2^N/(5*T),再通过相位累加器查找正弦ROM表,便可产生正弦信号,正弦信号的周期即为T,与脉冲信号同周期。

(reg29、dm1、正弦rom见附录四)

图3-5正弦信号产生模块

整体电路连接:

(见附录五)

4作品测试

4.1测试仪器

TDS1002型60MHZ10GS/s双通道数字存储示波器,系统试验箱。

4.2测试方案

控制时钟:

50MHz

按键操作:

Key1:

十分位、百位计数使能;Key2:

个位、千位计数使能;key3:

十位、万位计数使能;key4:

高三位低三位切换;key5:

脉宽、周期切换;key6:

脉宽周期输入脉冲;Key7:

猝发脉冲计数按键;key8:

系统清零键;key3与key2同时按下切换至单猝发方式;key3、2、1同时按下但猝发脉冲发射。

测试方法:

按键输入脉宽和周期,经过示波器观察测量正弦和脉冲周期以及脉宽,记录数据制4.3表格,切换猝发方式后继续用示波器进行单猝发计数测试。

4.3测试结果

输入

周期

输入

脉宽

显示

脉宽

脉宽

误差

显示

周期

周期

误差

上升

时间

正弦周期

幅度

猝发模式状态下输入数据N,示波器显示输出N个脉冲和正弦信号;波形图见附录6

4.4结果分析

系统在输出脉冲脉宽、周期和正弦波以及猝发脉冲等指标达到题目的基本和发挥部分要求,各项指标测量精度高,整体性能达到题目发挥部分要求。

5总结

本系统以fpga作为系统的核心控制器件,以系统试验箱为平台,具有1us-10ms的方波脉冲发生和正弦脉冲发生功能,同时具有1-9固定数量脉冲单猝发功能,具有精度较高速度快的特点,所有指标均达到或部分超过赛题要求。

 

附录

附件1:

按键输入模块

libraryieee;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_1164.all;

entityxianshiis

port(cp,change,clr,hl,aj1,aj2,aj3:

instd_logic;

zq,mk:

outstd_logic_vector(16downto0));

endxianshi;

architectureoneofxianshiis

signalm:

std_logic_vector(16downto0);

signaln:

std_logic_vector(16downto0);

begin

process(cp,change,clr,hl,aj1,aj2,aj3)

begin

ifclr='1'then

m<="00000000000000000";n<="00000000000000000";

elsifcp'eventandcp='1'then

ifchange='0'andhl='0'then

ifaj1='1'thenm<=m+1;endif;

ifaj2='1'thenm<=m+10;endif;

ifaj3='1'thenm<=m+100;endif;

endif;

ifchange='0'andhl='1'then

ifaj1='1'thenm<=m+1000;endif;

ifaj2='1'thenm<=m+10000;endif;

ifaj3='1'thenm<=m+100000;endif;

endif;

ifchange='1'andhl='0'then

ifaj1='1'thenn<=n+1;endif;

ifaj2='1'thenn<=n+10;endif;

ifaj3='1'thenn<=n+100;endif;

endif;

ifchange='1'andhl='1'then

ifaj1='1'thenn<=n+1000;endif;

ifaj2='1'thenn<=n+10000;endif;

ifaj3='1'thenn<=n+100000;endif;

endif;

endif;

zq<=m;

mk<=n;

endprocess;

endone;

 

附件2:

libraryieee;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_1164.all;

entitychgis

port(change:

instd_logic;

zq,mk:

instd_logic_vector(16downto0);

xs:

outstd_logic_vector(16downto0));

endchg;

architectureoneofchgis

begin

process(change)

begin

ifchange='0'then

xs<=zq;

else

xs<=mk;

endif;

endprocess;

endone;

libraryieee;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_1164.all;

entityhhllis

port(hl:

instd_logic;

h:

instd_logic_vector(16downto0);

l:

instd_logic_vector(9downto0);

xxss:

outstd_logic_vector(9downto0));

endhhll;

architectureoneofhhllis

begin

process(hl)

begin

ifhl='0'then

xxss<=l;

else

xxss<=h(9downto0);

endif;

endprocess;

endone;

显示rom表

附件3:

mk

libraryieee;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_1164.all;

entitymkis

port(clk:

instd_logic;

t,k:

std_logic_vector(19downto0);

f:

outstd_logic);

endmk;

architectureoneofmkis

signalm:

std_logic_vector(19downto0);

begin

process(clk,t,m)

begin

ifclk'eventandclk='1'then

m<=m+1;

ifm>=tthen

m<="00000000000000000001";f<='0';

elsifm<=kthen

f<='1';

elsef<='0';

endif;

endif;endprocess;

endone;

附件4:

Reg29

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

entityreg29is

port(d:

instd_logic_vector(31downto0);

clk:

instd_logic;

q:

outstd_logic_vector(31downto0));

endreg29;

architectureoneofreg29is

begin

process(clk,d)

begin

ifclk'eventandclk='1'then

q<=d;

endif;

endprocess;

endone;

dm1

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

entitydm1is

port(q:

instd_logic_vector(9downto0);

si:

instd_logic_vector(16downto0);

f:

outstd_logic_vector(9downto0));

enddm1;

architectureoneofdm1is

begin

process(si,q)

begin

ifsi="00000000000000000"thenf<="0000000000";

elsef<=q;

endif;

endprocess;

endone;

正弦rom

附件五:

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2