Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.26 KB | None | 0 0
  1.  
  2. process (iCLK) begin
  3.       if(inRST='0') then
  4.          sSTATE<=CLEAR;
  5.          sCOUNT<="00000000000000000";
  6.          sINDEX<="00000";
  7.             sEN <= '0';
  8.       elsif(iCLK'event and iCLK='1') then
  9.             case sSTANJE is
  10.                 when CLEAR =>
  11.                     if (iREADY='0') then
  12.                         sSTATE <= WAIT_LCD;
  13.                     else
  14.                         sSTATE<= CLEAR;
  15.                     end if;
  16.                 when WAIT_LCD =>
  17.                     if (iREADY='1') then
  18.                         sSTATE<=SEND_CHAR;
  19.                     else
  20.                         sSTATE<=WAIT_LCD;
  21.                         end if;
  22.                 when SEND_CHAR =>
  23.                     if (iREADY='0') then
  24.                         sSTATE <= WAIT_LCD2;
  25.                     else
  26.                         sSTATE<= SEND_CHAR;
  27.                     end if;
  28.                 when WAIT_LCD2 =>
  29.                     if (iREADY='1') then
  30.                         sSTATE <= NEXT_CHAR;
  31.                     else
  32.                         sSTATE<= WAIT_LCD2;
  33.                     end if;
  34.                 when NEXT_CHAR =>
  35.                     if (sINDEX="1F") then --last char?
  36.                         sSTATE <= WAIT_HF;
  37.                     else
  38.                         sSTATE<= SEND_CHAR;
  39.                     end if;
  40.                 when WAIT_HF =>
  41.                    if(sCOUNT=x"16D3C") then   --93500
  42.                    sSTATE<=ROTATE;
  43.                    sCOUNT<="00000000000000000";
  44.                else
  45.                  sCOUNT<=sCOUNT+1;
  46.                  sSTATE<=WAIT_HF;
  47.                end if;
  48.                  when ROTATE=>
  49.                          sSTATE<=CLEAR;
  50.                  when others =>
  51.                          sSTATE<=WAIT_LCD;
  52.             end case;  
  53.                    
  54.                    
  55.            
  56.         end if;
  57. end process;
Add Comment
Please, Sign In to add comment