基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK

上传人:众众****夺宝 文档编号:231364682 上传时间:2023-09-02 格式:DOCX 页数:2 大小:11.55KB
收藏 版权申诉 举报 下载
基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK_第1页
第1页 / 共2页
基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK_第2页
第2页 / 共2页
资源描述:

《基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK》由会员分享,可在线阅读,更多相关《基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK(2页珍藏版)》请在装配图网上搜索。

1、基于FPGA的数字系统设计实验3控制液晶显示屏显示字符OK ; Jian程序library IEEE;use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following library declaration if instantiating - any Xilinx primitives in this code. -library UNISIM;-use UNISIM.VComponents.all; entity lcd is

2、 port(clk, reset : in bit;SF_D : out bit_vector(3 downto 0);LCD_E, LCD_RS, LCD_RW, SF_CE0 : out bit; LED : out bit_vector(7 downto 0) ); end lcd;architecture behavior of lcd istype tx_sequence is (high_setup, high_hold, oneus, low_setup, low_hold, fortyus, done); signal tx_state : tx_sequence := don

3、e; signal tx_byte : bit_vector(7 downto 0); signal tx_init : bit := 0;type init_sequence is (idle, fifteenms, one, two, three, four, five, six, seven, eight, done); signal init_state : init_sequence := idle; signal init_init, init_done : bit := 0; signal i : integer range 0 to 750000 := 0; signal i2

4、 : integer range 0 to 2000 := 0; signal i3 : integer range 0 to 82000 := 0;signal SF_D0, SF_D1 : bit_vector(3 downto 0); signal LCD_E0, LCD_E1 : bit; signal mux : bit;type display_state is (init, function_set, entry_set, set_display, clr_display, pause, set_addr, char_f, char_p, char_g,char_a, done)

5、;signal cur_state : display_state := init; beginLED -The following -when to transmit a command/data and when not to with cur_state selecttx_init -control the bus with cur_state select mux -control the initialization sequence with cur_state select init_init 0 when others;-register select with cur_sta

6、te selectLCD_RS -what byte to transmit to lcd-refer to datasheet for an explanation of these values with cur_state selecttx_byte display: process(clk, reset) beginif(reset=1) thencur_state elsif(clk=1 and clkevent) then case cur_state is-refer to intialize state machine below when init =if(init_done

7、 = 1) then cur_state cur_state -every other state but pause uses the transmit state machine when function_set = if(i2 = 2000) thencur_state cur_state end if;when entry_set = if(i2 = 2000) thencur_state cur_state when set_display = if(i2 = 2000) thencur_state cur_state when clr_display = i3 if(i2 = 2

8、000) then cur_state cur_state when pause = if(i3 = 82000) then cur_state cur_state when set_addr = if(i2 = 2000) then cur_state cur_state when char_J = if(i2 = 2000) then cur_state cur_state when char_I = if(i2 = 2000) then cur_state cur_state end if;when char_A= if(i2 = 2000) then cur_state cur_sta

9、te when char_N = if(i2 = 2000) then cur_state cur_state when done = cur_state end process display; with mux selectSF_D LCD_E transmit : process(clk, reset, tx_init) beginif(reset=1) then tx_state elsif(clk=1 and clkevent) then case tx_state iswhen high_setup = -40ns LCD_E0 SF_D0 tx_state tx_state when high_hold = -230ns LCD_E0 SF_D0 tx_state tx_state when oneus = LCD_E0 tx_state tx_state when low_setup = LCD_E0 SF_D0 tx_state tx_state when low_hold = LCD_E0 SF_D0 tx_state when fortyus = LCD_E0 tx_state

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!