diff --git a/lcd_driver.sym b/lcd_driver.sym index f3c0d7f..0ce76d2 100644 --- a/lcd_driver.sym +++ b/lcd_driver.sym @@ -1,41 +1,38 @@ BLOCK - 2016-6-3T16:19:19 - - - - - + 2016-6-6T19:34:31 + + + + - - - - + + + + - - - - - + + + - + - + - + - - - - - - - - - + + + + + + + + + diff --git a/lcd_driver.vhd b/lcd_driver.vhd index 4bc2b93..dddeefc 100644 --- a/lcd_driver.vhd +++ b/lcd_driver.vhd @@ -53,7 +53,6 @@ entity lcd_driver is data : in STD_LOGIC_VECTOR (7 downto 0); -- either one ascii char (8bit) or new cursor position (0-31) new_character : in STD_LOGIC; -- a new character is available on the data bus new_pos : in STD_LOGIC; -- a new cursor position is available on the data bus - auto_incr_cursor : in STD_LOGIC; -- the cursor should automatically be incremented after writing a new character busy : out STD_LOGIC; -- 1 when sending stuff lcd_db : out STD_LOGIC_VECTOR (7 downto 0); -- lcd databus lcd_en : out STD_LOGIC; -- lcd enable @@ -64,16 +63,17 @@ architecture Behavioral of lcd_driver is -- type definitions type display_state is ( - INIT, -- initialization, wait for 40ms to pass - SEND_FS1, -- send the function set - SEND_FS2, -- send the function set - SEND_SD, -- send the display ON/OFF control - SEND_CD, -- send a clear - SEND_ES, -- send entry mode set - WAITING1, -- wait and toggle lcd_en - WAITING2, -- wait and toggle lcd_en - WAITING3, -- wait and toggle lcd_en - DONE); -- initialization done + INIT, -- initialization, wait for 40ms to pass + SEND_FS1, -- send the function set + SEND_FS2, -- send the function set + SEND_SD, -- send the display ON/OFF control + SEND_CD, -- send a clear + SEND_ES, -- send entry mode set + SEND_ADRESS, -- send a new adress + WAITING1, -- wait and toggle lcd_en + WAITING2, -- wait and toggle lcd_en + WAITING3, -- wait and toggle lcd_en + DONE); -- initialization done -- signals signal cur_state : display_state := INIT; -- cur_state register @@ -208,6 +208,17 @@ begin next_ret_state <= DONE; next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS); next_state <= WAITING1; + + when SEND_ADRESS => -- entry set mode + + next_lcd_db <= '1' & data(6 downto 0); + next_lcd_en <= '1'; + next_lcd_rs <= '0'; + + next_counter <= (others => '0'); + next_ret_state <= DONE; + next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS); + next_state <= WAITING1; when DONE => -- initialization done @@ -216,12 +227,19 @@ begin next_lcd_rs <= '0'; if(new_character = '1') then -- send data - next_lcd_rs <= '1'; + next_lcd_rs <= '1'; next_counter <= (others => '0'); next_ret_state <= DONE; next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS); next_state <= WAITING1; - next_lcd_db <= data; + next_lcd_db <= data; + elsif(new_pos = '1') then -- new address + next_lcd_rs <= '0'; + next_counter <= (others => '0'); + next_ret_state <= SEND_ADRESS; + next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS); + next_state <= WAITING1; + next_lcd_db <= "000001" & data(7) & '0'; end if; when WAITING1 => -- wait with jump diff --git a/toplevel.jhd b/toplevel.jhd index 5f790c3..6cf06d1 100644 --- a/toplevel.jhd +++ b/toplevel.jhd @@ -8,4 +8,4 @@ MODULE toplevel SUBMODULE rotary_dec INSTANCE XLXI_43 SUBMODULE lcd_driver - INSTANCE XLXI_45 + INSTANCE XLXI_88 diff --git a/toplevel.sch b/toplevel.sch index 6883f21..fb33dff 100644 --- a/toplevel.sch +++ b/toplevel.sch @@ -6,6 +6,7 @@ + @@ -20,8 +21,6 @@ - - @@ -32,17 +31,17 @@ - - - + - - - - - - + + + + + + + + @@ -51,7 +50,6 @@ - @@ -59,9 +57,10 @@ + - + 2016-5-20T8:33:2 @@ -134,20 +133,19 @@ - 2016-6-3T16:19:19 - - + 2016-6-6T19:34:31 + - - - - - + + + + + @@ -182,13 +180,6 @@ - - - - - - - @@ -201,14 +192,6 @@ - - - - - - - - @@ -217,23 +200,30 @@ - + - + + + + + + + + + - + - + - - + @@ -242,219 +232,234 @@ + + + + + + + - + - + - - - - + + + + - - + + - - - + + + - - - - + + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + + - + - + - - + + - + - + - - - - + + + + - + - + - - - - - - - - - + - - + + - - - - + + + + - + - - - - - - - - - - - - - - + - - - + + + - + - + - + - + - - - + + + - + - - - - - - + - + - + - + - + - - - - - - - - - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yasg.gise b/yasg.gise index f04fd20..d5a3dac 100644 --- a/yasg.gise +++ b/yasg.gise @@ -225,7 +225,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -270,9 +270,7 @@ - - @@ -289,7 +287,7 @@ - + @@ -298,11 +296,9 @@ - + - - @@ -313,7 +309,7 @@ - + @@ -328,7 +324,7 @@ - + @@ -340,13 +336,11 @@ - + - - - +