我们从2011年坚守至今,只想做存粹的技术论坛。  由于网站在外面,点击附件后要很长世间才弹出下载,请耐心等待,勿重复点击不要用Edge和IE浏览器下载,否则提示不安全下载不了

 找回密码
 立即注册
搜索
查看: 1180|回复: 0

TFT液晶屏测试程序-模拟/数字

[复制链接]

该用户从未签到

1万

主题

1292

回帖

936

积分

管理员

积分
936

社区居民最爱沙发原创达人社区明星终身成就奖优秀斑竹奖宣传大使奖特殊贡献奖

QQ
发表于 2013-7-30 19:01:05 | 显示全部楼层 |阅读模式
TFT液晶屏测试程序0推荐TFT液晶屏测试程序该程序实现在一个800*600的TFT液晶屏上显示彩条。module testTFT(clk,rst_n,//datadata_R,data_G,data_B,//controlhsync,vsync,ena,TxCLK);input clk;input rst_n;output[5:0] data_R;//红output[5:0] data_G;//绿output[5:0] data_B;//蓝output hsync;//行同步output vsync;//帧同步output TxCLK;//数据发送时钟output ena;//数据使能reg[5:0] data_R;reg[5:0] data_G;reg[5:0] data_B;reg Tx;reg Hs;reg Vs;reg En;reg[19:0] counter;wire TxCLK = Tx | clk ;wire hsync = Hs | ((counter%900>=3) && (counter%900<=12) && (counter<=540002))? 1 : 0;wire vsync = Vs | ((counter >=3) && (counter <=902)) ? 1 : 0;wire ena = En | ((((counter%900>=0) && (counter%900<=50)) || ((counter%900>=851) && (counter%900<=899))) || (counter >=540002)) ? 0 : 1;//serial counter//采用32.768MHz的晶振,计数的结果为每帧16msalways @(posedge clk or negedge rst_n)if(!rst_n) counter <=0;else if(counter ==555555) counter <=0;else counter <=counter +1;always @(posedge clk or negedge rst_n)beginif(!rst_n) begin Tx=1;Hs=1;Vs=1;En=1; endelse if((counter>=3 ) && (counter<180002))begin data_R=6'b111111;data_G=6'b111111;data_B=6'b000000;Tx=0;Hs=0;Vs=0;En=0;endelse if((counter>=180002 ) && (counter<360002))begin data_R=6'b111111;data_G=6'b000000;data_B=6'b111111;Tx=0;Hs=0;Vs=0;En=0;endelsebegin data_R=6'b000000;data_G=6'b111111;data_B=6'b111111;Tx=0;Hs=0;Vs=0;En=0;endendendmodule关于FPGA“程序”,有人觉得FPGA用语言写的不叫程序,叫代码,因为这是硬件,并行执行的。个人觉得那种说法有点偏执,就像有人纠结于是否只有研究生学历才能做FPGA开发一样。做研发很多时候都是看个人的综合能力,什么学历出身之类的都是浮云。很多人用FPGA并不是用来实现一些复杂的功能,正如很多人用C语言也不是用来做算法一样,所以该怎么做就怎么做。</table
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

论坛开启做任务可以
额外奖励金币快速赚
积分升级了


Copyright ©2011-2024 NTpcb.com All Right Reserved.  Powered by Discuz! (NTpcb)

本站信息均由会员发表,不代表NTpcb立场,如侵犯了您的权利请发帖投诉

平平安安
TOP
快速回复 返回顶部 返回列表