中文图形12864点阵液晶显示模块与51单片机的并行接口电路及c51程序设计

合集下载

51单片机和12864液晶显示实例——C语言

51单片机和12864液晶显示实例——C语言

#include <reg51.h>#define unchar unsigned char #define unint unsigned intsbit RS=P2^7;sbit RW=P2^6;sbit E=P2^5;void delay(unsigned int t){unsigned int i,j;for(i=0;i<t;i++)for(j=0;j<10;j++);}void busy(){RS=0;RW=1;E=1;P0=0xff;while((P0&0X80)==0x80); }void write_com(unchar com) {busy();RS=0;RW=0;E=1;P0=com;delay(5);E=0;delay(5);}void write_date(unchar date) {busy();RS=1;RW=0;E=1;P0=date;// delay(5);E=0;// delay(5);}void init(){delay(2000);write_com(0x30); //选择基本指令,选择8位数据流delay(5);write_com(0x0c); //开显示(无游标,不反白)delay(10);write_com(0x01); //清除显示,并且设定地址指针为00H delay(500);write_com(0x06);// 设定游标移动方向}void sendaddr(unchar n,unchar m){switch(n){case 1:write_com(0x80+m);break;case 2:write_com(0x90+m);break;case 3:write_com(0x88+m);break;case 4:write_com(0x98+m);break;}}void display(unchar n,unchar m,unchar *s){sendaddr(n,m);while(*s>0){write_date(*s);s++;delay(100);}}void main(){unchar *s;init();s="甲:“我来了”";display(1,0,s);s="乙:“热烈欢迎。

C51单片机和12864液晶显示制作十位简易计算器C源码

C51单片机和12864液晶显示制作十位简易计算器C源码

#include <reg51.h>#include<intrins.h>#include<math.h>#include<stdlib.h>sbit RS=P2^0;sbit RW=P2^1;sbit E=P2^2;sbit BUZZER=P1^0;#define unchar unsigned char#define unint unsigned intvoid delay(unsigned int t){unsigned int i,j;for(i = 0;i < t;i ++)for(j = 0;j < 120;j ++);}void busy() //判断忙状态{RS=0;RW=1;E=1;P0=0xff;while((P0&0X80)==0x80);_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();}void write_com( unsigned char com){ _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();busy();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();RS=0;RW=0;E=1;P0=com;_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();E=0;_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();}void write_date(unchar date){ _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();busy();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();RS=1;RW=0;E=1;P0=date;E=0;}void init() //液晶初始化{write_com(0x30); //选择基本指令,选择8位数据流_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();write_com(0x0c); //开显示(无游标,不反白)0x0e显示游标_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();write_com(0x01); //清除显示,并且设定地址指针为00H_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_(); _nop_();write_com(0x06);// 设定游标移动方向}void sendaddr(unchar n,unchar m) //送地址{switch(n){case 1:write_com(0x80+m);break;case 2:write_com(0x90+m);break;case 3:write_com(0x88+m);break;case 4:write_com(0x98+m);break;}}void display(unchar n,unchar m,unchar *s) //显示字符串{sendaddr(n,m);while(*s>0){write_date(*s);s++;}void clearscreen() //清屏{write_com(0x01);}void tishi(){clearscreen();display(1,0,"超出计算范围");display(2,0,"请按复位键");display(3,0,"并重新输入");display(4,0,"否则会出现错误");}void displayshu(unchar n,unchar m, long rzt) //显示字符串{ unchar i,j,k,x,p;unchar t[10]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};unsigned char array[10];array[9]=(int)rzt%10;array[8]=((int)rzt/10)%10;array[7]=((int)rzt/100)%10;array[6]=((int)rzt/1000)%10;array[5]=((int)rzt/10000)%10;array[4]=((int)rzt/100000)%10;array[3]=((int)rzt/1000000)%10;array[2]=((int)rzt/10000000)%10;array[1]=((int)rzt/100000000)%10;array[0]=(int)rzt/1000000000;sendaddr(n,m);for(i=0;i<10;i++){if(array[i]==0)p=i;elsebreak;}for(j=p+1;j<10;j++){t[k]=array[j] ;k++;}while(t[x]!=0xff)write_date(t[x]+0x30);x++;}}void main(void){unchar i,j,opt,p;long b,c,rzt;start:init();delay(20);i=0;j=0;rzt=0;b=0;c=0;write_com(0x80);while(1) //输入第一个数{P3=0xfe;if(P3!=0xfe){delay(40);if(P3!=0xfe){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(0+0x30);b=b*10+0;i++;if(i==11)tishi(); break;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(1+0x30);b=b*10+1;i++;if(i==11)tishi(); break;case0xd0:BUZZER=0;delay(80);BUZZER=1;write_date(2+0x30);b=b*10+2;i++;if(i==11)tishi(); break;case0xe0:BUZZER=0;delay(80);BUZZER=1;write_date(3+0x30);b=b*10+3;i++;if(i==11)tishi(); break;}if(P3!=0xfe);delay(30);while(P3!=0xfe);}}P3=0xfd;if(P3!=0xfd){delay(40);if(P3!=0xfd){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(4+0x30);b=b*10+4;i++;if(i==11)tishi(); break;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(5+0x30);b=b*10+5;i++;if(i==11)tishi(); break;case0xd0:BUZZER=0;delay(80);BUZZER=1;write_date(6+0x30);b=b*10+6;i++;if(i==11)tishi(); break;case0xe0:BUZZER=0;delay(80);BUZZER=1;write_date(7+0x30);b=b*10+7;i++;if(i==11)tishi(); break;}if(P3!=0xfd);delay(30);while(P3!=0xfd);}}P3=0xfb;if(P3!=0xfb){delay(40);if(P3!=0xfb){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(8+0x30);b=b*10+8;i++;if(i==11) tishi(); break;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(9+0x30);b=b*10+9;i++;if(i==11) tishi(); break;case0xd0:BUZZER=0;delay(80);BUZZER=1;p=1;write_com(0x97);write_date(0x2b);opt=10; goto two; break;case0xe0:BUZZER=0;delay(80);BUZZER=1;p=1;write_com(0x97);write_date(0x2d);opt=11; goto two; break;}if(P3!=0xfb);delay(30);while(P3!=0xfb);}}P3=0xf7;if(P3!=0xf7){delay(40);if(P3!=0xf7){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;p=1;write_com(0x97);write_date(0x2a);opt=12; goto two; break;case0xb0:BUZZER=0;delay(80);BUZZER=1;p=1;write_com(0x97);write_date(0x2f);opt=13; goto two; break;case 0xd0:BUZZER=0;delay(80);BUZZER=1; clearscreen();goto start;break;case 0xe0:BUZZER=0;delay(80);BUZZER=1; clearscreen();goto start;break;}if(P3!=0xf7);delay(30);while(P3!=0xf7);}}}two:write_com(0x88);while(1) //输入第二个数{P3=0xfe;if(P3!=0xfe){delay(40);if(P3!=0xfe){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(0+0x30);c=c*10+0;j++;if(j==11)tishi(); break;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(1+0x30);c=c*10+1;j++;if(j==11)tishi(); break;case0xd0:BUZZER=0;delay(80);BUZZER=1;write_date(2+0x30);c=c*10+2;j++;if(j==11)tishi(); break;case0xe0:BUZZER=0;delay(80);BUZZER=1;write_date(3+0x30);c=c*10+3;j++;if(j==11)tishi(); break;}if(P3!=0xfe);delay(30);while(P3!=0xfe);}}P3=0xfd;if(P3!=0xfd){delay(40);if(P3!=0xfd){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(4+0x30);c=c*10+4;j++;if(j==11)tishi();brea k;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(5+0x30);c=c*10+5;j++;if(j==11)tishi();brea k;case0xd0:BUZZER=0;delay(80);BUZZER=1;write_date(6+0x30);c=c*10+6;j++;if(j==11)tishi();brea k;case0xe0:BUZZER=0;delay(80);BUZZER=1;write_date(7+0x30);c=c*10+7;j++;if(j==11)tishi();break ;}if(P3!=0xfd);delay(30);while(P3!=0xfd);}}P3=0xfb;if(P3!=0xfb){delay(40);if(P3!=0xfb){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;write_date(8+0x30);c=c*10+8;j++;if(j==11)tishi(); break;case0xb0:BUZZER=0;delay(80);BUZZER=1;write_date(9+0x30);c=c*10+9;j++;if(j==11)tishi(); break;case0xd0:BUZZER=0;delay(80);BUZZER=1;if(p==0){ write_com(0x97); write_date(0x2b);} break;case0xe0:BUZZER=0;delay(80);BUZZER=1;if(p==0){ write_com(0x97); write_date(0x2d);} break;}if(P3!=0xfb);delay(30);while(P3!=0xfb);}}P3=0xf7;if(P3!=0xf7){delay(40);if(P3!=0xf7){switch(P3&0xf0){case0x70:BUZZER=0;delay(80);BUZZER=1;if(p==0){ write_com(0x97); write_date(0x2a);} break;case0xb0:BUZZER=0;delay(80);BUZZER=1;if(p==0){ write_com(0x97); write_date(0x2f);} break;case 0xd0:BUZZER=0;delay(80);BUZZER=1;goto answer;break;case 0xe0:BUZZER=0;delay(80);BUZZER=1; clearscreen();goto start;break;}if(P3!=0xf7);delay(30);while(P3!=0xf7);}}}answer:write_com(0x98);write_date(0x3d);if(c==0&&opt==13) //错误处理{display(2,0,"分母不能为零");clearscreen();goto start;}switch(opt){case 10:rzt=(b+c);displayshu(4,2,rzt);break;case 11:rzt=(b-c);if(rzt<0){rzt=c-b;write_date(0x2d);} displayshu(4,2,rzt);break;case 12:rzt=(b*c);displayshu(4,2,rzt);break;case 13:rzt=(b/c);if((int)b%(int)c==0)displayshu(4,2,rzt);elserzt=rzt*1000;displayshu(4,2,rzt);break;}//错误处理与显示if(rzt>9999999999){clearscreen();display(2,1,"超出计算范围");delay(1000);goto start;}while(1){P3=0xf7;if(P3!=0xf7){delay(40);if(P3!=0xf7){if((P3&0xf0)==0xe0){goto start;}if(P3!=0xf7);delay(30);while(P3!=0xf7);}}}}。

51单片机 12864液晶显示并口和串口连接程序

