fpga驱动rgb液晶屏_请教FPGA驱动液晶屏只有黑屏

请求帮助:我写了一个简单的LCD驱动程序,根据时序来写的,但是一下载进去,屏幕就是黑色的,不论怎么修改都是这样,请问下是什么原因呢。我使用了DE模式,下面程序代码,clk是从PLL中引出的60Mhz,DCLK是像素时钟。

module de(

input clk,

input rst_n,

output reg[7:0] red,

output reg[7:0] green,

output reg[7:0] blue,

output reg  DCLK,

output DE

);

//DCLK produce pll 1/2 div frequent clk 60M,DCLK 30M

always@(posedge clk or negedge rst_n)

begin

if(!rst_n) DCLK <= 1'd0;

else       DCLK <= ~DCLK;

end

//H cnt

reg[9:0] cnt_h;

always@(negedge DCLK or negedge rst_n) //DCLK negedge locked data

begin

if(!rst_n)                cnt_h <=10'd0;

else if(cnt_h < 10'd928)  cnt_h<=cnt_h+1'd1;

else                      cnt_h <= 10'd0;

end

//DE_h

wire DE_h;

assign DE_h=(cnt_h<10'd128)?1'd0:1'd1;

//V cnt

reg[9:0] cnt_v;

always@(negedge DE_h or negedge rst_n)

begin

if(!rst_n)                cnt_v <= 10'd0;

else if(cnt_v < 10'd525)  cnt_v <=cnt_v+1'd1;

else                      cnt_v <= 10'd0;

end

//DE_v

wire DE_v;

assign DE_v=(cnt_v<10'd45)?1'd0:1'd1;

//DE produce

assign DE=DE_h&&DE_v;

//DISP area div xdis_cnt

reg[9:0]hdis_cnt;

always@(negedge DCLK or negedge rst_n)

begin

if(!rst_n) hdis_cnt<=10'd0;

else if(DE_h)hdis_cnt<=hdis_cnt+1'd1;

else

hdis_cnt<=10'd0;

end

always@(negedge DCLK or negedge rst_n)

begin

if(!rst_n)

begin

red<=8'b0000_0000;

green<=8'b0000_0000;

blue<=8'b0000_0000;

end

else if((hdis_cnt<200)&&DE)

begin

red<=8'b1111_1111;

green<=8'b0000_0000;

blue<=8'b0000_0000;

end

else if((hdis_cnt<400)&&DE)

begin

red<=8'b0000_0000;

green<=8'b1111_1111;

blue<=8'b0000_0000;

end

else if((hdis_cnt<600)&&DE)

begin

red<=8'b0000_0000;

green<=8'b0000_0000;

blue<=8'b1111_1111;

end

else if((hdis_cnt<800)&&DE)

begin

red<=8'b0000_0000;

green<=8'b0000_0000;

blue<=8'b1111_1111;

end

else

begin

red<=8'b0000_0000;

green<=8'b0000_0000;

blue<=8'b0000_0000;

end

end

endmodule

LCD的DE模式的时序图

时序特性图

请做过的指点下,谢谢了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值