我要做一个基于FPGA的AD转换程序设计 请问那个高手能帮忙指点一下啊不胜感激

如题所述

1.先读懂选用的AD转换芯片手册,了解其控制时序和数据传输的方式。
2.了解一下FPGA状态机的编制方法。
3.设计一个状态机,循环输出AD转换芯片控制引脚的逻辑信号,并于循环中,在AD芯片准备好数据后,读取总线上的数据保存到FPGA的寄存器中。
一般的一个循环是:使能信号通道让模拟信号进入AD芯片->发出AD芯片开始转换信号->(等待转换时间)读取总线上的数据保存到FPGA的寄存器,下一个循环。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-11-25
FPGA是不能实现DA转换的,它内部处理的都是数字信号,不能输出模拟信号。一般是用FPGA控制系统工作流程,产生控制信号,DSP输出数字信号处理后得到的数字信号,经专门的DA芯片,如PCM1798、1794、AD1955、CS4398、AK4396、AK4399等等,FPGA只能实现特定类型的脉冲,如下:
library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

entity dac_ds is

port(reset :in std_logic;

clk :in std_logic;

din :in std_logic_vector(7 downto 0);--Signed integer

dout :out std_logic);

end dac_ds;

architecture arch_dac_ds of dac_ds is

signal error :std_logic_vector(9 downto 0);--Error accumulator is 2 bits larger

constant zeros:std_logic_vector(7 downto 0):=(others=>'0');

begin

process(reset,clk,din)

variable val :std_logic_vector(9 downto 0);

begin

if reset='1'then

error<=(others=>'0');

dout<='0';

elsif clk'event and clk='1' then

--val:=din+error;din is sign extended to nbits+2

val:=(din(din'high)&din(din'high)&din)+error;

if val(val'high)='0'then

dout<='1';

error<=val+("11"& zeros);

else

dout<='0';

error<=val+("01"&zeros);

end if;

end if;

end process;

end arch_dac_ds
第2个回答  2011-11-24
一般的fpga没有模拟输入接口,恐怕做不了AD转化,需要外接AD芯片,你用的什么型号的fpga?本回答被提问者采纳
相似回答