资源预览内容
第1页 / 共11页
第2页 / 共11页
第3页 / 共11页
第4页 / 共11页
第5页 / 共11页
第6页 / 共11页
第7页 / 共11页
第8页 / 共11页
第9页 / 共11页
第10页 / 共11页
亲,该文档总共11页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
A/D转换器概述 A/D转换器是一种能把输入模拟电压或者电流变换为与之成正比的数字量,既把被控制的对象的各种模拟信息转换为计算机可以识别的数字量。 根据转换原理可分为四种,即:计数式A/D转换器、双积分式A/D转换器、逐次逼近式A/D转换器和并行式A/D转换器。,9.4 A/D接口设计,ADC0809介绍,封装:28引脚,DIP; IN70:模拟量输入通道 ADDA/B/C:地址线 ALE:地址锁存信号 START:转换启动信号 D70:数据输出线,选择通道定义,ADC0809与FPGA连接引脚图,ADC0809采样接口电路程序,library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity ADC0809 is port ( d : in std_logic_vector(7 downto 0); -ADC0809输出数据 clk,eoc: in std_logic; -clk为系统时钟,eoc为转换结束信号 clk1,start, ale,en: out std_logic; -ADC0809控制信号 abc_in: in std_logic_vector(2 downto 0); -模拟选通信号 abc_out: out std_logic_vector(2 downto 0); -ADC0809模拟信号选通信号 q: out std_logic_vector(7 downto 0); -送至8个并排数码管信号 end ADC0809;,接下页,architecture behav of ADC0809 is type states is ( st0,st1, st2, st3, st4,st5,st6); -定义各状态的子类型 signal current_state, next_state:states:=st0; signal regl :std_logic_vector(7 downto 0); -中间数据寄存信号 signal qq:std_logic_vector(7 downto 0); begin com:process(current_state,eoc) -规定各种状态的转换方式,接下页,begin case current_state is when st0=next_statenext_statenext_state ale=0;start=0;en=0; if eoc=1 then next_state=st3;,接下页,else next_state ale=0;start=0;en=0; if eoc=0 then next_state=st4; -检测EOC的上升沿 else next_state=st5;,接下页,end if; when st5=next_statenext_state next_state=st0;ale=0;start=0;en=0; end case; end process; clock:process(clk) begin,接下页,if clkevent and clk=1 then qq=qq+1; -在clk1的上升沿,转换至下一状态 if QQ=“01111111“ THEN clk1=1; current_state =next_state; elsif qq=“01111111“ then clk1=0; end if; end if; end process; q=regl; abc_out=abc_in; end behav;,
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号