Peter_L
Junior Member level 1
vhdl lcd module ascii
Hello All,
I currently have a Spartan3A DDR2 development kit. I am trying to create VHDL code to turn on a single LED from LED(0) to LED(8) and display a message to the LCD screen everytime a combination of switches are toggled switch(0) to switch(2). I am using multiple process's, but I keep getting an error when I simulate. I have tried many ways to get rid of this error, but nothign ahs worked. I hope that someone can help! Attached is a picture of simulation error and VHDL code.
Hello All,
I currently have a Spartan3A DDR2 development kit. I am trying to create VHDL code to turn on a single LED from LED(0) to LED(8) and display a message to the LCD screen everytime a combination of switches are toggled switch(0) to switch(2). I am using multiple process's, but I keep getting an error when I simulate. I have tried many ways to get rid of this error, but nothign ahs worked. I hope that someone can help! Attached is a picture of simulation error and VHDL code.
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity decoder is
Port ( sel : in STD_LOGIC_VECTOR (2 downto 0); -- selector switch used to toggle LED
y : out STD_LOGIC_VECTOR (7 downto 0); -- output to 8 LEDs
LCD_DB : inout std_logic_vector (7 downto 0):="00000000";
LCD_RWS : inout std_logic_vector (1 downto 0):="00";
LCD_E : out STD_LOGIC:= '0');
end decoder;
---------------------------------------------------------------------------------------------------
architecture Behavioral of decoder is
signal lcd_clr_s, lcd_e_disable_s: std_logic:='0';
begin
decoder: process (sel)
begin
case sel is
when "000" => y <= "00000001";
when "001" => y <= "00000010";
when "010" => y <= "00000100";
when "011" => y <= "00001000";
when "100" => y <= "00010000";
when "101" => y <= "00100000";
when "110" => y <= "01000000";
when others => y <= "10000000";
end case;
lcd_clr_s <= not lcd_clr_s;
end process decoder;
--------------------------------------------
lcd_clr: process (lcd_clr_s)
begin
lcd_rws <= "00"; --Clear LCD Display
lcd_e <= '1';
lcd_db <= "00000001";
lcd_e_disable_s <= not lcd_e_disable_s;
end process lcd_clr;
--------------------------------------------------
lcd_e_disable: process (lcd_e_disable_s)
begin
lcd_e <= '0';
lcd_db <="00000000";
end process lcd_e_disable;
end architecture behavioral;