自制单片机之七……LCD12864的驱动之源代码
//LCD12864
//**********************************************************
//连线表: CPU=89C51 SysClock=12MHz *
//RS=P1.0 R/W=P1.1 E=P1.2 CS1=P1.3 CS2=P1.4 *
//DB0-DB7=P0.0-P0.7 /Reset=InBoard *
//**********************************************************
#include
#include
#include
#include
#include
#define uchar unsigned char
#define uint unsigned int
/********************引脚定义********************/
#define DataPort P3 //LCD128*64 I/O 信号管脚
sbit RS =P2^0; //数据指令
sbit RW =P2^1; //读写
sbit E =P2^2; //使能
sbit CSL =P2^3; //左片选
sbit CSR =P2^4; //右片选
uchar Page; //页 地址
uchar Col; //列 地址
uchar co
uchar co
uchar co
uchar str[4];
/********************函数定义*******************/
void BusyL(void); //左屏检测忙
void BusyR(void); //右屏检测忙
void CheckBusy(void); //读取忙信号
void Delay(uint MS); //延时
void Locatexy(void); //将屏幕横向0-12纵向0-7转换成左、右屏的的X、Y
void WriteCommandL( uchar CommandByte ); //向左屏写入指令
void WriteCommandR( uchar CommandByte ); //向右屏写入指令
uchar ReadData( void ); //读数据
void WriteData( uchar DataByte ); //写数据
void LcmClear( void ); //清屏
void LcmInit( void ); //初始化
void LcmPutBMP( uchar *puts ); //显示一幅图
void LcmReverseBMP( void ); //将整屏反显
void LcmPutHZ_12( uchar x,uchar y,uchar HZcode ); //在屏幕上任意点显示一个12×12汉字
uchar * uchartostr(unsigned char unm); //将值转成字符串
void LcmPutAsc( uchar asc ); //显示一个5×7的ASC字符
void LcmPutstr( uchar row,uchar y,uchar * str ); //在设定位置显示字符串
void LcmPutpoint( uchar ro,uchar lie,uchar colour ); //在设定位置显示一个点
/***************************/
/*检查Busy */
/***************************/
void BusyL(void)
{
CSL= 1;
CSR= 0;
CheckBusy();
}
void BusyR(void)
{
CSL= 0;
CSR= 1;
CheckBusy();
}
void CheckBusy(void)
{
RS = 0; //指令
RW = 1;
DataPort= 0xFF; //输出0xff以便读取正确
E = 1;
_nop_();
while(0); //DataPort & 0x80); //Status Read Bit7 = BUSY 这地方有点问题,用了while(//DataPort & 0x80)后就一直读不到0了,陷入死循环。当用while(0) 时反而能正常工作,不知道有没有人能解释
E = 0;
_nop_();
}
/********************************************************/
/*根据设定的坐标数据,定位LCM上的下一个操作单元位置 */
/********************************************************/
void Locatexy(void)
{
uchar x,y;
switch (Col&0xc0) /* col.and.0xC0 */
{ /*条件分支执行 */
case 0: {BusyL();break;}/*左区 */
case 0x40: {BusyR();break;}/*右区 */
}
x = Col&0x3F|0x40; /* col.and.0x3f.or.Set Y Address*/
y = Page&0x07|0xB8; /* row.and.0x07.or.set Page */
CheckBusy(); /* waitting for enable */
RS = 0; //指令
RW = 0; //写
DataPort = y; //设置页面地址
E = 1;
_nop_();
E = 0;
_nop_();
CheckBusy(); /* waitting for enable */
RS = 0;
RW = 0;
DataPort = x; //设置列地址
E = 1;
_nop_();
E = 0;
_nop_();
}
/***************************/
/*写指令 */
/***************************/
void WriteCommandL( uchar CommandByte )
{
BusyL();
DataPort = CommandByte;
RS = 0; //指令
RW = 0;
E = 1;
_nop_();
E = 0;
_nop_();
}
void WriteCommandR( uchar CommandByte )
{
BusyR();
DataPort = CommandByte;
RS = 0; //指令
RW = 0;
E = 1;
_nop_();
E = 0;
_nop_();
}
/***************************/
/*读数据 */
/***************************/
uchar ReadData( void )
{
uchar DataByte;
Locatexy(); /*坐标定位,返回时保留分区状态不变 */
RS = 1; /*数据输出*/
RW = 1; /*读入 */
DataPort = 0xFF; //输出0xff以便读取正确
E = 1; /*读入到LCM*/
_nop_();
DataByte = DataPort; /*数据读出到数据口P1 */
E = 0;
_nop_();
return DataByte;
}
/***************************/
/*写数据 */
/***************************/
void WriteData( uchar DataByte )
{
Locatexy(); /*坐标定位,返回时保留分区状态不变 */
RS = 1; /*数据输出*/
RW = 0; /*写输出 */
DataPort = DataByte; /*数据输出到数据口 */
E = 1; /*写入到LCM*/
_nop_();
E = 0;
_nop_();
}
void LcmClear( void )
{
Page = 0;
Col = 0;
for(Page=0;Page<8;Page++)
for(Col=0;Col<128;Col++)
WriteData(0);
}
void LcmInit( void )
{
Delay(200); //等待复位
WriteCommandL(0x3f); //开显示
WriteCommandR(0x3f);
WriteCommandL(0xc0); //设置起始地址=0
WriteCommandR(0xc0);
WriteCommandL(0x3f); //开显示
WriteCommandR(0x3f);
LcmClear();
Col = 0;
Page= 0;
Locatexy();
}
void LcmPutBMP( uchar *puts )
{
uint X=0;
Page = 0;
Col = 0;
for(Page=0;Page<8;Page++)
{
for(Col=0;Col<128;Col++)
{
WriteData( puts[X] );
X++;
}
}
}
void LcmReverseBMP( void )
{
uchar temp;
Page = 0;
Col = 0;
for(Page=0;Page<8;Page++)
{
for(Col=0;Col<128;Col++)
{
temp = ReadData(); //空读一次
temp = ReadData();
temp = ~temp;
WriteData(temp);
}
}
}
void LcmPutHZ_12( uchar x,uchar y,uchar HZcode )
{
uchar offset,Rd,Wt,m,tmp,i;
uint n;
if(x<117&y<53) //x为横向起始点数0-117,超过117就显示不全一个汉字了。y同理。
{
Page=(y & 0x38)>>3; //将竖向的点阵数y转换成页数
Col=x; //横向的X就是LCD的列数。
n = 0x18*HZcode; //一个汉字24字节(18H),HZcode为字库序号。n就是要显示汉字的起始地址
offset=y&0x07; //将显示该页的竖向偏移量。
if(offset<5) //如果偏移量小于5,那么在竖向用两个页的范围就可显示出汉字了。
{
for(i=12;i>0;i--)
{
Rd=ReadData();
Rd=ReadData(); //读出LCD该Page、Col位置的上半个数据。
m=HZK_12[n]; //读出汉字模第n的数据。
Wt=Rd&(0xff>>(8-offset))|(m<
Page++; //页位置移到下半个汉字位置
n++;
tmp=m; //将取得的上半个字模数据交给tmp
m=HZK_12[n]; //取下半个字模数据
Rd=ReadData(); //读LCD下半个字模数据
Rd=ReadData();
Wt=tmp>>(8-offset)|(m<
Col++;//列数增加一
Page--;//将页数返回上半个汉字位置。
n++;
}
}
else //如果偏移量大于或等于5,竖向就要用3个页的范围来显示一个汉字了。
{
for(i=12;i>0;i--)
{
Rd=ReadData();
Rd=ReadData(); //读取LCD上汉字上部位置的原来数据。
m=HZK_12[n]; //读取汉字模数据
Wt=Rd&(0xff>>(8-offset))|(m<
Page++; //到下一页即汉字中部位置
n++;
tmp=m; //上半个字模交给tmp
m=HZK_12[n]; //读取下半个字模
Wt=tmp>>(8-offset)|(m<
Page++; //到下一页即汉字下部位置
n++;
Rd=ReadData();
Rd=ReadData(); //读取LCD上汉字下部位置的原来数据
Wt=m>>(8-offset)|(Rd&(0xff<<(offset-4))); //嵌入
WriteData(Wt); //写回
Page=Page-2;//恢复位置
Col++; //修正下一个汉字的起始位置
}
}
}
}
uchar * uchartostr(uchar unm)
{
uchar x00,xx,x0,x,n;
x00=unm/100;
xx=unm%100;
x0=xx/10;
x=xx%10;
n=0;
if(x00!=0)
{ str[n]=x00+48; //值加48即为字符
n++;
}
if(!(x00==0&x0==0))
{ str[n]=x0+48;
n++;
}
str[n]=x+48;
n++;
str[n]= ;
return str;
}
void LcmPutAsc( uchar asc )
{
uchar j;
uint x;
x = 5*(asc-32);
for(j=0;j<5;j++)
{
WriteData(ASC_5x7[x]);
x++;
Col++;
}
WriteData(0x00);
Col++;
}
void LcmPutstr( uchar row,uchar y,uchar * str )
{ unsigned char * x;
x=str;
Page=row;
Col=y;
while(*x!= )
{ LcmPutAsc( *x );
x++;
}
}
void LcmPutpoint( uchar ro,uchar lie,uchar colour ) //画点函数
{
if((ro<64)&(lie<128))
{
uchar modbyte,outByte;
uchar offsetbit;
Col=lie; //列等于lie
Page=(ro & 0x38)>>3; //页等于行数row与00111000B再右移3位
offsetbit=ro&0x07; //偏移量为行数与00000111
modbyte=1;
modbyte<<= offsetbit; //输出位的模00000001左移offsetbit位
outByte=ReadData();
outByte=ReadData();
if(colour==0)
{
modbyte=~modbyte;
outByte=modbyte&outByte; //输出位不影响其它位
}
else outByte=modbyte|ReadData(); //输出位不影响其它位
WriteData(outByte);
}
}
void Delay(uint MS)
{
uchar us,usn;
while(MS!=0)
{
usn = 2; //for 12M
while(usn!=0)
{
us=0xf6;
while (us!=0){us--;};
usn--;
}
MS--;
}
}
void Main( void )
{
uchar x,i;
LcmInit();
LcmClear();
while(1)
{
LcmClear();
LcmPutBMP(BMP1);
Delay(3000);
LcmClear();
//LcmReverseBMP();
Delay(1000);
//LcmClear();
x=0;
for(i=0;i<8;i++)
{
LcmPutHZ_12(x,i*7,i);
x=x+16;
}
LcmPutstr( 4,2,"Hello" );
LcmPutstr( 6,35,"World!" );
Delay(5000);
}
}
unsigned char co
//-- 调入了一幅图像:
//宽度x高度=1264
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0xE0,0xF0,0xFC,0xFE,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x9F,0xCF,0xDF,0x9F,
0x9E,0x3E,0xFF,0xFE,0xFE,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFA,0xFC,0xF8,0xE0,0xC0,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0xC0,0xF0,0xF8,0xFC,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xEF,
0xCF,0xDF,0x9F,0x0F,0x1F,0x7F,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFE,0xFC,0xF0,0xC0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC0,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF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7F,0x7F,0x7F,
0x7F,0x7F,0x07,0x07,0x0F,0x1F,0x3F,0x7F
};
//ASCII字符
unsigned char co
0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x4F, 0x00, 0x00, //
0x00, 0x07, 0x00, 0x07, 0x00, //
0x14, 0x7F, 0x14, 0x7F, 0x14, //
0x24, 0x2A, 0x7F, 0x2A, 0x12, //
0x23, 0x13, 0x08, 0x64, 0x62, //
0x36, 0x49, 0x55, 0x22, 0x50, //
0x00, 0x05, 0x03, 0x00, 0x00, //
0x00, 0x1C, 0x22, 0x41, 0x00, //
0x00, 0x41, 0x22, 0x1C, 0x00, //
0x14, 0x08, 0x3E, 0x08, 0x14, //
0x08, 0x08, 0x3E, 0x08, 0x08, //
0x00, 0x50, 0x30, 0x00, 0x00, //
0x08, 0x08, 0x08, 0x08, 0x00, //
0x00, 0x60, 0x60, 0x00, 0x00, //
0x20, 0x10, 0x08, 0x04, 0x02, //
0x3E, 0x51, 0x49, 0x45, 0x3E, //
0x00, 0x42, 0x7F, 0x40, 0x00, //
0x42, 0x61, 0x51, 0x49, 0x46, //
0x21, 0x41, 0x45, 0x4B, 0x31, //
0x18, 0x14, 0x12, 0x7F, 0x10, //
0x27, 0x45, 0x45, 0x45, 0x39, //
0x3C, 0x4A, 0x49, 0x49, 0x30, //
0x01, 0x01, 0x79, 0x05, 0x03, //
0x36, 0x49, 0x49, 0x49, 0x36, //
0x06, 0x49, 0x49, 0x29, 0x1E, //
0x00, 0x36, 0x36, 0x00, 0x00, //
0x00, 0x56, 0x36, 0x00, 0x00, //
0x08, 0x14, 0x22, 0x41, 0x00, //
0x14, 0x14, 0x14, 0x14, 0x14, //
0x00, 0x41, 0x22, 0x14, 0x08, //
0x02, 0x01, 0x51, 0x09, 0x06, //
0x32, 0x49, 0x79, 0x41, 0x3E, //
0x7E, 0x11, 0x11, 0x11, 0x7E, //
0x41, 0x7F, 0x49, 0x49, 0x36, //
0x3E, 0x41, 0x41, 0x41, 0x22, //
0x41, 0x7F, 0x41, 0x41, 0x3E, //
0x7F, 0x49, 0x49, 0x49, 0x49, //
0x7F, 0x09, 0x09, 0x09, 0x01, //
0x3E, 0x41, 0x41, 0x49, 0x7A, //
0x7F, 0x08, 0x08, 0x08, 0x7F, //
0x00, 0x41, 0x7F, 0x41, 0x00, //
0x20, 0x40, 0x41, 0x3F, 0x01, //
0x7F, 0x08, 0x14, 0x22, 0x41, //
0x7F, 0x40, 0x40, 0x40, 0x40, //
0x7F, 0x02, 0x0C, 0x02, 0x7F, //
0x7F, 0x06, 0x08, 0x30, 0x7F, //
0x3E, 0x41, 0x41, 0x41, 0x3E, //
0x7F, 0x09, 0x09, 0x09, 0x06, //
0x3E, 0x41, 0x51, 0x21, 0x5E, //
0x7F, 0x09, 0x19, 0x29, 0x46, //
0x26, 0x49, 0x49, 0x49, 0x32, //
0x01, 0x01, 0x7F, 0x01, 0x01, //
0x3F, 0x40, 0x40, 0x40, 0x3F, //
0x1F, 0x20, 0x40, 0x20, 0x1F, //
0x7F, 0x20, 0x18, 0x20, 0x7F, //
0x63, 0x14, 0x08, 0x14, 0x63, //
0x07, 0x08, 0x70, 0x08, 0x07, //
0x61, 0x51, 0x49, 0x45, 0x43, //
0x00, 0x7F, 0x41, 0x41, 0x00, //
0x02, 0x04, 0x08, 0x10, 0x20, //
0x00, 0x41, 0x41, 0x7F, 0x00, //
0x04, 0x02, 0x01, 0x02, 0x04, //
0x40, 0x40, 0x00, 0x40, 0x40, //
0x01, 0x02, 0x04, 0x00, 0x00, //
0x20, 0x54, 0x54, 0x54, 0x78, //
0x7F, 0x48, 0x44, 0x44, 0x38, //
0x38, 0x44, 0x44, 0x44, 0x28, //
0x38, 0x44, 0x44, 0x48, 0x7F, //
0x38, 0x54, 0x54, 0x54, 0x18, //
0x00, 0x08, 0x7E, 0x09, 0x02, //
0x0C, 0x52, 0x52, 0x4C, 0x3E, //
0x7F, 0x08, 0x04, 0x04, 0x78, //
0x00, 0x44, 0x7D, 0x40, 0x00, //
0x20, 0x40, 0x44, 0x3D, 0x00, //
0x00, 0x7F, 0x10, 0x28, 0x44, //
0x00, 0x41, 0x7F, 0x40, 0x00, //
0x7C, 0x04, 0x78, 0x04, 0x78, //
0x7C, 0x08, 0x04, 0x04, 0x78, //
0x38, 0x44, 0x44, 0x44, 0x38, //
0x7E, 0x0C, 0x12, 0x12, 0x0C, //
0x0C, 0x12, 0x12, 0x0C, 0x7E, //
0x7C, 0x08, 0x04, 0x04, 0x08, //
0x58, 0x54, 0x54, 0x54, 0x64, //
0x04, 0x3F, 0x44, 0x40, 0x20, //
0x3C, 0x40, 0x40, 0x3C, 0x40, //
0x1C, 0x20, 0x40, 0x20, 0x1C, //
0x3C, 0x40, 0x30, 0x40, 0x3C, //
0x44, 0x28, 0x10, 0x28, 0x44, //
0x1C, 0xA0, 0xA0, 0x90, 0x7C, //
0x44, 0x64, 0x54, 0x4C, 0x44, //
0x00, 0x08, 0x36, 0x41, 0x00, //
0x00, 0x00, 0x77, 0x00, 0x00, //
0x00, 0x41, 0x36, 0x08, 0x00, //
0x02, 0x01, 0x02, 0x04, 0x02, //
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, //
};
unsigned char co
//- 宋体11; 此字体下对应的点阵为:宽x高=11x12
0x42,0x00,0x22,0x00,0x12,0x00,0xFA,0x07,0x4E,0x01,0x4B,0x01,0x4A,0x01,0x4A,0x05,
0xFA,0x07,0x02,0x00,0x02,0x00,0x00,0x00,/*"有",{0}*/
0x42,0x04,0xAE,0x04,0x93,0x04,0x9A,0x02,0xA6,0x01,0xC0,0x00,0xA6,0x04,0x9A,0x04,
0x8A,0x04,0x96,0x03,0x20,0x00,0x00,0x00,/*"努",{1}*/
0x00,0x04,0x08,0x04,0x08,0x02,0x08,0x01,0xC8,0x00,0x3F,0x00,0x08,0x04,0x08,0x04,
0x08,0x04,0xFC,0x03,0x08,0x00,0x00,0x00,/*"力",{2}*/
0x02,0x02,0xFA,0x01,0x4B,0x04,0xCA,0x07,0x7A,0x01,0x02,0x04,0x08,0x03,0xFF,0x00,
0xC8,0x07,0x0E,0x04,0x08,0x07,0x00,0x00,/*"就",{3}*/
0x42,0x00,0x22,0x00,0x12,0x00,0xFA,0x07,0x4E,0x01,0x4B,0x01,0x4A,0x01,0x4A,0x05,
0xFA,0x07,0x02,0x00,0x02,0x00,0x00,0x00,/*"有",{4}*/
0x00,0x04,0xFC,0x03,0x24,0x01,0x24,0x02,0xE4,0x01,0x04,0x04,0x7F,0x02,0x84,0x01,
0x45,0x02,0x36,0x04,0x04,0x07,0x00,0x00,/*"成",{5}*/
0x02,0x01,0x02,0x01,0xFE,0x00,0x82,0x04,0x82,0x04,0x08,0x02,0x88,0x01,0x7F,0x04,
0x08,0x04,0x08,0x04,0xF8,0x03,0x00,0x00,/*"功",{6}*/
0x00,0x00,0x1C,0x00,0x7E,0x03,0x7E,0x03,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00/*"!",{7}*/
};
本程序的实际效果图如下。
![](http://m.amcfsurvey.com/editerupload/fetch/20161101/316081_1_1.jpg)
评论