第一次写程序,对时序懵懵懂懂的,希望得到指点
这是程序
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity lcd is
PORT ( LCD_RST: in std_logic;
LCD_DIN: in std_logic_vector(7 downto 0);
LCD_CLK: in std_logic;
LCD_A0 : out std_logic;
LCD_A1 : out std_logic;
LCD_WR : BUFFER std_logic;
LCD_RD : out std_logic;
LCD_CS : BUFFER std_logic;
LCD_D : out std_logic_vector(7 downto 0)
);
end lcd;
architecture Behave of lcd is
SIGNAL SIG_CON: integer range 0 to 15;
BEGIN
process(LCD_RST,LCD_CLK,SIG_CON)
begin
LCD_RD<='1'; ---读信号始终无效,只写不读
LCD_CS<='0'; ---片选信号可以一直是低吧?????????
if( LCD_RST='0' )then
if(LCD_CLK'event and LCD_CLK='0') then----------这里改成上升沿也行么????????
SIG_CON <= SIG_CON + 1;
end if;
if (SIG_CON=3) then
LCD_D<=LCD_DIN;
end if;
IF (SIG_CON=5) THEn
SIG_CON<=0;
LCD_WR<= NOT LCD_WR;
end if;
else LCD_D <= "00000000";
end if;
end process;
end Behave; |