vitruvius
Newbie level 5
Hi all. I'm begginer at both Fpga and Vhdl and i have got Spartan-3E Starter Kit. I can write every character i want. For example, the character "R" from the CG-ROM have the value "01010010". I send this data like this:
But how can i write a variable on lcd screen? I have a variable (cnt: integer range 0 to 8) which counts up each time i press the button. I want to see this on the lcd screen.
This is what i use for counter: (I can see the value of the integer by using leds)
Thank you.
Code:
DATA<=X"52"; --R
when 193=>
DB<=DATA(7 downto 4);
when 194=>LCD_E<='1';
when 195=>LCD_E<='0';
when 196=>DB<=DATA(3 downto 0);
when 197=>LCD_E<='1';
when 198=>LCD_E<='0';
But how can i write a variable on lcd screen? I have a variable (cnt: integer range 0 to 8) which counts up each time i press the button. I want to see this on the lcd screen.
This is what i use for counter: (I can see the value of the integer by using leds)
Code:
architecture Behavioral of debounce is
signal counter : integer range 0 to 15000000;
signal buton_b : std_logic;
signal buton_g : std_logic;
signal cnt : integer range 0 to 8;
signal ledg : std_logic_vector(7 downto 0);
begin
led <= ledg;
process(clk) -- Debounce
begin
if(clk'event and clk='1') then
if(buton_b <= '1') then
counter<=counter+1;
buton_g<='0';
elsif(buton='1') then
buton_b<='1';
end if;
if(counter=15000000) then --300ms
counter<=0;
buton_b<='0';
if(buton='1') then
buton_g<='1';
end if;
end if;
end if;
end process;
process(clk) --Cnt
begin
if(clk'event and clk='1') then
if(buton_g='1') then
cnt<=cntc+1;
if(cnt=8) then
cnt<=0;
end if;
end if;
end if;
end process;
process(cnt)
begin
case cnt is
when 0 => ledg <= "00000000";
when 1 => ledg <= "00000001";
when 2 => ledg <= "00000010";
when 3 => ledg <= "00000100";
when 4 => ledg <= "00001000";
when 5 => ledg <= "00010000";
when 6 => ledg <= "00100000";
when 7 => ledg <= "01000000";
when others => ledg <= "10000000";
end case;
end process;
Thank you.