求一FPGA控制LCD12864程序,程序用VHDL编写,且LCD是串行发送数据,急求!!!

求一FPGA控制LCD12864程序,程序用VHDL编写,且LCD是串行发送数据,急求!!!,第1张

//>

显示的一个,给你吧

#include<reg52h>

#define Data P0

#define uint unsigned int

#define uchar unsigned char

sbit RS = P2^0;

sbit RW = P2^1;

sbit E = P2^2;

sbit PSB = P1^3;

sbit RET = P1^6;

/////////////////////////////////////////////////////////////////////////

// Bitmap点阵数据表 //

// : C:\桌面\1111bmp,横向取模左高位,数据排列:从左到右从上到下 //

// 尺寸: 128 64 //

/////////////////////////////////////////////////////////////////////////

unsigned char code nBitmapDot[] = // 数据表

{

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xBF,0xFF,0xFF,0xFF,0xFE,0x7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xFF,0xFF,0xBF,0xFF,0xFF,

0xFF,0xF9,0xFF,0xFF,0xFB,0xFF,0x9F,0xFE,

0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xF9,0xFF,0xFF,0xFD,0x4F,0xE0,0x3F,

0x63,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0x1C,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0x02,0x9F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF

};

void delayUs() ;

void wait();

void writeData(uchar dat)

{

wait();

RS = 1;

RW = 0;

E = 0;

Data = dat;

E = 1;

delayUs();

E = 0;

}

void delayUs()

{uint j,i;

for(i=2;i>0;i--)

for(j = 1; j > 0; j--);

}

void delayMs(uint a)

{

uint i, j;

for(i = a; i > 0; i--)

for(j = 100; j > 0; j--);

}

bit checkBusy()

{

bit busy;

RS = 0;

RW = 1;

E = 1;

delayUs();

busy = (bit)(Data&0x80);

E = 0;

return busy;

}

void wait()

{

while(checkBusy());

}

void writeCmd(uchar cmd)

{

wait();

RS = 0;

RW = 0;

E = 0;

delayUs();

Data = cmd;

delayUs();

E = 1;

delayUs();

E = 0;

}

void init()

{ RET=1;

PSB = 1; //并口方式

writeCmd(0x30); //基本指令, 扩充指令为34H

delayMs(20);

writeCmd(0x0c); //显示开, 关光标

delayMs(20);

writeCmd(0x01); //清屏

delayMs(20);

}

void display(uchar p)

{ uchar x,y;

for(y=0;y<32;y++)

for (x=0;x<8;x++)

{ writeCmd(0x36);

writeCmd(0x80+y);

writeCmd(0x80+x);

writeData(p[2x+16y]); writeData(p[2x+16y+1]); writeCmd(0x30);

}

for(y=0;y<32;y++)

for (x=0;x<8;x++)

{ writeCmd(0x36);

writeCmd(0x80+y);

writeCmd(0x80+x+8);

writeData(p[2x+16y+512]); writeData(p[2x+16y+513]); writeCmd(0x30);

}

}

void main()

{

RET=0;

init();

while(1)

{

display(nBitmapDot); delayMs(100000);

} }

买12864液晶屏时,厂家都会给测试程序的,就是C语言的。根据测试程序,改一下引脚定义就行了,编译一下测试程序,看能不能显示。如果能显示了,就可以自己根据测试程序一点点修改。

如果找不到厂家,就只好在网上找了,但不容易与你的晶屏相符。

实在不会,读一下测试程序,显示汉字的方法都是,用汉字取模软件,先取汉字点阵数据,用这些数据代替测试程序的点阵数据,看是不是能显示自己的取模的汉字了。

因液晶屏显示汉字,取模方式有多种,如果显示乱码,说明取模方式不对,再换一种,直到显示出汉字为止。这样就可以,对测试程序进行修改成自己看得懂,又实用的程序了。

以上就是关于求一FPGA控制LCD12864程序,程序用VHDL编写,且LCD是串行发送数据,急求!!!全部的内容,包括:求一FPGA控制LCD12864程序,程序用VHDL编写,且LCD是串行发送数据,急求!!!、用AT89C52,使其在128*64点阵LCD屏幕上显示“河南理工大学”,并向上滚动显示,一下是部分程序,帮忙解释、求一个STC-89C52RC控制12864液晶显示的程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/10164091.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存