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+errordin
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
不知道你具体想要干什么,只能简单说下:根据你的设计需求选取一个DA芯片(问老师),每个芯片都有配套的手册,上面写了使用方法,包括输入输出管脚,输入输出瞎团信号的格式,每个管脚磨链橘的外围电路唤拿怎么连,最重要的提供芯片的内部配置(就是配置DA芯片的寄存器)。自己编写硬件描述语言配准DA芯片,FPGA连接DA。比如我现在用的CH7301是DVI接口的DA芯片,使用VHDL语言,根据IIC总线协议配置 CH7301的工作方式。 还是比较麻烦的。
FPGA与D/A的接口属于,芯片与芯片之间的接口念坦笑,接口总线有1内部总线
(I2C
SPI)是芯片与芯片之间的接口
2系统总线
PCI
是板子仔含与板子之间的接口
3外部总线
RS232
是通信设备之间的接口
所以你要多看看
SPI的知识。
然后用quartus写个具体的SPI程序(verilog
VHDL)或者调用一个信仔IP核
自己修改。
AD
DA转换芯片的性能指标参数差别大,因此接口格式无法统一。基本上
有标准接口和特殊接口(高速的AD
DA采用LVDS差分信号电平标准)。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)