【正文】
hen clear = state=setmode。 when setmode = state=writeram。 when returncursor = state=writeram。 when switchmode = state=clear。 when shift = state=idle。 when setfunction = state=switchmode。 when setcgram = state=idle。 when setddram = state=writeram。 when readflag = state=idle。 when writeram = if(counter =40)then state=setddram。 counter=counter+1。 elsif(counter/=40 and counter81)then state=writeram。 counter=counter+1。 else state=shift。 end if。 when readram = state=idle。 when others = state=idle。 end case。 end if。 end process。 end behavioral。 液晶 lcd1602 的 vhdl源代碼 20200503 11:57 利用 FPGA驅(qū)動 LCD顯示中文字符 年 的 VHDL程序。 文件名 : 。 功能 : FGAD驅(qū)動 LCD顯示中文字符 年 。 library IEEE。 use 。 use 。 use 。 entity LCD1602 is Port ( Clk : in std_logic。 狀態(tài)機(jī)時鐘信號,同時也是液晶時鐘信號,其周期應(yīng)該滿足液晶數(shù)據(jù)的建立時間 Reset:in std_logic。 LCD_RS : out std_logic。 寄存器選擇信號 LCD_RW : out std_logic。 液晶讀寫信號 LCD_EN : out std_logic。 液 晶時鐘信號 LED : out std_logic。 LCD_Data : out std_logic_vector(7 downto 0))。 液晶數(shù)據(jù)信號 end LCD1602。 architecture Behavioral of LCD1602 is type state is (set_dlnf,set_cursor,set_dcb,set_cgram,write_cgram,set_ddram,write_LCD_Data)。 signal Current_State:state。 type ram2 is array(0 to 7) of std_logic_vector(7 downto 0)。 constant cgram:ram2:=( (00001000), (00001111), (00010010), (000