waqar86
Junior Member level 2
i m trying to initialize a tft lcd which has the following pinouts
chip select active-low
read active low read strobe
write active low write strobe
register select 0 = write command, 1 =write data
dataoutput(8-bits)
at the rising edge of 'write', command or data is latched.
Now i have written the following code, but LCD keeps white display, can i see anything happening on the lcd with this code, need ur opinions and correction,
chip select active-low
read active low read strobe
write active low write strobe
register select 0 = write command, 1 =write data
dataoutput(8-bits)
at the rising edge of 'write', command or data is latched.
Now i have written the following code, but LCD keeps white display, can i see anything happening on the lcd with this code, need ur opinions and correction,
Code:
entity lcd_driver is
generic(datawidth: positive:= 8);
port( clock: in std_logic; -- slow clock from clock divider.
reset: in std_logic; -- system reset.
lcd_select: out std_logic; -- lcd register select signal.
lcd_data: inout std_logic_vector(datawidth-1 downto 0); -- output to LCD.
lcd_r: out std_logic; -- output to LCD.
lcd_w: out std_logic; -- output to LCD.
lcd_cs: out std_logic -- output to LCD.
);
end lcd_driver;
architecture Display of lcd_driver is
-- Display ON command given in datasheet
constant D_ON: std_logic_vector(datawidth-1 downto 0) := "00101001";
-- No operation command.
constant NIL: std_logic_vector(datawidth-1 downto 0) := "00000000";
signal w_temp: std_logic;
begin
lcd_cs<='0';
lcd_r<='1';
lcd_select<='0';
lcd_w<=w_temp;
P1: process (clock)
variable count: integer range 0 to 1;
begin
if rising_edge(clock) then
count:=count + 1;
if count=1 then
count:=0;
if w_temp='0' then
w_temp<='1';
else
w_temp<='0';
end if;
end if;
end if;
end process P1;
P2: process(w_temp)
constant temp: integer :=0;
begin
if rising_edge(w_temp) then
if temp=0 then
lcd_data <= D_ON;
else
lcd_data <= NIL;
end if;
end if;
end process P2;
end display;