프로젝트가 끝나기가 거의 다되었지만 어느 시점에서 멈추었습니다. 문제를 해결할 수 없습니다.VHDL - 7 세그먼트 디스플레이에서 스크롤링
VHDL이 배열 색인을 힘들이지 않게 이동한다고 결정한 후, 나는 시프터 모듈을 변경하기로 결정했습니다. 이제 제대로 컴파일되고 RTL 회로도가 사실로 보이지만 불행히도 스캔 코드를 이동하는 데 혁신적이지 않은 방법을 사용했습니다.
최대 8 개의 스캔 코드를 저장할 수있는 64 비트 std_logic_vector를 정의한 다음이 벡터의 4 MSBmost 바이트를 구문 분석 한 다음 7 개의 세그먼트 컨트롤러로 보내고 7 개의 세그먼트를 사용할 입력을 멀티플렉싱합니다. 시계에 문제가 있다고 생각하지만 디스플레이에 아무것도 표시되지 않으면 기기의 일부가 오작동한다고 생각합니다. 내 키보드 컨트롤러가 잘 작동한다고 확신한다. 시프터도 괜찮아 보인다. (FPGA에서도이 코드를 시도했지만 시계를 늦추지 않고 입력 한 마지막 스캔 코드를 볼 수 있었다.) 어떤 방법이나 방법을 7 세그먼트 컨트롤러를 시도해 보지 못했지만, 너무 잘 보인다. 나는 문제가, 텍스트 :(
스크롤되지 Shifter.vhd
무엇인지 모르는library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.numeric_std.all;
entity my_shifter is
port(clk : in std_logic;
Scan_Dav : in std_logic;
Data_in : in std_logic_vector (7 downto 0);
O1 : out std_logic_vector(7 downto 0);
O2 : out std_logic_vector(7 downto 0);
O3 : out std_logic_vector(7 downto 0);
O4 : out std_logic_vector(7 downto 0)
);
end my_shifter;
architecture bhv of my_shifter is
signal bytes : std_logic_vector(63 downto 0);
begin
process (clk) begin
if rising_edge(clk) then
if Scan_Dav = '1' then
bytes <= bytes (bytes'high-8 downto 0) & Data_in;
end if;
end if;
end process;
O1 <= bytes(63 downto 56);
O2 <= bytes(55 downto 48);
O3 <= bytes(47 downto 40);
O4 <= bytes(39 downto 32);
end bhv;
clkdivide.vhd
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity clkdivide is
Port (clkin: in std_logic;
clkout:out std_logic);
end clkdivide;
architecture Behavioral of clkdivide is
signal int_clock:std_logic;
begin
clkout<=int_clock;
process(clkin)
variable var:integer range 0 to 12500 :=0;
begin
if (clkin'event and clkin = '1') then
if var = 12500 then
int_clock <= not int_clock;
var:=0;
else
var:=var+1;
end if;
end if;
end process;
end Behavioral;
SevenSegmentControl.vhd :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
entity SevenSegmentController is
port (
CLK: in std_logic;
DEC1, DEC2, DEC3, DEC4: in std_logic_vector(7 downto 0);
SEGMENTS: out std_logic_vector(6 downto 0);
ANODES: out std_logic_vector(3 downto 0)
);
end SevenSegmentController;
architecture Behavioral of SevenSegmentController is
signal DecoderInput: std_logic_vector(7 downto 0);
signal CurrentDisplay: std_logic_vector(1 downto 0) := "00";
signal Prescaler: std_logic_vector(15 downto 0) := (others => '0');
begin
Multiplex: process(CLK)
begin
if rising_edge(CLK) then
if Prescaler(15) = '0' then
Prescaler <= Prescaler + 1;
else
CurrentDisplay <= CurrentDisplay + 1;
Prescaler <= (others => '0');
end if;
end if;
end process Multiplex;
SevenSegmentDecoder: entity work.SevenSegment_Decoder(Behavioral)
generic map (INVERT_OUTPUT => '1')
port map (number => DecoderInput, segment => SEGMENTS);
DecoderInput <= DEC1 when CurrentDisplay = "00" else
DEC2 when CurrentDisplay = "01" else
DEC3 when CurrentDisplay = "10" else
DEC4 when CurrentDisplay = "11";
ANODES <= "0111" when CurrentDisplay = "00" else
"1011" when CurrentDisplay = "01" else
"1101" when CurrentDisplay = "10" else
"1110" when CurrentDisplay = "11";
end Behavioral;
실제 디스플레이 나 시뮬레이션 된 디테일에서 숫자가 보이지 않습니까? 디스플레이를 개별적으로 테스트 했습니까? SevenSegment_Decoder 란 무엇입니까? – Philippe
Seven Segment Decoder는 스캔 코드를 g_to_a (SEGMENTS)로 변환하는 구성 요소입니다. 실제로 실제 디스플레이 (BASYS2 FPGA)에 숫자가 표시되며 이동도되지만 함께 볼 수는 없지만 마지막으로 누른 키가 화면에 표시됩니다. 나는 결국 시계 문제가 있다고 생각하고있다 ... – John