打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【精品博文】Altera-DE2试用之GPIO扩展LCD液晶显示屏

VGA 显示驱动的时序相比,LCD 显示驱动的时序大同小异。LCD 输出的色彩信号是直接通过565 RGB 并口数字信号(即5bit 代表色彩,6bit 代表色彩,5bit 代表色彩)传输的;VGA 输出的色彩信号,最终虽然是个分别代表RGB 0~0.7V 模拟电平,但是由于FPGA不能直接输出模拟信号,所以它们通过一颗路的高速ADC 芯片ADV7123 来实现电平转换,因此在我们的FPGA 驱动实现中,起始输出的也是和LCD 一样的565 RGB 数字信号。

VGA 的同步信号是HSYNC VSYNC,它们在每行或每场数据的空闲产生高脉冲来达到同步的目的;而我们所使用的LCD,其信号同步方式不仅可以使用和VGA 类似的HSYNC VSYNC信号,也可以使用DE 信号来实现同步。当然了,无论是HSYNC/VSYNC 同步方式,还是DE 同步方式,对我们内部驱动时序的逻辑计数要求都是差不多的。如图所示,DE HSYNC/VSYNC 摆在一起,它们的关系一目了然。DE 脉冲有效(高电平)期间,表示当前的RGB 数据是有效的,即显示在显示屏上的像素点色彩数据。

相对于HSYNC/VSYNC 驱动,DE 驱动方式反而更简洁一些,它的时序

波形如图所示。

为了便于实际的驱动计数器的时序产生, 我们还是需要和HSYNC/VSYNC 驱动方式一样,对行和列计数器的同步脉冲、后沿脉冲、显示脉冲、前沿脉冲做定义,它的脉冲计数表如下所示。注意列的单位为,而行的单位为基准时钟周期数,即33MHz 时钟脉冲数。

LCD 驱动时序参数表

GPIO扩展硬件连接

DE2开发板上GPIO原理图

LCD液晶屏原理图

对应管脚分配:

#clock & Reset

       set_location_assignment PIN_N1  -to rst_n

       set_location_assignment PIN_N2  -to clk

       #LCD 800*480

       set_location_assignment PIN_U21 -to lcd_reset

       set_location_assignment PIN_U20 -to lcd_pwm

       set_location_assignment PIN_K26 -to lcd_de

       set_location_assignment PIN_K25 -to lcd_dclk

       set_location_assignment PIN_M22 -to lcd_vs

       set_location_assignment PIN_M23 -to lcd_hs

       set_location_assignment PIN_T21 -to lcd_red[7]

       set_location_assignment PIN_T20 -to lcd_red[6]

       set_location_assignment PIN_U26 -to lcd_red[5]

       set_location_assignment PIN_U25 -to lcd_red[4]

       set_location_assignment PIN_U23 -to lcd_red[3]

       set_location_assignment PIN_U24 -to lcd_red[2]

       set_location_assignment PIN_R19 -to lcd_red[1]

       set_location_assignment PIN_T19 -to lcd_red[0]

       set_location_assignment PIN_R25 -to lcd_green[7]

       set_location_assignment PIN_R24 -to lcd_green[6]

       set_location_assignment PIN_R20 -to lcd_green[5]

       set_location_assignment PIN_T22 -to lcd_green[4]

       set_location_assignment PIN_T23 -to lcd_green[3]

       set_location_assignment PIN_T24 -to lcd_green[2]

       set_location_assignment PIN_T25 -to lcd_green[1]

       set_location_assignment PIN_T18 -to lcd_green[0]

       set_location_assignment PIN_M19 -to lcd_blue[7]

       set_location_assignment PIN_M20 -to lcd_blue[6]

       set_location_assignment PIN_N20 -to lcd_blue[5]

       set_location_assignment PIN_M21 -to lcd_blue[4]

       set_location_assignment PIN_M24 -to lcd_blue[3]

       set_location_assignment PIN_M25 -to lcd_blue[2]

       set_location_assignment PIN_N24 -to lcd_blue[1]

       set_location_assignment PIN_P24 -to lcd_blue[0]

最终显示效果图:

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
小西妈分享 | 世界上最全的颜色英文说法! (必须直视de小西妈颜色贴)
Python 进阶之术 set(集合)数据结构
c#的图片合成
与颜色有关的英语口语
“那些色色的英文表达” 污~ 学起来
我用CH579做了个假手表
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服