1、项目8 数字电压表设计项目八 数字电压计设计班级:09电信 姓名:曾珍 学号:331. 实训目标1) 使用AD0809模数转换芯片实现信号转换。2) 在EDA-V+系统上实现交通灯控制系统。2. 实训步骤1) 首先使用A/D转换模块,通过AD0809芯片,将模拟电压信号转换成8位数字量。AD0809的V+至+5V,V-至GND,CLK取500KHz。完成剩余管脚的连接。2) 将8位信号送入到CPLD进行数据处理,并将处理完的数据送至数码管显示。3) 将分频、采样、译码显示模块连接在一起,实现数字电压计的设计,将输出结果显示在数码管上。3. 实训数据1) 画出最终的系统连接图,并附上每个模块的程
2、序代码。division1library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity division1 isport( clk : in std_logic; clk4 : out std_logic);end division1;architecture behave of division1 isbegin process(clk) variable counter : std_logic_vector(7 downto 0); begin if (clkevent and clk=0)
3、then if (counter=250) then counter:=00000000; clk4= 1; else counter:=counter+1; clk4=0; end if; end if; end process;end behave;codelibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity code isport( clk:in std_logic; datain : in unsigned(7 downto
4、 0); scan:out std_logic_vector(1 downto 0); dataout1: out std_logic_vector(6 downto 0) );end code;architecture behave of code issignal cnt:integer range 2 downto 0;signal data:integer range 9 downto 0;signal temp1: integer range 511 downto 0;signal temp2: integer range 99 downto 0;signal count1,coun
5、t2: integer range 9 downto 0;signal count3 : integer range 5 downto 0;beginprocess(clk)beginif clkevent and clk=1 thenif cnt=2 then cnt=0;elsecnt=cnt+1;end if;end if;end process;process(datain) begin temp1 count3=5; temp2 count3=4; temp2 count3=3; temp2 count3=2; temp2 count3=1; temp2 count3=0; temp
6、2null; end case; case temp2 is when 90 to 99 = count2=9; count1 count2=8; count1 count2=7; count1 count2=6; count1 count2=5; count1 count2=4; count1 count2=3; count1 count2=2; count1 count2=1; count1 count2=0; count1null; end case; end process;process(cnt)begincase cnt iswhen 0=data=count1;scandata=
7、count2;scandata=count3;scannull;end case;end process;process(data)begin case data is when 0= dataout1 dataout1 dataout1 dataout1 dataout1 dataout1 dataout1 dataout1 dataout1 dataout1 null; end case;end process;end behave;adlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity
8、ad isport(busy:in std_logic; datain:in unsigned(7 downto 0); clk:in std_logic; dataout:out unsigned(7 downto 0); cs:out std_logic; rd:out std_logic );end ad;architecture behav of ad isbeginprocess(clk)variable count:unsigned(1 downto 0);beginif clkevent and clk=1 then case count is when 00 = cs=1; r
9、d=1; dataout cs=0; rd if busy=0 then count:=count-1; end if; when others = null; end case;count:=count+1;end if;end process;end behav;2) 记录下系统的外部连线,注明每个管脚的功能。芯片EP1K30TC144-32633接datain7.0-输入54接busy-55接clk-脉冲信号 500khz9286接dataout16.0-输出 接到数码管 显示数字信号98,99接scan1.0-扫描101接cs102接rd芯片0809Busy接Int接54busyD0d7接2633接datain7.0Vref+接vccVref-接gndIn0接试验箱滑阻Cs接101 csRd接101 rd3) 本设计中的数字电压计的最小测量电压值是多少?拿一块数字万用表同时进行测量,比较数字电压计的误差,并记录相应数据。4. 附AD0809芯片资料1) 芯片结构2) 信号选择段
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1