EDA课程设计报告材料

  • 格式:doc
  • 大小:141.50 KB
  • 文档页数:10

实用成绩:EDA课程设计报告课程 EDA课程设计专业学号姓名指导教师日期 2012.06.21机械与电子信息学部一、设计任务与要求1.任务:制作并调试EDA学习板2.了解并能识别学习板上的各种元器件,会读元器件标示;3.会看电路原理图;4.制作EDA学习板;5.编写VHDL程序进行跑马灯控制6.编写VHDL程序进行步进电机的转速控制7.学会使用QuartusⅡ软件下载调试程序;8.用调试程序将学习板调试成功。

9.二.课程设计目的通过编写VHDL程序,结合硬件电路设计,实现跑马灯和步进电机的转速控制。

经过本次课程设计,能够将所学专业理论知识进行综合实际运用,锻炼学生的动手能力以及提高学生的综合专业素质。

三、实验内容1.芯片工作电路,利用晶振提供控制信号。

2.10引脚下载口与芯片相关引脚相连完成下载电路。

3.利用16个开关做成键盘,实现输入号对已编程的芯片的控制并通过数码管显示0--F。

4.用2片74HC573N具有锁存功能芯片与8个数码管相连,通过编程实现位选和段选实现输出信号的显示功能。

5.使用74HC573N锁存功能结合ULN2003AG芯片8非门芯片和74HC04N6非门芯片与4个2N5551三极管实现对步进电机的控制,和控制步进电机6.信号结合LED输出显示的功能。

7.利用1片74HC573N芯片与8个共阴极LED实现跑马灯功能。

四.课程设计器材清单六.程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cc isport(clk: in std_logic;bj:out std_logic_vector(3 downto 0);start:in std_logic;kbcol:in std_logic_vector(3 downto 0);kbrow:out std_logic_vector(3 downto 0);seg1_out:out std_logic_vector(3 downto 0);seg2_out:out std_logic_vector(3 downto 0);qq_out:out std_logic_vector (7 downto 0);qq1_out:buffer std_logic_vector(7 downto 0);sk:in bit);end;architecture one of cc istype btype is(s0,s1,s2,s3);signal current_state,next_state:btype;signal count: std_logic_vector(1 downto 0);signal sta: std_logic_vector(1 downto 0);signal seg1: std_logic_vector(3 downto 0);signal seg2: std_logic_vector(3 downto 0);signal fn: std_logic;signal ks:std_logic_vector(1 downto 0);signal qq: std_logic_vector (7 downto 0);signal qq1:std_logic_vector (7 downto 0);signal sp1,sp2:std_logic_vector(3 downto 0);beginpqq:process (clk)beginif clk'event and clk='1' thenqq<=qq+1;end if;end process;qq_out<=qq;reg:process (qq(7))beginif qq(7)'event and qq(7)='1'thencurrent_state <=next_state;end if;end process reg;com:process (current_state)begincase current_state iswhen s0=> bj<="0011";next_state <=s1; when s1=> bj<="1001";next_state <=s2; when s2=> bj<="1100";next_state <=s3; when s3=> bj<="0110";next_state <=s0; when others=>next_state <=s0;end case;end process com;process(clk)beginif clk'event and clk='1'then count<=count+1; end if;end process;process(clk)beginif clk'event and clk='1'thencase count iswhen "00"=>kbrow<="0001";sta<="00";when "01"=>kbrow<="0010";sta<="01";when "10"=>kbrow<="0100";sta<="10";when "11"=>kbrow<="1000";sta<="11";when others=>kbrow<="1111";end case;end if;end process;process(clk,start)beginif start='0'then seg1<="0000";seg2<="0000"; elsif clk'event and clk='1'thencase sta iswhen "00"=>case kbcol iswhen "0001"=>seg1<="0000";seg2<="0001"; when "0010"=>seg1<="0000";seg2<="0010";when "0100"=>seg1<="0000";seg2<="0011";when "1000"=>seg1<="0000";seg2<="0100";when others=>seg1<="1111";seg2<="1111";end case;when "01"=>case kbcol iswhen "0001"=>seg1<="0000";seg2<="0101";when "0010"=>seg1<="0000";seg2<="0110";when "0100"=>seg1<="0000";seg2<="0111";when "1000"=>seg1<="0000";seg2<="1000";when others=>seg1<="1111";seg2<="1111";end case;when "10"=>case kbcol iswhen "0001"=>seg1<="0000";seg2<="1001";when "0010"=>seg1<="0001";seg2<="0000";when "0100"=>seg1<="0001";seg2<="0001";when "1000"=>seg1<="0001";seg2<="0010";when others=>seg1<="1111";seg2<="1111";end case;when "11"=>case kbcol iswhen "0001"=>seg1<="0001";seg2<="0011";when "0010"=>seg1<="0001";seg2<="0100";when "0100"=>seg1<="0001";seg2<="0101";when "1000"=>seg1<="0001";seg2<="0110";when others=>seg1<="1111";seg2<="1111";end case;when others=>seg1<="1111";seg2<="1111";end case;end if;end process;fn<=not(seg1(0)and seg2(0)and seg2(1)and seg2(2)and seg2(3)); process(fn)beginif fn'event and fn='1'thenseg1_out<=seg1;seg2_out<=seg2;end if;end process;process (qq(7))variable c:integer range 7 downto 0; beginif qq(7)'event and qq(7)='1'thenc:=c+1;if c=7 thenqq1<=qq1+1;end if;end if;end process;process (fn,qq1)beginif fn'event and fn='1' thencase seg1 iswhen "0000"=>case seg2 iswhen "0001"=>qq1_out<="00011001"; when "0010"=>qq1_out<="00110010"; when "0011"=>qq1_out<="01001011"; when "0100"=>qq1_out<="01100100"; when "0101"=>qq1_out<="01111111"; when "0110"=>qq1_out<="10010110"; when "0111"=>qq1_out<="10101111"; when "1000"=>qq1_out<="11001000"; when "1001"=>qq1_out<="11100001"; when others=>qq1_out<=qq1;end case;when "0001"=>case seg2 iswhen "0000"=>qq1_out<="11110000"; when "0001"=>qq1_out<="11111111"; when "0010"=>qq1_out<="00000000"; --when "0011"=>qq1_out<=qq1;when others=>qq1_out<=qq1;end case;when others=>qq1_out<=qq1;end case;end if;end process;process(sk,start,sp1,sp2)beginif start='0' then sp1<="0000";sp2<="0000";elsif sk'event and sk='1' thenif sp2<"1001" then sp2<=sp2+1;else sp2<="0000";end if;end if;if sp2="1001" then sp1<=sp1+1;end if;end process;end;七.元件调试1、否短路用万用表检查P2两端是短路。