-------------------------------------------------------------- --Ansteuerung des LCD mit Initialisierung und Zeichenausgabe-- -------------------------------------------------------------- LCD_Initialising: PROCESS (clock_400hz_en, reset, data_input, enable_char, enable, data_keyboard, done_pressing, word) VARIABLE ini : NATURAL RANGE 0 TO 12 := 0; VARIABLE next_command : NATURAL RANGE 0 TO 12 := 0; VARIABLE char_cnt : NATURAL RANGE 0 TO 34 := 0; BEGIN --LCD neu initialisieren IF reset = '0' THEN LCD_ON <= '1'; --LCD_ON LCD_EN <= '1'; --LCD_EN LCD_RW <= '0'; --LCD_RW LCD_RS <= '0'; --LCD_RS LCD_DATA <= x"38"; --x"38" = Display OFF, 2-lines of Display in use ( = reset) sonderzeichen <= (others => '0'); vga_valid <= '0'; ini := 0; next_command := 0; char_cnt := 0; ELSIF Clock_400hz_en'EVENT AND Clock_400hz_en = '1' THEN CASE ini IS ... WHEN 9 => ... ... -- Steuertasten mit besonderen Funktionen -- LCD_RS <= '0' aktiviert, dass LCD_DATA ein Befehl statt ein Zeichen darstellt WHEN x"5A" => LCD_DATA <= x"14"; -- "Enter" LCD_RS <= '0'; sonderzeichen <= "100"; when x"66" => LCD_DATA <= x"10"; -- "Backspace" -> bewege curso nach links, dann drucke eine leertaste, danach bewege den curso nach links LCD_RS <= '0'; sonderzeichen <= "110"; next_command:=10; char_cnt := char_cnt - 2; when x"71" => LCD_DATA <= x"20"; -- "Entf" löscht das aktuelle Zeichen auf dem der Cursour steht sonderzeichen <= "101"; next_command := 12; char_cnt := char_cnt - 1; when x"76" => LCD_DATA <= x"01"; -- "Esc" löscht das LCD display LCD_RS <= '0'; when x"6B" => LCD_DATA <= x"10"; -- "left Arrow" LCD_RS <= '0'; sonderzeichen <= "001"; char_cnt := char_cnt - 2; when x"74" => LCD_DATA <= x"14"; -- "Right Arrow" LCD_RS <= '0'; sonderzeichen <= "011"; --char_cnt := char_cnt - 1; WHEN OTHERS => LCD_DATA <= x"00"; END CASE; char_cnt := char_cnt + 1; if LCD_DATA = x"01" and LCD_RS = '0' then char_cnt := 0; end if; ini := 8; END IF; END IF; when 10 => LCD_ON <= '1'; LCD_EN <= '1'; LCD_RW <= '0'; LCD_RS <= '1'; LCD_DATA <= x"20"; --" " next_command:= 11; ini := 8; -- when 11 => LCD_ON <= '1'; LCD_EN <= '1'; LCD_RW <= '0'; LCD_RS <= '0'; LCD_DATA <= x"10"; --scrollt cursor nach links next_command := 9; ini := 8; when 12 => LCD_ON <= '1'; LCD_EN <= '1'; LCD_RW <= '0'; LCD_RS <= '0'; LCD_DATA <= x"10"; --scrollt cursor nach links next_command := 9; ini := 8; END CASE