实验四驱动显示电路设计.doc
文本预览下载声明
实验四 扫描驱动显示电路设计(设计性实验)
一、实验目的:
1、 了解实验箱中 8 位七段数码管显示模块的工作原理。
2、 熟悉 VHDL 硬件描述语言及设计专用数字集成电路的自顶向下的设计思想。
3、 掌握利用 CPLD/FPGA设计 8 位七段数码管扫描显示驱动电路的方法。
二、实验设备 :
1、 计算机(配置为:P4 CPU 128M 内存) ;
2、 MAX+plusⅡ开发工具软件;
3、EDA 实验箱(主芯片是ALTERA EPM7128SLC84-6) ;
三、扫描原理 :
为了减少8位显示信号的接口连接线,实验箱中的数码显示采用扫描 显示工作模式。
即 8 位数码管的七段译码输入(a,b,c,d,e,f,g)是并联在一起的,而每一个数码管是通过一个3 位选择 sel[2..0]来选定 的。sel 与数码管之间是一 3-8 译码的关系,即 sel为“000”时,选中第一个数码管,sel 为“111”时,选中第八个数码管。
四、设计任务:
本实验要求在给定子模块程序的基础上,画出设计原理图。自行编写顶层模块程序,完成扫描显示驱动电路的设计,实现在 8 个数码管上轮流显示字符 0-F的功能。
五、设计要求:
1、要求在 Max+plusⅡ平台上用 VHDL 语言编写顶层模块程序,调试、仿真成功后,下
载至 ALTER EPM7128SLC84-15 芯片,再利用外接电路实现以上设计功能。
2、扫描驱动显示电路有 2 个输入端(clk,reset),14 个输出端(a,b,c,d,e,f,g)
和(y0,y1,y2,y3,y4,y5,y6,y7),全部为 TTL 电平,管脚分配任意,如下图所示
3、根据芯片特点,管脚分配时将时钟信号分配给 83 脚,复位信号分配给 1 脚,使能信
号分配给 84脚。
六 、实验步骤:
1、采用文本编辑器输入VHDL语言源程序,建立工程。VHDL语言源程序如下所示:
(1)顶层程序:
library ieee;
use ieee.std_logic_1164.all;
entity disp is
port(clk,reset: in std_logic;
a,b,c,d,e,f,g: out std_logic;
y: out std_logic_vector(2 downto 0));
end disp;
architecture beha of disp is
component counter16
port(clk,clr: in std_logic;
count: out std_logic_vector(3 downto 0));
end component;
component decdisp
port(datain: in std_logic_vector(3 downto 0);
a,b,c,d,e,f,g: out std_logic);
end component;
component yima3
port(x: in std_logic_vector(2 downto 0);
y: out std_logic_vector(2 downto 0));
end component;
signal cont: std_logic_vector(3 downto 0);
signal sel3: std_logic_vector(2 downto 0);
begin
d1:counter16 port map(clk=clk,clr=reset,count=cont);
d2:decdisp port map(datain=cont,a=a,b=b,c=c,d=d,e=e,f=f,g=g);
d3:yima3 port map(x=cont(2 downto 0),y=y);
end beha;
(2)十六进制程序:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter16 is
port(clk,clr: in std_logic;
count: out std_logic_vector(3 downto 0);
sel: out std_logic_vector(2 downto 0));
end counter16;
architecture beha of counter16 is
signal cnt: st
显示全部