51单片机  12864液晶显示并口和串口连接程序
sent(DATA&0XF0); //先写高位后写低位
sent((DATA&0X0F)<<4); //低位
}
void AUTO(uchar *add)
{
uchar cnt=0;
while(*(add+cnt)!='\0')
{
writLCD(1,*(add+cnt));
cnt++;
}
}
void wirtthings(uchar lines,uchar *add)//writ data to which line
else
RW=0;
delay(10);
SCK=1;
DATA=DATA<<1;
}
}
void writLCD(bit flag,uchar DATA) //writ COM or data in address
{
if(flag)
sent(0xfa);//1写数据
else
sent(0xf8);//0写指令
//writLCD(0,0x01);
wirtthings(4,"什么,only You!");
//writLCD(0,0x01);
wirtthings(1,"联系方式:");
//writLCD(0,0x01);
wirtthings(2,"QQ:452658536");
delay(100);
writLCD(0,0x01);
}
}
void delay(uchar i)
{
uchar j;
while(i--)

51单片机经典C程序(12864)

51单片机经典C程序(12864)

/*************************************** 控制器:KS0108* MCU:AT89C5* ,晶体频率:12MHz* 取模方式:纵向字节倒序* CS1和CS2为低电平有效**************************************/#include <reg52.h>#define uchar unsigned char#define uint unsigned int#define LCD_PORT P0#define Left 1#define Right 2sbit LCD_Busy=P0^7;sbit LCD_EN = P1^2;sbit LCD_RS = P1^0;sbit LCD_RW = P1^1;sbit LCD_RST= P1^7;sbit LCD_CS2= P3^6;sbit LCD_CS1= P3^5;uchar DisBuf[32],Page_Num,Clm_Num;code char Table0[]={/*-- 文字: A --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27 ,0x38,0x20,/*-- 文字: B --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11 ,0x0E,0x00,/*-- 文字: C --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10 ,0x08,0x00,/*-- 文字: D --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10 ,0x0F,0x00,/*-- 文字: E --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20 ,0x18,0x00,/*-- 文字: F --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00 ,0x00,0x00,/*-- 文字: G --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E ,0x02,0x00,};code unsigned char Table3[]={/*-- 文字: 天 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x40,0x42,0x42,0x42,0x42,0x42,0xFE,0x42,0x42,0x42,0x42,0x42,0x42 ,0x40,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x06,0x01,0x02,0x04,0x08,0x10,0x30,0x60 ,0x20,0x00,/*-- 文字: 仙 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0x60,0xF8,0x07,0x02,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00 ,0xE0,0x00,0x01,0x00,0x00,0x7F,0x00,0x20,0x7F,0x20,0x20,0x20,0x3F,0x20,0x20,0x20 ,0x7F,0x00,/*-- 文字: 妹 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x88,0x7F,0x0A,0x08,0xF8,0x80,0x88,0x88,0x88,0xFF,0x88,0x88,0x88 ,0x80,0x00,0x40,0x21,0x12,0x0C,0x3A,0x11,0x40,0x30,0x0C,0x03,0xFF,0x06,0x08,0x30 ,0x10,0x00,/*-- 文字: 妹 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x88,0x7F,0x0A,0x08,0xF8,0x80,0x88,0x88,0x88,0xFF,0x88,0x88,0x88 ,0x80,0x00,0x40,0x21,0x12,0x0C,0x3A,0x11,0x40,0x30,0x0C,0x03,0xFF,0x06,0x08,0x30 ,0x10,0x00};code unsigned char Table4[]={/*-- 文字: 我 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x20,0x22,0x22,0xFE,0x21,0x21,0x20,0x20,0xFF,0x20,0x22,0xAC,0x20 ,0x20,0x00,0x04,0x04,0x42,0x82,0x7F,0x01,0x01,0x10,0x10,0x08,0x07,0x1A,0x21,0x40 ,0xF0,0x00,/*-- 文字: 好 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0xF0,0x1F,0x10,0xF0,0x80,0x82,0x82,0x82,0xF2,0x8A,0x86,0x82 ,0x80,0x00,0x80,0x43,0x22,0x14,0x0C,0x73,0x20,0x00,0x40,0x80,0x7F,0x00,0x00,0x00 ,0x00,0x00,/*-- 文字: 想 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0xC8,0x38,0xFF,0x18,0x68,0x08,0x00,0xFE,0x2A,0x2A,0x2A,0x2A,0xFE ,0x00,0x00,0x01,0x40,0x70,0x01,0x38,0x40,0x40,0x44,0x59,0x41,0x41,0x61,0x01,0x09 ,0x30,0x00,/*-- 文字: 你 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x80,0x40,0xF0,0x2C,0x43,0x20,0x98,0x0F,0x0A,0xE8,0x08,0x88,0x28,0x1C ,0x08,0x00,0x00,0x00,0x7F,0x00,0x10,0x0C,0x03,0x21,0x40,0x3F,0x00,0x00,0x03,0x1C ,0x08,0x00};code unsigned char Table5[]={/*-- 调入了一幅图像:C:\Documents and Settings\sammy\桌面\小新.bmp --*//*-- 宽度x高度=64x64 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF0 ,0xF8,0x7C,0x3C,0x1E,0x1E,0x8F,0xCF,0xCF,0xCF,0xDF,0x9F,0x9F,0x1F,0x1F,0x3F,0x3E ,0x3E,0x3E,0x7C,0x7C,0x7C,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x08,0x08,0x1E,0x3F,0x7F,0x03 ,0x00,0x00,0x00,0x06,0x07,0x07,0x03,0x03,0x03,0x0F,0x3F,0x3F,0x7E,0x78,0x78,0x30 ,0x00,0x00,0x00,0x00,0x60,0xE0,0xF0,0x78,0x39,0x39,0x73,0xFE,0x60,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x03,0x04,0x08,0x11,0x08,0x04,0x83,0x80,0x0C,0x92,0xA2,0x44 ,0x22,0x12,0x00,0x00,0x00,0x00,0x00,0x0F,0x30,0x40,0x80,0x80,0x80,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x02,0x02,0x04,0x04,0x04,0x08,0x08,0x08,0x08,0x10,0x10,0x00 ,0x00,0x00,0x00,0x40,0x40,0x80,0x80,0x80,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00 ,0x00,0x60,0x90,0x10,0x20,0x10,0x90,0x60,0x00,0x03,0x04,0x08,0x11,0x08,0x04,0x03 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x10 ,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x06,0xF8,0x00,0x00 ,0x00,0x00,0x00,0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F ,0x7F,0xFF,0xF3,0xF3,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xE0,0xE0,0xE0 ,0xE0,0xE0,0xE4,0xE0,0xE0,0xE0,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x01,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xD8,0xD8,0xFC ,0xFC,0xFC,0xFD,0xFD,0xFF,0xF7,0xF7,0xF7,0xF7,0xFF,0xFF,0xFF,0xFF,0xF3,0xF7,0xF7 ,0xFF,0xFF,0xFF,0xFD,0xFD,0xFC,0xDC,0xD8,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0 ,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0 ,0xC0,0xC0,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,0x7F,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};code uchar Table8[]={/*-- 文字: 相 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0xD0,0xFF,0x30,0x50,0x90,0x00,0xFE,0x22,0x22,0x22,0x22,0xFE ,0x00,0x00,0x04,0x03,0x00,0xFF,0x00,0x00,0x01,0x00,0xFF,0x42,0x42,0x42,0x42,0xFF ,0x00,0x00,/*-- 文字: 约 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x40,0x60,0x58,0xC7,0x60,0x18,0x40,0x20,0x58,0x8F,0x08,0x08,0x08,0xF8 ,0x00,0x00,0x10,0x32,0x13,0x12,0x0A,0x0A,0x08,0x00,0x00,0x00,0x43,0x80,0x40,0x3F ,0x00,0x00,/*-- 文字: 丛 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x80,0x00,0x00,0x00 ,0x00,0x00,0x20,0x30,0x2C,0x23,0x20,0x21,0x36,0x2C,0x23,0x20,0x20,0x23,0x26,0x3C ,0x28,0x00,/*-- 文字: 林 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0x90,0xFF,0x90,0x10,0x00,0x10,0x10,0xD0,0xFF,0x90,0x10,0x10 ,0x10,0x00,0x08,0x06,0x01,0xFF,0x00,0x13,0x08,0x04,0x03,0x00,0xFF,0x01,0x06,0x18 ,0x08,0x00};code uchar Table9[]={/*-- 文字: 浪 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x30,0x01,0xC6,0x30,0x00,0xFC,0x94,0x95,0x96,0x94,0x94,0xFC,0x00 ,0x00,0x00,0x04,0x04,0xFE,0x01,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x34,0x62,0xC2 ,0x40,0x00,/*-- 文字: 漫 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x20,0x81,0x66,0x00,0xC0,0x5F,0xD5,0x55,0x55,0xD5,0x55,0x5F,0xC0 ,0x00,0x00,0x04,0xFC,0x03,0x00,0x00,0x81,0x85,0x4D,0x55,0x25,0x35,0x4D,0xC5,0x41 ,0x00,0x00,/*-- 文字: 野 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x7E,0x4A,0xFE,0x4A,0x4A,0x7E,0x00,0x42,0x52,0xD2,0x6A,0x46,0xC2 ,0x40,0x00,0x22,0x22,0x22,0x1F,0x12,0x12,0x12,0x00,0x40,0x80,0x7F,0x00,0x00,0x00 ,0x00,0x00,/*-- 文字: 岭 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0xF0,0x00,0xFF,0x00,0xF0,0x40,0x20,0x10,0x2C,0x43,0x04,0x08,0x70 ,0x20,0x00,0x08,0x1F,0x08,0x07,0x04,0x07,0x01,0x05,0x09,0x11,0x29,0x65,0x03,0x01 ,0x00,0x00};void Delay_us(unsigned int DelayTime){while(DelayTime) DelayTime--;}void Delay_x10ms(unsigned char DelayTime) //***************10ms延时**********//{unsigned char i,j,k;for(i=0;i<DelayTime;i++)for(j=0;j<10;j++)for(k=0;k<120;k++) {;}}/*----------------------------------------------------------------------------下面这个函数用于液晶模块的忙信号检测。

51单片机YM12864汉字图形点阵液晶显示模块

51单片机YM12864汉字图形点阵液晶显示模块

51单片机YM12864汉字图形点阵液晶显示模块&#173;本文以AT89C51单片机控制使用比较普遍的YM12864液晶显示器为基础,介绍了一种采用分页原理实现多级中文菜单操作的方法。

给出了YM12864主要技术参数、显示特性和核心的程序。

设计的中文菜单具有一定的通用性,只需更改其中的菜单项即可将此设计应用到家电、仪器仪表等设备上,为操作者提供友好方便的中文操作界面。

51单片机YM12864汉字图形点阵液晶显示模块-_典型应用电路图。

目前小型的显示器主要有LCD和LED,LED显示器只能显示数字和有限个英文字符,不能显示汉字,显示内容不直观,操作人员只能根据约定格式了解显示内容。

而LCD则可显示各种汉字和图形,尤其能实现中文菜单显示,为操作者提供方便友好的操作界面,并且功耗低,因此LCD得到广泛应用。

而现在市面上带中文字库的LCD比比皆是,价格适中,且大部分具有与MUC统一的标准接口,为使用LCD实现中文菜单操作提供了很大的方便。

相信更多的电子产品在提升性能的同时,设计更加人性化的中文菜单交互界面,将会使产品具有更广阔的前景。

二、YM12864液晶显示模块简介YM12864汉字图形点阵液晶显示模块,可显示汉字及图形,内置8192个中文汉字(16X16点阵)、128个字符(8X16点阵)及64X256点阵显示RAM(GDRAM)。

主要技术参数和显示特性:电源:VDD 3.3V~+5V(内置升压电路,无需负压)显示内容:128列×64行与MCU接口:8位或4位并行/3位串行多种软件功能:光标显示、画面移位、自定义字符、睡眠模式等。

其引脚功能为通用20脚LCD接口,用户指令集也为通用128*64LCD用户指令集,相关资料很容易获取。

因其内置中文字库,省去了自己造字库的工作量,而只需写入相应的汉字和字符内码即可显示所需要的汉字和字符,这在许多程序开发软件中很容易实现,如:WAVE、KEIL等。

中文图形12864点阵液晶显示模块与51单片机的并行接口电路及C51程序设计

中文图形12864点阵液晶显示模块与51单片机的并行接口电路及C51程序设计

中文图形12864点阵液晶显示模块与51单片机的并行接口
电路及C51程序设计
李志广;李晓泉;淮俊霞
【期刊名称】《现代显示》
【年(卷),期】2008(000)007
【摘要】讨论如何利用软件控制LM3033B-0BR3液晶显示模块时序,采用C51语言编程,驱动液晶模块实现并行传输方式的字符、汉字以及图形显示.具体阐述了LM3033B-0BR3液晶显示模块与单片机AT89S52的并行接口电路和软件编程方法.
【总页数】4页(P41-44)
【作者】李志广;李晓泉;淮俊霞
【作者单位】河北工业大学应用物理系,天津,300130;深圳市拓普微科技开发有限公司,深圳,518057;天津市轻工业设计院,天津,300193;河北工业大学应用物理系,天津,300130;深圳市拓普微科技开发有限公司,深圳,518057
【正文语种】中文
【中图分类】TN40
【相关文献】
1.基于C51的液晶显示模块接口电路与程序设计 [J], 周翔宁
2.C51语言与图形点阵液晶显示模块FM12864I的接口控制技术 [J], 高健
3.EDM12864B图形点阵式液晶显示模块的原理与应用 [J], 张兢
4.LCM12864ZK图形液晶显示模块并行实用技术 [J], 胡建波
5.图形点阵液晶显示模块FM12864J与单片机的接口技术 [J], 向守兵;何巍;罗光伟
因版权原因,仅展示原文概要,查看原文内容请购买。

51单片机综合学习系统之12864点阵型液晶显示篇

51单片机综合学习系统之12864点阵型液晶显示篇

51单片机综合学习系统之 12864点阵型液晶显示篇大家好,通过以前的学习,我们已经对51单片机综合学习系统的使用方法及学习方式有所了解与熟悉,学会了1602字符型液晶显示的基本知识,体会到了综合学习系统的易用性与易学性,这一期我们将一起学习12864点阵型液晶显示屏的基本原理与使用方法。

点阵LCD的显示原理在数字电路中,所有的数据都是以0和1保存的,对LCD控制器进行不同的数据操作,可以得到不同的结果。

对于显示英文操作,因为英文字母种类很少,只需要8位<一字节)即可。

