cmd <= x"80"; rs <= '0';-- 1º LINHA when "000001" => cmd <= " "; rs <= '1'; when "010001" => cmd <= x"C0"; rs <= '0'; -- 2º LINHA when "010010" => cmd <= " "; rs <= '1'; when others => cmd <= x"80"; rs <= '0'; end case; else-- INSTRUÇÔES (INITIALISAÇÂO) case cnt is when "000000" => cmd <= x"38"; rs <= '0'; when others => null; end case; end if; end process;">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process(clk25, rst) begin if rst= '0' then div '0'); elsif rising_edge(clk25) then div<= div + 1; end if; end process; clk_in<= div(div'left); process(clk_in,

Similar presentations


Presentation on theme: "Process(clk25, rst) begin if rst= '0' then div '0'); elsif rising_edge(clk25) then div<= div + 1; end if; end process; clk_in<= div(div'left); process(clk_in,"— Presentation transcript:

1 process(clk25, rst) begin if rst= '0' then div '0'); elsif rising_edge(clk25) then div<= div + 1; end if; end process; clk_in<= div(div'left); process(clk_in, rst) begin if rst= '0' then idx <= 0; elsif rising_edge(clk_in) then if idx= 3 then idx<= 0; else idx<= idx + 1; end if; end process; idx = 0 idx = 1 idx = 2 idx = signal div: unsigned (2 downto 0); div = 000 div = 001 div = 010 div = 011 div = 100 div = 101 div = 110 div = 111 div = 000 div = 001 div = 010 div = 011 div = 100 div = 101 div = 110 div = idx = 0 idx = 1 idx = 2 idx = 3 idx = 0 idx = 1 idx = 2

2 process(clk_in, rst) begin if rst= '0' then cs <= '0'; ext_a '0'); ext_d '0'); elsif rising_edge(clk_in) then case idx is when 0=> ext_a<= "00" & rs; when 1=> cs <= '1';ext_d<= cmd; when 2=> cs <= '0'; when 3=> null; end case; end if; end process; ext_rw<= '0'; cs_lcd <= cs; csn_lcd<= '0'; rs = 0 - instrução rs = 1 - dados 8 bits dados LCD activo idx = 0 idx = 1 idx = 2 idx = 3 idx = 0 idx = 1 idx = 2

3 process(clk_in, rst) begin if rst= '0' then cmd<= x"00"; rs<= '1'; reset<= '1'; cnt '0'); elsif rising_edge(clk_in) then if idx = 2 thencnt <= cnt + 1; end if; if (reset ='0') then case cnt is-- DADOD when "000000" => cmd <= x"80"; rs <= '0';-- 1º LINHA when "000001" => cmd <= " "; rs <= '1'; when "010001" => cmd <= x"C0"; rs <= '0'; -- 2º LINHA when "010010" => cmd <= " "; rs <= '1'; when others => cmd <= x"80"; rs <= '0'; end case; else-- INSTRUÇÔES (INITIALISAÇÂO) case cnt is when "000000" => cmd <= x"38"; rs <= '0'; when others => null; end case; end if; end process;

4 case cnt is when "000000" => cmd <= x"80"; rs <= '0'; when "000001" => cmd <= " "; rs <= '1'; when "000010" => cmd <= " "; rs <= '1'; when "000011" => cmd <= x"20"; rs <= '1'; when "000100" => cmd <= " "; rs <= '1'; when "000101" => cmd <= " "; rs <= '1'; when "000110" => cmd <= x"20"; rs <= '1'; when "000111" => cmd <= " "; rs <= '1'; when "001000" => cmd <= " "; rs <= '1'; when "001001" => cmd <= x"20"; rs <= '1'; when "001010" => cmd <= " "; rs <= '1'; when "001011" => cmd <= " "; rs <= '1'; when "001100" => cmd <= x"20"; rs <= '1'; when "001101" => cmd <= " "; rs <= '1'; when "001110" => cmd <= " "; rs <= '1'; when "001111" => cmd <= x"20"; rs <= '1'; when "010000" => cmd <= x"20"; rs <= '1'; when "010001" => cmd <= x"C0"; rs <= '0'; when "010010" => cmd <= " "; rs <= '1'; when "010011" => cmd <= " "; rs <= '1'; when "010100" => cmd <= x"20"; rs <= '1'; when "010101" => cmd <= std_logic_vector(to_unsigned(character'pos('A'), 8)); rs <= '1'; when "010110" => cmd <= x"20"; rs <= '1'; when "010111" => cmd <= DIP_in; rs <= '1'; when "011000" => cmd <= x"20"; rs <= '1'; when "011001" => cmd <= " " & push_B; rs <= '1'; when "011010" => cmd <= x"20"; rs <= '1'; when "011011" => cmd <= std_logic_vector(to_unsigned(character'pos(line(1)), 8)); rs <= '1'; when "011100" => cmd <= std_logic_vector(to_unsigned(character'pos(line(2)), 8)); rs <= '1'; when "011101" => cmd <= std_logic_vector(to_unsigned(character'pos(line(3)), 8)); rs <= '1'; when "011110" => cmd <= std_logic_vector(to_unsigned(character'pos(line(4)), 8)); rs <= '1'; when "011111" => cmd <= x"20"; rs <= '1'; when "100000" => cmd <= x"20"; rs <= '1'; when "100001" => cmd <= "00110" & soma; rs <= '1'; when others => cmd <= x"80"; rs <= '0'; end case;


Download ppt "Process(clk25, rst) begin if rst= '0' then div '0'); elsif rising_edge(clk25) then div<= div + 1; end if; end process; clk_in<= div(div'left); process(clk_in,"

Similar presentations


Ads by Google