《液晶显示驱动电路的设计与实现(4课时)综述》由会员分享,可在线阅读,更多相关《液晶显示驱动电路的设计与实现(4课时)综述(15页珍藏版)》请在金锄头文库上搜索。
1、实验六 液晶显示驱动电路的设计与实现(4课时)实验目的1.熟练掌握设计电路下载到芯片的关键设置与基本步骤和利用实验箱上的输入信号和输出显示器件在线测试设计电路的方法。2.熟悉液晶显示的原理,了解液晶显示器件的性能特点、分类参数。掌握液晶显示器件的接口时序与通讯格式。3.掌握利用VHDL语言设计液晶显示器件驱动电路的方法。实验原理1.中文液晶显示模块(OCMJ128X32)的引脚说明引脚名称方向说明其它1VLED+I背光电源正极(LED+5v)2VLED-I背光电源负极(LED-5v)3VSSI地4VDDI(+5v)5REQI请求信号,高电平有效。6BUSYO应答信号=1:已经收到数据并正在处理
2、中 =0:模块空闲,可以接受数据7-14DB0DB7I数据0数据72.接口时序说明编号名称单位最小值最大值说明1TruS0.4-数据线上数据稳定时间2TbuS220最大模块响应时间3TrtuS11-最小REQ保持时间4Ts1uS2045最大数据接收时间5Ts2uS-0.1-30最大命令指令处理时间3.用户命令格式(1)实验用液晶显示器模块(OCMJ)命令帧分为操作码及操作数两部分。(2)字符命令:1、显示国标汉字,2、显示8X8ASCII字符,3、显示8X16ASCII字符 图形显示命令:4、显示位点阵,5、显示字节点阵 屏幕控制命令:6、清屏,7、上移,8、下移、9、左移、10、右移(3)命
3、令帧 显示国标汉字 命令格式:F0 XX YY QQ WW XX:为以汉字为单位的屏幕行坐标值,取值范围00到07。 YY:为以汉字为单位的屏幕列坐标值,取值范围00到01。 QQ WW:坐标位置上要显示的GB2310汉字区位码。4其它未尽内容请参见实验指导书(P188-P200)实验内容与要求1.设计一个液晶显示驱动电路,要求能够显示两行不少于14个字的汉字字符,且具有清屏、左移、上移功能。显示内容自定。(6分)2.设计一个液晶显示驱动电路,要求能够显示至少两个周期的三角波形,并显示“T=30mS”的字样。(4分)3.在上述2的基础上增加显示方波的功能,且可通过按键实现三角波和方波的切换显示
4、(3)。1.library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity zjf1 is port(clk: in std_logic; clear: in std_logic; -清零命令 left: in std_logic; -左移命令 right: in std_logic; -右移命令 busy: in std_logic; -忙信号标志 data : out std_logic_vector(7 downto 0); -
5、8位数据输出 req : out std_logic); -请求信号 end entity zjf1; architecture art of zjf1 is signal s:std_logic_vector(31 downto 0); -汉字高位和低位的区位码 signal n:std_logic_vector(3 downto 0); -显示十六个汉字的选择信号 signal count:std_logic_vector(2 downto 0); -五个字节命令的计数器 signal sel:std_logic; -显示十六个汉字的进位时钟信号 signal gateclock:std_
6、logic; -5个字节命令的计数器时钟信号 signal scanclk:std_logic; -分频时钟信号 begin process(clk,scanclk) variable scan: std_logic_vector(20 downto 0); -分频进程 begin if clkevent and clk=1 then if scan=111111111111111111111 then scan:=000000000000000000000; else scan:=scan+1; end if; end if; scanclk=scan(3); end process; pr
7、ocess(gateclock) -5个字节计数器的进程 begin if gateclockevent and gateclock=1 then if count=100 then count=000; else count=count+1; end if; end if; end process; process (scanclk) is begin if rising_edge(scanclk) then if busy = 0 then if clear = 1 then data=xf4; elsif right=1 then data=xf5; elsif left=1 then
8、datadata=xf0; seldatadata=s(23 downto 16);seldatadatanull; end case; end if; gateclock=1; ELSE gateclock=0; end if; end if; end process; req=1 when gateclock=1 else 0; process(sel) begin if selevent and sel=0 then n s s s s s s s s s s s s s s s snull; end case; end if; end process; end architecture
9、; 2.library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity zjf2 is port(clock,busy:in std_logic; req:out std_logic; DATE:out std_logic_vector(7 to 0);end entity zjf2 ;architecture art of zjf2 issignal r: std_logic;signal db,db3,db4: std_logic_vector(7 to 0);signal js:std_logic_vector(3 downto 0);signal n: std_logic_vector(10 to 0);signal b,clk1,clk2:std_logic;signal XX,YY:std_logic_vector(7