而对于中文,常用却有6000以上,于是我们的DOS前辈想了一个办法,就是将ASCII表的高128个很少用到的数值以两个为一组来表示汉字,即汉字的内码。

而剩下的低128位则留给英文字符使用,即英文的内码。

那么,得到了汉字的内码后,还仅是一组数字,那又如何在屏幕上去显示呢?这就涉及到文字的字模,字模虽然也是一组数字,但它的意义却与数字的意义有了根本的变化,它是用数字的各位信息来记载英文或汉字的形状,如英文的'A'在字模的记载方式如图1所示:图1 “A”字模图而中文的“你”在字模中的记载却如图2所示:图2 “你”字模图12864点阵型LCD简介12864是一种图形点阵液晶显示器,它主要由行驱动器/列驱动器及128×64全点阵液晶显示器组成。

可完成图形显示,也可以显示8×4个(16×16点阵>汉字。

管脚号管脚名称LEVER 管脚功能描述1 VSS 0 电源地2 VDD +5.0V 电源电压3 V0 - 液晶显示器驱动电压4 D/I(RS> H/L D/I=“H”,表示DB7∽DB0为显示数据D/I=“L”,表示DB7∽DB0为显示指令数据5 R/W H/L R/W=“H”,E=“H”数据被读到DB7∽DB0R/W=“L”,E=“H→L”数据被写到IR或DR6 E H/L R/W=“L”,E信号下降沿锁存DB7∽DB0R/W=“H”,E=“H”DDRAM数据读到DB7∽DB07 DB0 H/L 数据线8 DB1 H/L 数据线9 DB2 H/L 数据线10 DB3 H/L 数据线11 DB4 H/L 数据线12 DB5 H/L 数据线13 DB6 H/L 数据线14 DB7 H/L 数据线15 CS1 H/L H:选择芯片(右半屏>信号16 CS2 H/L H:选择芯片(左半屏>信号17 RET H/L 复位信号,低电平复位18 VOUT -10V LCD驱动负电压19 LED+ - LED背光板电源20 LED- - LED背光板电源表1:12864LCD的引脚说明在使用12864LCD前先必须了解以下功能器件才能进行编程。

SMG12864L标准图形点阵型液晶显示模块的演示程序

SMG12864L标准图形点阵型液晶显示模块的演示程序
void putimage(unsigned char code *s); //显示图形子程序
void putsizeimage(unsigned char XSIZE,unsigned char YSIZE,unsigned char code *s);
//显示指定大小的图形子程序
0x00,0x20,0x08,0x20,0xf8,0x1f,0x00,0x00
};
unsigned char code ChineseCharDot[]={
0x00,0x00,0x00,0x00,0xf8,0x0f,0x48,0x04, //字符001:[电]
0x48,0x04,0x48,0x04,0x48,0x04,0xff,0x3f,
//液晶显示模块的基本子程序,12864系列绘图子程序集,12864系列图形子程序集,12864系列
//精简中英文字库子程序集,以及SMG12864L系列标准图形点阵型液晶显示的演示子程序.
// 本演示的内容为,在128列X64行的点阵液晶显示屏上清屏,图片演示,英文字符串演示,
//中文字符串演示,反白显示字符串,绘制矩形,写点,绘制直线,液晶电压调整,全屏显示.
unsigned int code EnglishCode[]={
0x41, //字符001:[A]
0x4d, //字符002:[M]
0x4e, //字符003:[N]
0x53, //字符004:[S]
0x55 //字符005:[U]
};
unsigned int code ChineseCode[]={
//文件来替换该部分
#define ENGLISHCHARNUMBER 5 //精简版英文字符库中的英文字符的个数

12864图形液晶显示模块与51系列单片机接口技术

12864图形液晶显示模块与51系列单片机接口技术

单片机与可编程器件液晶显示模块以其微功耗、体积小、显示内容丰富、模块化、接口电路简单等诸多优点得到广泛应用。

液晶显示模块分字符型和点阵型两种,前者只能显示常用的字符,点阵型液晶显示模块除显示字符外还能显示各种图形和汉字。

目前,尽管液晶显示模块种类繁多,但其结构及控制方法是一样的,本文以常用的128×64液晶显示模块为例介绍液晶显示模块的工作原理及其与51系列单片机的接口技术。

12864图形液晶显示模块12864液晶显示模块表示横向有128点,纵向有64点,可显示16×16中文字4行,每行8个字,外形和引脚排列如图1所示。

1. 引脚功能 引脚功能如表1所示。

2. 显示DDRAM与X地址、Y地址排列方式 DDRAM是模块自带的存储单元,用来存放图形信息或数据,DDRAM存储单元与液晶显示屏之间存在一一对应关系,数据为1表示显示选择,对应屏幕亮;数据为0表示显示非选择,对应屏幕不亮。

DDRAM与X、Y地址和显示位置的关系如表2所示。

3.12864液晶显示模块指令12864液晶显示模块基本操作指令如表3所示。

(1)读取状态字 当R/W=1,D/I=0时,在E信号为高的作用下,状态字分别输出到数据总线上。

状态字是了解模块当前工作状态的唯一的信息渠道,在每次对模块操作之前,都要读出状态字判断BUSY是否为“0”。

若不为“0”,则计算机需要等待,直至BUSY =0为止。

(2)显示开关设置 D=1开显示,D=0关显示。

(3)显示起始行设置 指令表中DB5~DB0为显示起始行的地址,取值在0~3FH(1~64行)范围内,它规定了显示屏上最顶一行所对应的显示存储器的行地址。

(4 ) 页面地址设置 页面地址是DDRAM的行地址。

8行为一页,DDRAM共64行即8页,DB2 ̄DB0表示0 ̄7页。

(5)列地址设置 列地址是DDRAM的列地址。

共64列,12864图形液晶显示模块与51系列单片机接口技术・湖南邵阳学院电气信息工程学院 江世明・摘要 文章以128×64液晶显示模块为例,系统地介绍了12864图形液晶显示模块的结构特征、指令系统、工作时序及与51系列单片机接口技术、编程方法。

51单片机实现的多图显示用12864液晶驱动程序设计

51单片机实现的多图显示用12864液晶驱动程序设计

51单片机实现的多图显示用12864液晶驱动程序设计作者:佚名日期:2010年06月02日来源:不详【字体:大中小】我要评论(0)核心提示:/************************************************程序名称:12864液晶驱动程序(显示多图)简要说明:控制器:KS0107 LCD型号:FM12864、TS12864A-2或兼容型号(不带字库)&nbs/************************************************程序名称:12864液晶驱动程序(显示多图)简要说明:控制器:KS0107LCD型号:FM12864、TS12864A-2或兼容型号(不带字库)MCU:AT89S5*,晶体频率:11.0592MHz取模方式:纵向取模、字节倒序CS1和CS2为高电平有效************************************************/;***************硬件端口定义***********RS EQU P2.0RW EQU P2.1E EQU P2.2CS1 EQU P2.3CS2 EQU P2.4RST EQU P2.5COM EQU 20H ;指令数据寄存器DAT EQU 21H ;显示数据寄存器;**********************************主程序入口地址ORG 0000HAJMP STRORG 0003H;*********************************中断程序入口地址STR:AJMP L0100L0100: CLR RSTNOPNOPSETB RST;********************************以上是软件复位MOV SP,#60HMOV IE,#81H ;中断允许MOV IP,#01H ;优先中断MOV TCON,#00H ;电平中断MOV COM,#3FH ;显示开LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#0C0H ;第一行LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#0B8H ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;********************************************************以上是软件初始化MOV B,#0AAHLCALL XIHX ;显示横线1LCALL DELAY; MOV B,#55H; LCALL XIHX; LCALL DELAY ;显示横线2MOV B,#0FFHMOV 29H,#00HLCALL XISXLCALL DELAY ;显示竖线1; MOV B,#00H; MOV 29H,#0FFH; LCALL XISX; LCALL DELAY ;显示竖线2MOV DPTR,#TAB1LCALL LEFTMOV DPTR,#TAB2LCALL RIGHTLCALL DELAY ;显示第一幅图片MOV DPTR,#TAB3LCALL LEFTMOV DPTR,#TAB4LCALL RIGHTLCALL DELAY ;显示第二幅图片MOV DPTR,#TAB5LCALL LEFTMOV DPTR,#TAB6LCALL RIGHTLCALL DELAY ;显示第三幅图片AJMP L0100;=======================================================以上是主程序LEFT: MOV R1,#0B8H_AB: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序MOV R0, #64S027B: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B1 ;左半屏写数据子程序INC DPTRDJNZ R0,S027BINC R1CJNE R1, #0C0H,_ABRET;======================================================以上是左半屏写数据子程序RIGHT: MOV R1,#0B8HABC: MOV COM,R1 ;第一页LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02C1 ;右半屏写指令子程序MOV R0, #64S027D: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B9 ;右半屏写数据子程序INC DPTRDJNZ R0,S027DINC R1CJNE R1, #0C0H,ABCRET;*******************************************************以上是右半屏写数据子程序XIHX: MOV R1,#0B8HBA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #64W027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,W027BINC R1CJNE R1, #0C0H,BARET;---------------------------------------------------------XISX: MOV R1,#0B8HCA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #32X027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序MOV DAT,29HLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,X027BINC R1CJNE R1, #0C0H,CARET;****************************************************以上是显示线条程序S02A9: SETB CS1LCALL S02C9CLR CS1 ;左半屏写指令子程序RETS02B1: SETB CS1 ;左半屏写数据子程序LCALL S02E0CLR CS1RETS02C1: SETB CS2 ;右半屏写指令子程序LCALL S02C9CLR CS2RETS02B9: SETB CS2 ;右半屏写数据子程序LCALL S02E0CLR CS2RET;****************************************************S02C9: CLR RSSETB RWS02C9A: MOV P0,#0FFHSETB EMOV A, P0CLR EJB ACC.7,S02C9ACLR RWMOV P0,COMSETB ENOPCLR ERET;*************************************************以上是写指令子程序S02E0: CLR RSSETB RWS02E0A: MOV P0,#0FFHSETB EMOV A, P0CLR EJB ACC.7,S02E0ASETB RSCLR RWMOV P0,DATSETB ENOPCLR ERET;************************************************以上是写数据子程序DELAY: MOV R5,#0BH ;延时D1: MOV R7,#0FFHD2: MOV R6,#0FFHD3: DJNZ R6,$DJNZ R7,D2DJNZ R5,D1RET;****************************************************************TAB1:;-- 调入了一幅图像:C\128x64-1.bmp --;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,0C0H,0C0 HDB0E0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F 8HDB0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,07CH,078H,078H,038H,038H ,030HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,0E0H,0F0H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0F FHDB0FFH,0FFH,0FFH,0FFH,0EFH,0CFH,0E7H,0E7H,0E7H,0F3H,073H,033H,03BH,019H,00DH,0 8DHDB0CDH,0E7H,0F6H,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,03EH,01CH, 000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,0E0H,0E0H,0F0H,0F0H,0F0H,0F8H,0F9H,0FDH,0FDH,0FDH,0DFH,09FH,08EH,08FH,0 8FHDB08FH,00FH,00FH,00FH,00FH,00FH,007H,003H,001H,060H,060H,06CH,06CH,06EH,06FH,06 7HDB067H,0E7H,0F7H,0F7H,0F3H,0F3H,0F3H,0F3H,0F9H,0F9H,0F8H,0F8H,0FCH,0FCH,0FEH,0 FEHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,01FH,00FH,007H,003H,003H,00 1HDB081H,0E0H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0FEH,0FEH, 0FEHDB0FEH,0FCH,0FCH,0FCH,0F8H,0F0H,061H,001H,001H,003H,003H,007H,0DFH,0FFH,0FFH,0 FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0E0H,0C0H,0C0H,080H,000H,000H,00 0HDB003H,007H,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00 7HDB087H,087H,0C3H,0C3H,0C1H,0E0H,0F0H,0F0H,0F8H,0FCH,0FCH,0FFH,0FFH,0FFH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,0F FHDB0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH ,0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,0 0FHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,003H,00FH,07FH,0FFH,0FFH,0FF HDB0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,00FH,00FH,00FH,007H,007H,003H,00 3HDB003H,001H,001H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB2:;-- 调入了一幅图像:C:\128x64-2.bmp --;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,080H,0C0 HDB0C0H,0C0H,0E0H,0E0H,0E0H,0F0H,0F0H,0F8H,0F8H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH, 0FFHDB0FFH,0FFH,0FFH,0FEH,0F8H,0C0H,000H,000H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB030H,038H,078H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,0C0H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,080H,0C0H,0F1H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,000H,000H,000H,0 00HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,001H,001H,001H,00 1HDB0E1H,0FDH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,01FH,007H,001H,001H,001H,0C1H,0 C1HDB001H,001H,001H,007H,01FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,000H,000H,000H,000H,0E0H,0F8H,0F FHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,000H,000H,000H,000H,038H,03EH,03FH,0B FHDB0BFH,0F8H,0C0H,0C0H,0E0H,0E0H,0E7H,0FFH,0FFH,09FH,01FH,00FH,00FH,007H,007H,0 00HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0EFH,0E1H,0E0H,0E0H,0E0H,0E0H,0E0H,0F8H,07FH,07FH,07FH,0 3FHDB03FH,03FH,07FH,07FH,07FH,078H,07CH,07CH,07CH,07EH,00EH,007H,003H,003H,003H,00 3HDB003H,003H,003H,00FH,03FH,07FH,07FH,07FH,07FH,07FH,07CH,070H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB00FH,00FH,007H,007H,003H,003H,003H,001H,001H,001H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB3:;-- 调入趣味性文字和图片像右半屏:纵向取模下高位,数据排列:从左到右从上;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,0E0H,0C0H,080H,0C0H,0F8H,0F0H,0B 0HDB060H,068H,0D0H,0F0H,0F0H,020H,020H,060H,0C0H,0C0H,0C0H,0C0H,080H,080H,080H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,0C0H,0F0H,0FCH,0EFH,0F3H,0F9H,0FCH,0F1H,07BH,07DH,0 3FHDB03EH,038H,03EH,03CH,03DH,038H,03FH,03FH,03EH,03EH,03FH,03FH,03FH,03FH,07FH,0 7FHDB0FFH,0FEH,0FEH,0FCH,0F8H,0F0H,0E0H,080H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,0E0H,0FEH,0FFH,0FFH,0FFH,07FH,007H,001H,000H,000H,008H,008H,00 8HDB010H,010H,020H,040H,000H,000H,000H,000H,000H,040H,020H,010H,010H,008H,008H,008 HDB000H,000H,001H,007H,03FH,0FFH,0FFH,0FFH,0FEH,0E0H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,080H,09FH,0FFH,0FFH,063H,061H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0D0H,08 0HDB010H,010H,020H,020H,0C0H,060H,060H,060H,0C0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0D 0HDB010H,010H,010H,020H,0E0H,060H,061H,0FFH,0FFH,09FH,080H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB006H,009H,010H,010H,020H,039H,060H,080H,001H,003H,007H,007H,007H,007H,007H,007 HDB007H,004H,004H,022H,041H,040H,040H,040H,041H,023H,007H,007H,007H,007H,007H,007 HDB007H,004H,004H,002H,001H,080H,060H,039H,020H,010H,010H,019H,0E6H,000H,004H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,080H,0C0H,0C0H,0E1H,0E2H,0E2H,0F4H,0F4H,0F4H,0F8H,0F 8HDB0F8H,0F0H,0F0H,0F0H,090H,090H,090H,090H,090H,070H,0F0H,0F0H,0E8H,0E8H,0E8H,0C 4HDB0C4H,084H,082H,002H,0FBH,0F4H,0E4H,0F4H,0FCH,004H,002H,001H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,007H,00FH,01FH,03FH,03FH,07FH,07FH,0FFH,021H,001H,003H,007 HDB00FH,09FH,0FFH,0FFH,0FFH,0FEH,0F9H,0F7H,0FEH,0F8H,0FFH,0FFH,0FFH,0FFH,0FFH,0 E7HDB00FH,00FH,01FH,01FH,03FH,03FH,03FH,03FH,01FH,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,002H,004H,004H,004 HDB002H,001H,00FH,03FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,0FCH,0F0H,060H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB4:;-- 调入了一幅图像:帅呆了吧DB000H,000H,0E0H,000H,0F8H,000H,0E0H,020H,0F8H,020H,020H,0E0H,000H,000H,000H,078 HDB048H,048H,0C8H,048H,048H,078H,000H,000H,000H,000H,008H,008H,008H,008H,0C8H,048 HDB028H,018H,008H,000H,000H,0F0H,010H,0F0H,000H,0F0H,010H,010H,0F0H,010H,0F8H,010 HDB000H,000H,000H,000H,000H,000H,000H,000H,0E0H,0F0H,0F0H,0E0H,000H,000H,000H,000 HDB000H,020H,017H,008H,007H,000H,00FH,000H,03FH,000H,008H,00FH,000H,021H,011H,009 HDB005H,003H,03FH,003H,005H,009H,011H,011H,000H,000H,000H,000H,020H,020H,03FH,000 HDB000H,000H,000H,000H,000H,007H,004H,007H,000H,01FH,021H,021H,021H,021H,021H,038 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,01BH,01BH,000H,000H,000H,000H,000 HDB000H,0F4H,05CH,034H,05CH,0F4H,000H,05CH,048H,07EH,048H,048H,000H,040H,05EH,0D 4HDB054H,054H,040H,0DEH,054H,054H,052H,058H,000H,000H,002H,002H,002H,002H,0F2H,012DB00AH,006H,002H,000H,000H,0FCH,084H,084H,0FCH,000H,03AH,022H,0A2H,0FEH,022H,02 2HDB000H,000H,000H,000H,000H,000H,000H,000H,038H,0FCH,0FCH,038H,000H,000H,000H,000 HDB000H,00FH,005H,005H,005H,00FH,000H,00FH,009H,009H,009H,00FH,000H,00AH,009H,00B HDB005H,003H,000H,00FH,00AH,009H,009H,00EH,000H,000H,000H,000H,008H,008H,00FH,000 HDB000H,000H,000H,000H,000H,001H,000H,008H,009H,004H,002H,009H,008H,00FH,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,006H,006H,000H,000H,000H,000H,000 HDB000H,018H,0FFH,008H,050H,044H,044H,0FFH,044H,044H,07CH,040H,000H,020H,022H,02 AHDB0B2H,062H,0FFH,062H,0B2H,02AH,022H,020H,000H,004H,004H,0FFH,004H,004H,0FCH,00 0HDB0FCH,004H,004H,0FCH,000H,000H,000H,000H,0C1H,031H,00EH,030H,0C0H,000H,000H,00 0HDB000H,000H,000H,07CH,055H,056H,0FCH,056H,055H,054H,07CH,000H,000H,000H,000H,00 0HDB000H,000H,007H,0C4H,004H,002H,001H,0C0H,001H,002H,004H,004H,000H,002H,002H,0C 1HDB000H,000H,087H,080H,080H,0C1H,082H,002H,000H,004H,003H,080H,044H,004H,003H,000 HDB0C7H,002H,002H,007H,000H,004H,082H,001H,000H,0C0H,000H,000H,000H,0C1H,002H,00 4HDB000H,001H,001H,0C1H,041H,041H,0C7H,041H,041H,041H,0C1H,001H,000H,000H,000H,00DB000H,000H,080H,07FH,012H,012H,012H,013H,0F2H,002H,002H,002H,000H,061H,019H,0FF HDB009H,091H,07FH,000H,000H,0FFH,000H,0C0H,000H,0FFH,091H,091H,091H,0FFH,004H,00 BHDB031H,001H,001H,0FFH,000H,002H,0FFH,002H,002H,07FH,022H,022H,022H,07FH,002H,002 HDB000H,020H,020H,017H,08DH,075H,007H,005H,0FDH,015H,027H,020H,000H,000H,000H,000 HDB000H,001H,000H,000H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,001 HDB001H,000H,000H,000H,000H,001H,001H,001H,000H,001H,000H,000H,000H,001H,000H,000 HDB001H,001H,001H,000H,000H,000H,001H,001H,001H,001H,001H,001H,001H,001H,001H,001 HDB000H,000H,001H,001H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,000 HTAB5:;-- 调入图像:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,0C0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F 0HDB0F0H,0F0H,0F8H,0BCH,01CH,08CH,0CEH,0CFH,0CFH,0EBH,0C9H,0D0H,090H,010H,010H, 010HDB020H,021H,061H,041H,043H,0C2H,08CH,000H,001H,001H,002H,006H,00CH,00FH,010H,03 EHDB023H,046H,085H,089H,019H,033H,066H,08DH,0DBH,0F9H,0A6H,02FH,03FH,007H,08FH,0C FHDB000H,000H,000H,080H,0E0H,0F0H,0F0H,0F0H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,07FH,0FFH,0EFH,0FFH,0FFH,0FFH,0FFH,07FH,06FH,037H,01BH,00FH,007H,001H,0 0FHDB009H,00AH,00EH,006H,006H,004H,004H,00CH,008H,018H,010H,020H,060H,040H,0C0H,08 0HDB000H,000H,000H,001H,0C3H,007H,00DH,037H,022H,0C2H,083H,001H,00FH,037H,01FH,03 7HDB000H,000H,000H,0FFH,0FFH,0FFH,0FFH,01FH,006H,0C6H,0E6H,066H,07EH,0FFH,0EFH,0 D1HDB0D9H,0E9H,0E9H,0F9H,0F2H,0E6H,01CH,030H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001 HDB003H,0C6H,078H,0B0H,0E0H,083H,00EH,018H,0E0H,080H,003H,00EH,038H,0C0H,018H,0F 0HDB000H,000H,000H,000H,007H,00FH,01FH,01FH,01CH,0FFH,07FH,060H,038H,027H,079H,0C 1HDB0F3H,0F3H,0FFH,0FFH,078H,03FH,002H,000H,000H,000H,000H,000H,000H,000H,002H,071 HDB039H,019H,0F9H,0F9H,0F9H,0FBH,0FBH,073H,073H,0E6H,0CEH,09CH,038H,030H,000H,0 00HDB000H,01FH,0E0H,0FFH,0FFH,0FFH,0FCH,0F8H,0E0H,087H,0F8H,000H,000H,007H,0FEH,0 F1HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,07FH,0C0H,000H,000H,000H,000H,000 HDB080H,000H,000H,010H,010H,000H,020H,020H,020H,000H,000H,000H,000H,000H,01CH,03E HDB070H,07CH,07CH,078H,0FFH,0FFH,07FH,07EH,03EH,01FH,003H,003H,002H,000H,000H,00 0HDB000H,000H,000H,0FBH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,000H,000H,000H,0FFH,0 F3HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,003H,018H,0E0H,000H,000H,000 HDB003H,006H,00EH,00EH,00EH,018H,018H,018H,008H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080 HDB0C0H,0C6H,0EFH,0A7H,073H,07BH,009H,084H,0CCH,0E3H,0FFH,0F8H,0FCH,0FEH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,002H,006 HDB000H,00CH,008H,008H,000H,010H,010H,010H,010H,010H,018H,018H,008H,084H,084H,004 HDB006H,0F2H,0B2H,016H,034H,0E4H,004H,004H,004H,00CH,0CCH,08CH,01CH,018H,03FH,0 3FHDB07CH,0DEH,0DFH,0DFH,0EEH,0F7H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,004H,004H,00EH,036H,064H,07CH,018H,001H,003 HDB00EH,000H,001H,001H,003H,001H,000H,000H,000H,000H,003H,003H,003H,001H,000H,000 HDB000H,000H,001H,007H,00FH,03FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHTAB6:;-- 调入图像:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64;-- 调入了一幅图像:我们年轻.bmp --;-- 宽度x高度=64x64 --DB000h,000h,000h,000h,000h,000h,000h,000h,080h,080h,000h,0C0h,000h,080h,000h,000h DB000h,000h,000h,000h,000h,0C0h,000h,040h,080h,000h,080h,080h,080h,000h,000h,000h DB000h,000h,0C0h,000h,000h,000h,000h,000h,000h,000h,080h,000h,000h,000h,000h,000h DB0C0h,000h,000h,000h,080h,080h,080h,080h,080h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,044h,044h,045h,025h,0FFh,014h,014h,084h,07Fh,0C4h,024h,015h,084h DB000h,000h,008h,004h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,0FFh,000h,000h,000h DB044h,042h,079h,049h,049h,049h,0FFh,049h,049h,049h,049h,041h,000h,000h,089h,08Fh DB049h,0FDh,029h,001h,028h,024h,0E2h,023h,024h,008h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,080h,080h,088h,0B2h,003h,020h,0A1h,028h,030h,020h,0E1h,022h,023h DB000h,000h,080h,040h,03Bh,020h,023h,020h,0E0h,020h,020h,022h,033h,020h,000h,000h DB020h,0E0h,038h,0A0h,020h,020h,013h,090h,050h,070h,090h,000h,000h,000h,020h,0A0h DB0A8h,0B3h,0A0h,0A2h,082h,0FAh,083h,092h,0A2h,082h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,040h,020h,01Fh,020h,050h,048h,045h,042h,045h,048h,050h,040h DB000h,000h,008h,008h,00Fh,009h,009h,009h,07Fh,009h,009h,009h,009h,008h,000h,000h DB011h,011h,009h,07Fh,005h,040h,045h,044h,07Ch,044h,044h,041h,000h,000h,020h,01Bh DB042h,07Eh,00Ah,053h,020h,01Fh,000h,07Fh,040h,070h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,040h,040h,040h,05Fh,055h,055h,0D5h,055h,05Fh,040h,040h,040h DB000h,000h,010h,011h,0F6h,000h,000h,0FCh,056h,055h,054h,05Eh,0C4h,000h,000h,000h DB010h,0D4h,014h,0FFh,094h,094h,022h,022h,0FEh,022h,022h,020h,000h,000h,008h,008hDB008h,008h,0C8h,03Fh,048h,088h,008h,008h,00Ch,008h,000h,000h,000h,000h,000h,000hDB000h,000h,000h,000h,000h,0C8h,044h,043h,0C4h,008h,0CFh,049h,049h,049h,0E9h,048h DB000h,000h,008h,084h,0C3h,0A4h,088h,00Bh,00Ah,0EAh,08Ah,08Ah,08Bh,008h,000h,000h DB08Ch,003h,004h,0E7h,008h,008h,008h,0E8h,00Bh,008h,008h,008h,000h,000h,048h,044hDB042h,041h,040h,041h,046h,040h,041h,042h,06Ch,044h,000h,000h,000h,000h,000h,000hDB000h,000h,000h,000h,000h,0FFh,022h,025h,018h,000h,0FFh,044h,044h,044h,0FFh,000hDB000h,000h,000h,0FFh,088h,088h,0FFh,002h,005h,018h,080h,000h,0FFh,000h,000h,000hDB020h,013h,008h,0FFh,002h,002h,002h,0FFh,002h,002h,002h,002h,000h,000h,000h,0FFhDB009h,011h,0FFh,000h,000h,0FFh,009h,011h,0FFh,000h,000h,000h,000h,000h,000h,000hDB 000h,000h,000h,000h,000h,001h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB 000h,000h,000h,001h,000h,000h,001h,000h,000h,000h,000h,001h,000h,000h,000h,000h DB 000h,000h,000h,001h,000h,001h,001h,001h,001h,001h,001h,000h,000h,000h,000h,001h DB 000h,001h,001h,000h,000h,001h,000h,001h,001h,000h,000h,000h,000h,000h,000h,000h END上传两个显示画面液晶屏是朋友托卖的,无背光无字库,带负压产生电路,有些成色比较新,先到先得了,45RMB一块,送资料,驱动程序,QQ以下是程序//**************************************;* 控制器:KS0107 *;* LCD型号:TS12864A-2或兼容型号 *;* MCU:AT89S5* ,晶体频率:11.0592MHz *;* 取模方式:纵向字节倒序 *;* CS1和CS2为高电平有效 * *;***************硬件端口定义***********RS EQU P2.4RW EQU P2.3E EQU P2.2CS1 EQU P2.7CS2 EQU P2.6RST EQU P2.5BUF EQU P0;******************************************COM EQU 20H ;指令数据寄存器DAT EQU 21H ;显示数据寄存器;**********************************主程序入口地址ORG 0000HAJMP STRORG 0003H;*********************************中断程序入口地址STR:AJMP L0100L0100: CLR RSTNOPNOPSETB RST;********************************以上是软件复位MOV SP,#60HMOV IE,#81H ;中断允许MOV IP,#01H ;优先中断MOV TCON,#00H ;电平中断MOV COM,#3FH ;显示开LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#0C0H ;第一行LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#0B8H ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;********************************************************以上是软件初始化MOV B,#0AAHLCALL XIHX ;显示横线1LCALL DELAYMOV B,#55HLCALL XIHXLCALL DELAY ;显示横线2MOV B,#0FFHMOV 29H,#00HLCALL XISXLCALL DELAY ;显示竖线1MOV B,#00HMOV 29H,#0FFHLCALL XISXLCALL DELAY ;显示竖线2MOV DPTR,#TAB1LCALL LEFTMOV DPTR,#TAB2LCALL RIGHTLCALL DELAY ;显示第一幅图片MOV DPTR,#TAB3LCALL LEFTMOV DPTR,#TAB4LCALL RIGHTLCALL DELAY ;显示第二幅图片MOV DPTR,#TAB5LCALL LEFTMOV DPTR,#TAB6LCALL RIGHTLCALL DELAY ;显示第三幅图片AJMP L0100;=======================================================以上是主程序LEFT: MOV R1,#0B8H_AB: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序MOV R0, #64S027B: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B1 ;左半屏写数据子程序INC DPTRDJNZ R0,S027BINC R1CJNE R1, #0C0H,_ABRET;======================================================以上是左半屏写数据子程序RIGHT: MOV R1,#0B8HABC: MOV COM,R1 ;第一页LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02C1 ;右半屏写指令子程序MOV R0, #64S027D: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B9 ;右半屏写数据子程序INC DPTRDJNZ R0,S027DINC R1CJNE R1, #0C0H,ABCRET;*******************************************************以上是右半屏写数据子程序XIHX: MOV R1,#0B8HBA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #64W027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,W027BINC R1CJNE R1, #0C0H,BARET;--------------------------------------------------------- XISX: MOV R1,#0B8HCA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #32X027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序MOV DAT,29HLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,X027BINC R1CJNE R1, #0C0H,CARET;****************************************************以上是显示线条程序S02A9: SETB CS1LCALL S02C9CLR CS1 ;左半屏写指令子程序RETS02B1: SETB CS1 ;左半屏写数据子程序LCALL S02E0CLR CS1RETS02C1: SETB CS2 ;右半屏写指令子程序LCALL S02C9CLR CS2RETS02B9: SETB CS2 ;右半屏写数据子程序LCALL S02E0CLR CS2RET;****************************************************S02C9: CLR RSSETB RWS02C9A: MOV BUF,#0FFHSETB EMOV A, BUFCLR EJB ACC.7,S02C9ACLR RWMOV BUF,COMSETB ENOPCLR ERET;*************************************************以上是写指令子程序S02E0: CLR RSSETB RWS02E0A: MOV BUF,#0FFHSETB EMOV A, BUFCLR EJB ACC.7,S02E0ASETB RSCLR RWMOV BUF,DATSETB ENOPCLR ERET;************************************************以上是写数据子程序DELAY: MOV R5,#0BH ;延时D1: MOV R7,#0FFHD2: MOV R6,#0FFHD3: DJNZ R6,$DJNZ R7,D2DJNZ R5,D1RET;****************************************************************TAB1:;-- 调入菲戈幅图像左半屏:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64DB000h,000h,000h,040h,080h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,010h DB060h,080h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FCh,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,0C0h,030h,008h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,080h,040h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,001h,002h,004h,008h,010h,020h,040h,080h,000h,000h,000h DB000h,001h,006h,018h,060h,080h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h DB000h,000h,000h,000h,000h,0C0h,030h,00Ch,003h,000h,000h,000h,000h,080h,040h,020h DB010h,008h,004h,002h,001h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB002h,002h,004h,004h,008h,008h,010h,010h,020h,020h,040h,040h,080h,081h,002h,004h DB008h,010h,020h,040h,080h,001h,006h,018h,020h,000h,000h,000h,080h,09Fh,080h,000h DB000h,040h,030h,00Ch,003h,080h,040h,020h,010h,008h,004h,002h,001h,000h,000h,080h DB080h,040h,040h,020h,020h,010h,010h,010h,008h,008h,004h,004h,002h,002h,000h,000h000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,001h,001h DB002h,002h,004h,004h,008h,009h,000h,030h,0CCh,002h,001h,001h,000h,000h,000h,001h DB001h,002h,0CCh,030h,001h,000h,008h,008h,004h,004h,002h,002h,001h,001h,001h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,004h,018h DB060h,080h,000h,000h,000h,000h,000h,000h,000h,001h,002h,002h,084h,0FCh,044h,042h DB022h,021h,020h,020h,010h,010h,010h,060h,080h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,003h,004h,004h,002h,002h,002h,001h,001h,001h,001h,000h,0FFh,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,001h,006h,008h,010h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,080h,080h,040h,040h,020h,020h,010h,010h,008h,008h,004h,00Fh,010h,020h。

51单片机带字库12864液晶动态汉字显示C语言源程序

51单片机带字库12864液晶动态汉字显示C语言源程序

51单片机带字库12864液晶动态汉字显示C语言源程序2009-10-17 19:36实验芯片为:AT89S52,带字库液晶屏:12864,实现的目的:动态一个汉字一个汉字显示。

其实和显示汉字的程序一样,只是稍做一下修改即可。

C语言源程序如下:#include <stdio.h>#include <math.h>#include <reg52.h>#include <string.h>sbit RS=P2^4;sbit WRD=P2^5;sbit E=P2^6;sbit PSB=P2^1;sbit RES=P2^3;void TransferData(char data1,bit DI);void delayms(unsigned int n);void delay(unsigned int m);void lcd_mesg003(unsigned char code *addr1);unsigned char code IC_DAT[]={"我是一个中国人啊"};void initinal(void){delay(40);PSB=1; //并口工作模式delay(1);RES=0; //复位delay(1);RES=1; //复位置高delay(10);TransferData(0x30,0);delay(100);TransferData(0x30,0);delay(37);TransferData(0x08,0);delay(100);TransferData(0x10,0);delay(100);TransferData(0x0C,0);delay(100);TransferData(0x01,0);delay(10);TransferData(0x06,0);delay(100);}void main(void){while(1){initinal();//调用LCD字库初始化程序delay(100);lcd_mesg003(IC_DAT);}}void lcd_mesg003(unsigned char code *addr1){unsigned char i;//第一行TransferData(0x80,0);delay(100);for(i=0;i<16;i++){TransferData(*addr1,1);addr1++;delayms(50);}}void TransferData(char data1,bit DI) //传送数据或是命令,当DI=0时,传送命令,当DI=1时,传送数据{WRD=0;RS=DI;delay(1);P0=data1;E=1;delay(1);E=0;}void delayms(unsigned int n){unsigned int i,j;for(i=0;i<n;i++)for(j=0;j<2000;j++);}void delay(unsigned int m){unsigned int i,j;for(i=0;i<m;i++)for(j=0;j<10;j++);}原理就是在显示每个汉字的时候加了一个延时程序,当然可以用定时器来实现,这样的话,不占用CPU处理时间。

C51语言与图形点阵液晶显示模块FM12864I的接口控制技术(内含C代码-详细)

C51语言与图形点阵液晶显示模块FM12864I的接口控制技术(内含C代码-详细)

●主题论文1模块简介FM 12864I 是一种图形点阵式液晶显示器,它主要由行驱动器/列驱动器及128×64全点阵液晶显示器H D61202组成。

既可显示图形,也可显示8×4个(16×16点阵)汉字。

其主要技术参数和性能如下:●电源为+5V ,模块内自带-10V 负压,可作为LCD 的驱动电压;●显示128(列)×64(行)点阵;●可全屏幕点阵显示;●具有七种操作指令;●与CPU 接口采用8位数据总线并行输入输出和8条控制线;●占空比为1/64;●工作温度范围为0℃~+50℃,存储温度为-20℃~+70℃;●模块体积:54×50×6.5mm 。

FM 12864I 模块的主要硬件构成框图如图1所示。

图2所示为其行/列驱动器显示RAM 的地址结构。

2引脚功能和操作时序FM12864I 模块的外部引脚功能如表1所列。

图3所示是FM12864I 的读写操作时序图。

3模块指令系统FM12864I 模块共有7种指令,分别介绍如下:●显示开/关指令格式:当D B0=1时,LCD 显示RAM 中的内容;D B0=0时,关闭显示。

●显示起始行(ROW )设置指令格式:图2FM12864I 中行/列驱动器显示RAM 的地址结构C51语言与图形点阵液晶显示模块FM 12864I 的接口控制技术中国人民解放军第六九零三工厂技术开发处高健I nterface Control Technolo gy of C51and G ra p hics Matrix LCD FM12864IG ao Jian摘要:FM12864I 液晶显示模块内置有H D61202液晶显示控制驱动器,可直接与8位微处理器相连。

文中给出了MPU 与FM12864I 的接口电路,同时根据内置H D61202液晶驱动器的汉字显示指令特性,给出了相应的控制软件程序。

关键词:液晶;图形显示;FM12864I;C51语言分类号:T N873文献标识码:B 文章编号:1006-6977(2002)05-0059-05图1FM12864I的内部结构该指令设置了对应液晶屏最上一行的显示RAM的行号,有规律的改变显示起始行,可以使LCD实现滚屏显示。

中文图形12864点阵液晶显示模块与51单片机的并行接口电路及C51程序设计

中文图形12864点阵液晶显示模块与51单片机的并行接口电路及C51程序设计

BF 位 ! 当 BF 为 0 时 !LM3033B *0BR3 才可接收 新的指令或数据 " 在操作时 !LM3033B+0BR3 在单
片机的时钟信号的控制下 ! 数据通过数据线传送给
LM3033B,0BR3 ! 当 LM3033B-0BR3 成功接收 到数据后 ! 转入内部时钟控制 ! 封 锁 I/O 口 缓 冲 器 !
技 术 交 流

! 结论
在单片机与液晶的接口中 ! 关键是要满足液晶 的时序要求 * 在软件编程中 ! 关键是要进行正确的初 始化 + 操作及写入显示内容的代码 $ 以上接口电路和 相应的程序已经通过调试 ! 并在实际中得到应用 $ 由
& 2008’ 07- 0041- 04 文章编号 "1006- 6268
中文图形 12864 点阵液晶显示模块与 51 单片机的并行接口电路及 C51 程序设计
李志广 :J;! 李晓泉 L! 淮俊霞 :J; &:Q 河北工业大学应用物理系 ! 天津 L$$:L$%
技 术 交 流
;Q深圳市拓普微科技开发有限公司 ! 深圳 D:<$DX% LQ天津市轻工业设计院 ! 天津 L$$:YL ’
[1]杨应平 , 石城 , 蒋爱湘 , 李振华 . 图形点阵液晶显示 模块与 51 系列单片机的接口设计 [J ]. 现代显示 ! 2006,(5):41- 45. [2]李良成 , 张永顺 , 张璟 . 基于 MSP430 单片机的液
晶显示[J ]. 现代显示 !2007 !(5):32- 33.
其对应关系如表图形显示绘图显示ram提供64x32个位元组的记忆空由扩充指令设定绘图ram位址在更改绘图ram时由扩充指令设定gdram位址先设置垂直位址再设置水平位址连续写入两个位元组的资料来完成垂直与水平的坐标位址再写入两个资料到绘图ram而位址计数器ac会自动加一整个写入绘图ram的步骤如下

51单片机LCD12864绘图

51单片机LCD12864绘图

LCD12864绘图方法如下:一、绘图方法:1、使用扩展指令集并关闭绘图显示2、输入y轴坐标3、输入x轴坐标4、写入数据D15-D85、写入数据D7-D06、开绘图显示7、返回普通指令对应程序如下:LCD_write_comm(0x34);//使用扩充指令集LCD_delay();LCD_write_comm(0x80+y);//y坐标起始地址LCD_delay();LCD_write_comm(0x80+x);//x坐标起始地址LCD_delay();LCD_write_date(0x55);//写入数据D15-D8LCD_delay();LCD_write_date(0x55);//写入数据D7-D0LCD_delay();LCD_write_comm(0x36);//显示RAMLCD_delay();LCD_write_comm(0x30);//退出扩展指令集LCD_delay();程序执行效果则是第一行的第1-16个像素点会描出0x5555的二进制像素点,则后面的整个屏幕则是花屏,如果只想看到这0x5555,这几个像素点,则必须要给LCD的RAM重新赋值,也可以说是清屏,程序如下:void LCD12864_RAM_Cls(){u8 x,y;//xy坐标LCD_write_comm(0x34);//使用扩充指令集LCD_delay();for(y=0;y<32;y++){LCD_write_comm(0x80+y);//y坐标起始地址LCD_delay();LCD_write_comm(0x80);//x坐标起始地址LCD_delay();for(x=0;x<16;x++){LCD_write_date(0x00);LCD_delay();LCD_write_date(0x00);LCD_delay();}}LCD_write_comm(0x36);//显示RAMLCD_delay();LCD_write_comm(0x30);//退出扩展指令集LCD_delay();}二、坐标与显示X轴坐标设定初始值后会自动加1,取值范围0-15Y轴需要人为加1,取值范围为0-31整个屏幕分为上下屏,上屏对应坐标为x(0-7)y(0-31),下屏对应坐标为x(8-15)y(0-31)三、LCD12864图片显示代码1、Main.c#include"common.h"#include"delay.h"#include"12864.h"unsigned char code Picture[]= // 图片数据表{//此处添加图片取模16进制码共1024Byte,取模方式:从左到右从上到下0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x06,0x30,0x01,0xE0,0x00,0x00,0x2A,0x00,0x00,0xD8,0x00,0x00,0x00,0x00,0x01, 0x80,0x0F,0x7B,0x63,0xE0,0x00,0x00,0x22,0x00,0x01,0x24,0x00,0x00,0x00,0x00,0x01,0x80,0x0D,0xDB,0x63,0x01,0xBC,0x00,0x08,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x01, 0x80,0x0C,0x1B,0x63,0x07,0xB0,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x01, 0x80,0x0C,0x1B,0x63,0xED,0xB0,0xDB,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x01, 0x80,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x0A,0x80,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x0A,0x00,0x00,0xFF,0xF8,0xE0,0x05,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x06,0xC0,0x15,0x00,0x1F,0xFF,0xFF,0xC0,0x02,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x09,0x20,0x11,0x00,0xFB,0xFF,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x08,0x20,0x0A,0x03,0x9F,0x00,0x9E,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x04,0x40,0x04,0x0E,0x70,0x00,0x81,0xC7,0x80,0x01,0x40,0x00,0x00,0x00,0x01, 0x80,0x02,0x80,0x00,0x1D,0x80,0x00,0xE0,0x61,0xE0,0x02,0xA0,0x00,0x00,0x00,0x01, 0xC0,0x01,0x00,0x00,0x77,0x9F,0xFC,0xF0,0x18,0xF8,0x02,0x20,0x00,0x00,0x00,0x01, 0xC0,0x00,0x00,0x01,0xDF,0x00,0x00,0xF3,0x0C,0x3C,0x01,0x40,0x00,0x00,0x00,0x01, 0xC0,0x00,0x00,0x03,0x9E,0x00,0x00,0xF8,0x06,0x1E,0x00,0x80,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xC0,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x0F,0xFD,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xF0,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x3F,0x81,0xFF,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0xFE,0xF0,0x00,0x00,0x01,0x00,0x00,0xC0,0x1C,0x00,0x00,0x00,0x00,0x01, 0x80,0x03,0xC0,0x07,0x80,0x00,0x03,0xE0,0x07,0x00,0x1C,0x00,0x00,0x00,0x00,0x01, 0x80,0x03,0x80,0x03,0x60,0x00,0x03,0xE0,0x0C,0x00,0x0E,0x00,0x00,0x00,0x00,0x01, 0x80,0x07,0x00,0x00,0xC0,0x00,0x00,0x20,0x18,0x00,0x07,0x00,0x00,0x00,0x00,0x01, 0x80,0x09,0x01,0x80,0x60,0x00,0x00,0x20,0x73,0x9F,0x03,0x80,0x00,0x00,0x00,0x01, 0x80,0x1E,0x0F,0xF2,0x20,0x00,0x00,0x20,0x67,0xFF,0xC1,0xC0,0x00,0x00,0x00,0x01, 0x80,0x1E,0x1F,0xF9,0x30,0x00,0x00,0x20,0xEF,0xFF,0xE0,0xE0,0x00,0x00,0x00,0x01, 0x80,0x38,0x3F,0xFC,0x90,0x00,0x00,0x20,0xCB,0xFF,0xF9,0xF0,0x00,0x00,0x00,0x01, 0x80,0x7F,0x7F,0xFE,0x10,0x00,0x00,0x20,0xDB,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x01, 0x80,0x6E,0xF9,0xBF,0x10,0x00,0x00,0x20,0xF7,0xED,0xFF,0xF0,0x00,0x00,0x00,0x01, 0x80,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x01, 0x80,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x01, 0x80,0x38,0xFC,0x3F,0x18,0x00,0x00,0x20,0x87,0xE0,0xFD,0xC0,0x00,0x00,0x00,0x01, 0x80,0x38,0xF1,0x8F,0x18,0x00,0x1F,0xE7,0x87,0x9C,0x7D,0xC0,0x00,0x00,0x00,0x01, 0x80,0x1C,0xFE,0x1F,0x81,0xFF,0xFF,0xC0,0x0F,0xE0,0xFF,0x80,0x00,0x00,0x00,0x01, 0x80,0x0C,0xFC,0x3F,0x80,0x00,0x00,0x00,0x0F,0xE1,0xF8,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEC,0xFE,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x01,0x80,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0xE0,0x00,0x00,0x00,0x60,0x00,0x00,0x01,0xC0,0x02,0x80,0x00,0x00,0x00,0x1C,0x01, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};void main(){LCD12864_init();//LCD初始化//LCD12864_RAM_Cls();LCD_Picture_show(Picture);while(1);}2、common.h#ifndef __COMMON_H#define __COMMON_H#include<STC12C5A60S2.h>#include "intrins.h"#define u8 unsigned char//无符号字符型#define u16 unsigned int//无符号整型#endif3、delay.h#ifndef __DELAY_H#define __DELAY_H#include "common.h"#define MAIN_Fosc 24000000L //定义主时钟void delay_ms(u16 ms);void LCD_delay();//LCD延时函数#endif4、delay.c#include "delay.h"//-------毫秒延时函数---------------void delay_ms(u16 ms){u16 i;do{i = MAIN_Fosc / 13000;while(--i) ; //14T per loop }while(--ms);}//------LCD延时函数-----------------void LCD_delay(void){_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();}5、12864.h#ifndef __12864_H#define __12864_h#include "common.h"sbit CS =P1^1;//片选sbit SID=P1^2;//数据口sbit CLK=P1^3;//同步时钟void LCD_write_spi(u8 date);//LCD SPI数据写入void LCD_write_comm(u8 comm);//LCD写指令void LCD_write_date(u8 date);//LCD写数据void LCD12864_init();//LCD初始化void LCD12864_RAM_Cls();//RAM清屏void LCD_print(u8 *date);//LCD字符串显示void LCD_Picture_show(u8 *date);#endif6、12864.c#include"common.h"#include"delay.h"#include"12864.h"//------LCD SPI数据写入--------------------void LCD_write_spi(u8 date){u8 i;for(i=0;i<8;i++){CS=1;if(date&0x80){SID=1;}else{SID=0;}date <<= 1;CLK=1;LCD_delay();CLK=0;}}//------LCD写指令--------------------void LCD_write_comm(u8 comm){u8 date = 0xf8;//串行写入指令到LCD(数据手册)u8 comm_H = comm&0xf0;u8 comm_L = comm<<4;CS =0;CLK=0;SID=0;LCD_delay();LCD_write_spi(date);LCD_write_spi(comm_H);LCD_write_spi(comm_L);CS=0;}//------LCD写数据-----------------------void LCD_write_date(u8 date){u8 date2 = 0xfa;//串行写入指令到LCD(数据手册)u8 date_H = date&0xf0;u8 date_L = date<<4;CS =0;CLK=0;SID=0;LCD_delay();LCD_write_spi(date2);LCD_write_spi(date_H);LCD_write_spi(date_L);CS=0;}//-----LCD初始化--------------------------void LCD12864_init(){LCD_write_comm(0x01);//清屏幕delay_ms(1);LCD_write_comm(0x0c);//开显示,游标显示关闭LCD_delay();LCD_write_comm(0x81);//设定坐标LCD_delay();}//-----写RAM清屏--------------------------void LCD12864_RAM_Cls(){u8 x,y;//xy坐标LCD_write_comm(0x34);//使用扩充指令集LCD_delay();for(y=0;y<32;y++){LCD_write_comm(0x80+y);//y坐标起始地址LCD_delay();LCD_write_comm(0x80);//x坐标起始地址LCD_delay();for(x=0;x<16;x++){LCD_write_date(0x00);LCD_delay();LCD_write_date(0x00);LCD_delay();}}LCD_write_comm(0x36);//显示RAMLCD_delay();LCD_write_comm(0x30);//退出扩展指令集LCD_delay();}//----LCD字符串显示-----------------------void LCD_print(u8 *date){u8 j=0;while(date[j]!='\0'){LCD_write_date(date[j]);j++;LCD_delay();}}//----图片显示-----------------------------void LCD_Picture_show(u8 *date){u8 x,y;//xy坐标LCD_write_comm(0x34);//使用扩充指令集LCD_delay();for(y=0;y<32;y++){LCD_write_comm(0x80+y);//y坐标起始地址LCD_delay();LCD_write_comm(0x80);//x坐标起始地址LCD_delay();for(x=0;x<8;x++)//写上半屏幕{LCD_write_date(date[16*y+x*2]);LCD_delay();LCD_write_date(date[16*y+x*2+1]);LCD_delay();}for(x=0;x<8;x++)//写下半屏幕{LCD_write_date(date[16*(y+32)+x*2]);LCD_delay();LCD_write_date(date[16*(y+32)+x*2+1]);LCD_delay();}}LCD_write_comm(0x36);//显示RAMLCD_delay();LCD_write_comm(0x30);//退出扩展指令集LCD_delay();}四、程序执行效果。

12864点阵型驱动程序(51单片机、c语言)

12864点阵型驱动程序(51单片机、c语言)
** 函 数 名:asc()
** 功能描述:在液晶显示器上写一个ASCII字符,写之前需要使用setxy()函数确定位置
** 输入参数:uchar ascii:字符对应的ascii码
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/
** 功能描述:C语言下最精确最简单的延时函数,延时时间为2*t+2(us)
** 输入参数:t-延时时间参数
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/
void setp(uchar n)
{
switch(n){
case 0: cs1=1;cs2=1; break;
case 1: cs1=1;cs2=0; break;
case 2: cs1=0;cs2=1; break;
default:break;}
}
/*********************************************************
** 输入参数:uchar dat
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/

图形点阵液晶显示模块与51系列单片机的接口设计

图形点阵液晶显示模块与51系列单片机的接口设计

00 0 0 0 0 0 D C B
控制整体显示,游标位置反白 O N /O FF。 D :整体显示 O N /O FF 控制位元。 当 D = "1"整体显示 O N 。 当 D = "0",整体显示 O FF ,不改变 D D R A M 的内容。 C :游标 O N /O FF 控制位元。
May 2006
言编程, 驱动液晶模块实现串行传输方式的字符显示和图形显示。将程序写入单片机很好地
驱动了该液晶模块, 得到了很好的显示效果, 从而证明了该驱动程序和电路的可行性。
关键词: SYB12864 液晶显示模块; ST7920 单片机; C51 编程
中文分类号: TN141.9
文献标识码: B
Inte rfa ce & De s ign Of Gra phics Dot Ma trix LCD a nd MCS 51 S e rie s MP U
表 1 SYB12864K-ZK 部分管脚说明
管脚号 管脚符号



VSS 逻辑电源地。

VDD 逻辑电源+5V。
, LC D 显示范围为 16 字元 X 2 行)64 x 256- 位元 绘图显示 R A M( G D R A M ),共内置 8192 个中文汉 字(16 ×16 点阵)、128 个字符的 A S C II字符库(8 × 16 点阵)及 64×256 点阵显 R A M (G D R A M )。为了 能够简单、有效地显示汉字和图形,该模块内部设计 有 2M B 的 中 文 字 型 C G R O M 和 64 ×256 点 阵 G D R A M 绘图区域;同时该模块还提供有 4 组可编 程控制的 16×16 点阵造字空间[6-7]。

12864显示程序,51单片机,C语言

12864显示程序,51单片机,C语言

12864显示程序,51单片机,C语言可显示固定中文,字符,数字;可实时动态刷新显示数字,字符;#include<reg52.h>sbit rs=P1^2;sbit rw=P1^1;sbit cs=P1^0;sbit psb=P1^3;unsigned char code table[]={" X0: Y0: "}; unsigned char code table1[]={"现在X1: Y1: "}; unsigned char code table2[]={"划线模式:"}; unsigned char code table3[]={"开始暂停"};void delay(unsigned char z) //延时{unsigned i,j;for(i=0;i<z;i++)for(j=0;j<110;j++);}void write_com(unsigned int com) //写命令{rs=0;rw=0;cs=0;P2=com;delay(5);cs=1;delay(5);cs=0;}void write_date(unsigned char dat) //写数据{rs=1;rw=0;cs=0;P2=dat;delay(5);cs=1;delay(5);cs=0;}void pos(unsigned char x,unsigned char y) //起点函数{unsigned char pos;if(x==0)x=0x80;else if(x==1)x=0x90;else if(x==2)x=0x88;else if(x==3)x=0x98;pos=x+y/2;write_com(pos);}void init(){unsigned char i;psb=1; //1并行,0串行write_com(0x30); //基本指令操作delay(5);write_com(0x0c); //显示开,关光标delay(5);write_com(0x01); //清除led的显示内容delay(5);pos(0,0);i=0;while(table[i]!='\0') //第一行固定显示{write_date(table[i]);i++;}pos(1,0);i=0;while(table1[i]!='\0'){write_date(table1[i]); //第二行固定显示i++;}pos(2,0);i=0;while(table2[i]!='\0'){write_date(table2[i]); //第三行固定显示i++;}pos(3,0);i=0;while(table3[i]!='\0'){write_date(table3[i]); //第四行固定显示i++;}}void write_dianya(unsigned char add_x,unsigned char add_y,int date){//12864刷新char bai,shi,ge;bai=date/100;shi=date%100/10;ge=date%10;pos(add_x,add_y);write_date(0x30+bai);write_date(0x30+shi);write_date(0x30+ge);}void main(){init();while(1){write_dianya(0,3,134);}}。

液晶屏12864的51单片机程序

液晶屏12864的51单片机程序

void Port_Init (void)
{
// XBR0 = 0x01;
// UART0 Selected
XBR1 = 0x40;
// Enable crossbar and weak pull-ups
P0MDOUT |= 0xDf;
// TX, LEDs = Push-pull
Crossbar
P1MDOUT |=0x03; }
//-----------------------------------------------------------------------------
//
// Return Value : None
// Parameters : None
//
// This function initializes the GPIO and the
// its lowest frequency
RSTSRC = 0x04;
// Enable missing clock detector
}
//-----------------------------------------------------------------------------
// Port_Init
void WriteDataLCM(uchar dataW) {
LCM_EN=0; LCM_RS=1; DataPort&=0xf0; DataPort|=(dataW&0xf0)>>4; delay(1); LCM_EN=1; delay(1); LCM_EN=0; delay(1); DataPort&=0xf0; DataPort|=(dataW&0x0f); delay(1); LCM_EN=1; delay(1); LCM_EN=0; }

基于51单片机的12864LCD显示驱动

基于51单片机的12864LCD显示驱动

基于51单片机的12864LCD显示驱动摘要:利用51单片机对12864LCD显示屏进行驱动,并令其显示动态及静态图像。

可使用4位/8位并行、2线或3线串行多种接口方式,拥有多种字库的点阵图形液晶显示模块;接口方式灵活,操作指令简单、方便,可构成全中文人机交互图形界面。

可以显示汉字,也可完成图形显示;电压、功耗较低;硬件电路结构与显示程序都要简洁,同时价格也略低于相同点阵的图形液晶模块。

关键词:51单片机12864LCD 显示屏动态静态图像引言带中文字库的TS128X64(图1)具有4位/8位并行、2线或3线串行多种接口方式,引脚功能见图2。

其内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64,内置8192个16*16点汉字,和128个16*8点ASCII字符集。

图1 TS12864液晶实物图该模块接口方式灵活和操作指令简单、方便,可构成全中文人机交互图形界面。

可以显示8×4行16×16点阵的汉字。

也可完成图形显示,有低电压低功耗的特点。

由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构还是显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。

本设计讲采用STC89C52对TS128X64进行驱动,设计并制作LCD驱动电路,使其可通过按键切换LCD的显示内容,并且实现对数字,汉字,英文以及图片的显示,滚屏,以及动画功能。

1.硬件设备STC89C52是STC公司生产的一种低功耗、高性能CMOS8位微控制器,具有8K 在系统可编程Flash存储器。

STC89C52使用经典的MCS-51内核,但做了很多的改进使得芯片具有传统51单片机不具备的功能。

在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得STC89C52为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。

具有以下标准功能:8k字节Flash,512字节RAM,32 位I/O 口线,看门狗定时器,内置4KB EEPROM,MAX810复位电路,3个16 位定时器/计数器,4个外部中断,一个7向量4级中断结构(兼容传统51的5向量2级中断结构),全双工串行口。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
李志广等:中文图形12864点阵液晶显示模块与5l单片机的并行接口电路及C51程序设计 文章编号:1006-6268(2008)07—0041--04
单片机,的撇口呶C5 中文图形1 2864点阵液晶显示橄与5 1
技 术

1程序设计 玩
李志广12。李晓泉3,淮俊霞1’2 (1.河:il:-r业大学应用物理系。天津300130; 2。深圳市拓普微科技开发有限公司。深圳518057;
中图分类号:TN40
文献标识码:A
Parallel I nterface Technique between Chinese G raphic 1 2864 Dot Matrix LCD Module and 51 Singlechip and C51 Programming
LI Zhi-guan912,LI Xiao-quan3,HUAI Jun-xial卫 (1.Department of Applied Physics,Hebei University of Technology,Tianjin 3001 30,China;
VSS VDD
NC RS(CS)
R/W(SID) E(SCLK)
DB0—7 PSB NC ,RST NC BLA BLK
图2 AT89S52和液晶LM3033B一0BR.3模块的 接口电路及LM3033B一0BR3引脚功能
晶的时51程序设计
纹 对LM3033B—OBR3的软件编程采用Medwin 术
表1字符显示的RAM地址与32个中文字符 显示区域的对应关系
80H 90H 88H 98H
8lH 9lH 89H 99tt
82H 92H 8AH 9AH
83H 93H 8BH 9BH
84H 94H 8CH 9CH
85H 95H 8DH 9DH
86H 96H 8EH 9EH
87H 97H 8FH 9FH
i始化、操作及写入显示内容的代码。以上接口电路和
黝{”耩相应的程序已经通过调试,并在实际中得到应用。由
ST7920构成的LM3033B一0BR3液晶显示模块与
同类型的图形点阵液晶显示模块相比,不论硬件电
路结构或显示程序都要简洁得多。因此,
LM3033B一0BR3液晶显示模块将得到广泛的应
用。 (上接第15页)
VDD PSB
DB0 DBl DB二 DB 3 DB4 DB5 DB6 DB7
RS
R/W
。_

10
Vcc
11
E五
12
1;
14
15 16
17
×TAL2
P3 O p3 7 p3 6
X1-ALl V螺
30pF
一卜
=目:M
费}I
管脚号
l 2 3 4 5 6 7一14 15 16 17 18 19 20
管脚名称
以LM3033B一0BR3为例介绍了12864点阵液晶显 示模块的引脚、结构、功能,详述了与AT89S52单片 机的硬件接口电路及有关软件编程方法。
1 LM3033B一0BR3特点及操作
1.1字符显示 每屏可显示4行8列共32个16 X 16点阵的
汉字,每个显示RAM可显示1个中文宇符或2个 16 X 8点阵全高ASCII码字符,即每屏最多可实现 32个中文字符或64个ASCII码字符的显示。内部 提供128 X 2字节的字符显示RAM缓冲区 (DDRAM)o字符显示是通过将字符显示编码写入 该字符显示RAM实现的。根据写入内容的不同,可 分别在液晶屏上显示CGROM(中文字库)、 HCGROM(ASCII码字库)及CGRAM(自定义字形) 的内容。三种不同字符/字型的选择编码范围为:显 示自定义字型其代码分别是0000H、0002H、0004H 和0006H共4个,显示半宽ASCII码字符为02H一 7FH,A1AOH—F7FFH显示8192种GB2312中文 字库字形。字符显示RAM在液晶模块中的地址 80H一9FH。字符显示的RAM的地址与32个字符 显示区域有着一一对应的关系,其对应关系如表1 所示[310
参考文献 【1 1P。S。Drzaic,。Reflective Displays:The Quest for
; 。
;,




蒗 术

WRCMD(0x30); //选择8位并行 WRCMD(0xoc);//开显示(无游标、不反白) WRCMD(0x01): //清除显示 WRCMD(0x04); ///shift=0.AC加1


辘4结论
”§ , 《

在单片机与液晶的接口中,关键是要满足液晶
?的时序要求:在软件编程中,关键是要进行正确的初
2单片机与LM3033B—OBR3的接口 电路
一般液晶显示模块与单片机的接口分为直接访 问方式和间接控制方式,间接控制方式还分为一位 串行、4位并行以及8位并行。本文采用的AT89S52 和液晶LM3033B—OBR3模块的接口电路如图2 所示。由于LM3033B—OBR3采用并口通信,外接 电路简单,与单片机连接采用间接连接的方法,即用 I/0口直接与LCD数据线和控制线相连,其特点是 简单、直观、操作方便。在此电路中,采用软件模拟液
2.Shenzhen Topway Technology CO.,LTD.,Shenzhen 51 8057,China; 3.Tianjin Light Industry Design Institute,TianJin 3001 93,China)
Abstract:How to control the time sequence of LM3033B一0BR3 LCD module by C51 programming was discussed in this paper.In this way the LCD module was driven by parallel communication and the characters and graphics could be displayed well.The parallel interface circuit and the soft design between LM3033B-0BR3 LCD module and AT89S52 were narrated in detail. Keywords:LM3033B-OBR3 LCD moduIe:ST7920 controller;AT89S52 single chip micyoco; C51 programming
对于前端加工工序来说,关键设备是高通量印刷
机、研磨机、装配机、清洗机。主要加工因素是良好的表
面清洁度、低颗粒污染率、良好的器件单元间隔和厚
度层控制。后端生产过程与传统LCD生产相比不变。
结论
电子纸市场发展迅速。Nemoptic作为市场的主 导和积极角色,已经和它的制造伙伴Seiko Instruments,Inc建立了一个BiNem液晶显示器模 块的批量生产基地。
收稿日期::2008-01—27
万方数据
JIll.,2008,总第90期
现代显示Advanced Display 41
李志广等:中文图形12864点阵液晶显示模块与5l单片机的并行接1:3电路及CSI程序设计
引言
显示器是人类与应用设备沟通的重要界面,近年 姑 来,随着电子技术的飞速发展,液晶显示技术在实际 术 生活中得到了广泛应用。液晶显示模块以其微功耗、
a.关闭绘图显示功能(在写入绘图RAM期间, 绘图显示必须关闭)Ⅻ;
b.先将垂直的位元组(Y)写入绘图RAM位址; c.再将水平的位元组lX)写入绘图RAM位址; d.将D1 5一D8写入到RAM中; e.将D7一DO写入到RAM中。
00
D1 5一D0 0D 0I
避 Ill:
暑= l,
坦 00

Ol
霎 体积小、显示内容丰富、模块化以及接口电路简单等
诸多优点在科研、生产和产品设计等领域中发挥着越 3来越重要的作用“司。LM3033B系列液晶显示模块
是深圳TOPWAY公司生产的中文显示模块中的一 ‘,员。采用了台湾的ST7920控制芯片,并提供了中文 j字库,为中文显示开发方面带来了更多的方便。本文
写命令到LCD: void WRCMD(uchar cmdcode)

chk—.busy();
RS=O;
RW=O;
E=I:
Icd..bus=cmdcode; E=0:
l 写数据到LCD: void WRData(uchar Dispdata) {
chk_busy();
RS=I:
RW=O;
E=I:
Icd—bus=Dispdata: E=0:
3.天津市轻工业设计院。天津3001 93)
摘 要:讨论如何利用软件控制LM3033B一0BR3液晶显示模块时序,采用C51语言编程,驱动
液晶模块实现并行传输方式的字符、汉字以及图形显示。具体阐述了LM3033B一0BR3液晶显示
模块与单片机AT89S52的并行接口电路和软件编程方法。
关键词:LM3033B一0BR3液晶显示模块;ST7920控制器;AT89S52单片机;C51编程

堰 lr
D1 5一DO 08
口1 D15,430
农平警妊
06 D1 5-DO


ll
128×64点
D15-D0 09
D1 5一DD 0E
a7 D1 5-D0
D'5-DO 0F
图1绘图tLAM与屏幕显示区域的对应关系
1.3 LM3033B一0BR3的操作指令 LM3033B一0BR3提供两套控制命令:基本指
42现代显示Advanced Display
万方数据
相关文档
最新文档