12864zw 8位并行显示一幅图片
LCD12864图形液晶并口显示2
LCD12864图形液晶并口显示【教学引入】液晶屏,在生活中很常见,我们常见的液晶显示器,如电脑的显示器,电视机,手机等等。
液晶屏在生活中已得到了普遍应用,它显示个各种各样的画面。
上次呢,我们让12864显示了汉字,这次我们让它显示图形。
【教学目标】1、掌握LCD12864液晶屏的绘图用法;2、编写LCD12864液晶屏的指令代码;【知识目标】1、掌握LCD12864液晶屏的绘图用法;2、掌握LCD12864液晶屏指令代码;【教学准备】电脑、Proteus、Keil、MCS-51系列单片机综合实验箱【教学方法】教法:讲授法、讨论法学法:练习法、探究法【教学课时】四课时【教学过程】一、12864液晶介绍12864液晶屏不仅能显示汉字,还能显示图形。
今天呢,我们就来看看液晶屏怎么显示图形的。
首先呢,我们看看显示坐标关系1、图形显示坐标水平方向X——以字节为单位垂直方向Y——以位为单位由图可知,水平方向为0~31,以位为单位;垂直方向为0~7、8~16,以2个字节为单位,分为上下两个块。
如下图2、图片取模有了图像显示的坐标,我们该把图片变成代码了,PCtoLCD2002不仅能取模汉字,还能取模图片。
字模软件PCtoLCD2002双击图标打开软件可以看到下图所示的画面,此软件也是绿色软件打开后可以直接使用。
软件有两种工作模式:字符模式和图形模式;上图界面是字符模式。
可以通过菜单栏模式(C)切换工作模式。
我们选择图形模式,最大化,如下图。
单击工具栏中的图标按钮,看到如下图所示的对话框。
我们可以根据自己的实际需要而进行的设置,因其简单易用这里不再详细讲述其使用方法。
设置完成后,单击左下角的确定保存。
设置如下图回到PCtoLCD2002完美版-(图形模式)界面,单击按钮,导入要显示的128X64的bmp图片,单击图标按钮,可以看到软件下方的数据显示区域出现的对应的显示数据。
如下图阅“12864M.PDF”12864M液晶显示模块技术手册——四、用户指令集1、指令表2:(RE=1:扩充指令集),如下图,讲解了12864的扩充指令集。
12864zw 实例教程,包括自定义字符,图片显示等等
/*12864zw 实例教程,包括自定义字符,图片显示等等*/#include<reg52.h>#include <intrins.h>sbit RS=P2^2;//串口时为CSsbit RW=P2^3; //串口为SIDsbit E=P2^4; //串口为时钟SCLK //sbit stop=P3^2;sbit PSB=P2^5;sbit REST=P2^7;//以下是用<at89x51.h>头文件的定义/* #define RS P2_0#define RW P2_3 //定义引脚#define E P2_4 #define PSB P2_3#define REST P2_7#define Data P0#include<at89x51.h> */#define BF 0x80//用于检测LCM状态字中的Busy标识typedef unsigned int Uint;typedef unsigned char Uchar;//字符串例子//"F1--English",也可以往里面写入汉字码,一个汉字由两个码组成const Uchar F1English[]={0x46,0x31,0x2d,0x2d,0x45,0x6e,0x67,0x6c,0x69,0x73,0x68, 0x00}; const Uchar lengthF1=6; //字符串长度//汉字,直接可以写入字形unsigned char code uctech[] = {"曾小贤愚人节快乐"};const Uchar lengthCF3=8;Uchar code TAB1[]={/*-- 调入了一幅图像:C:\Documents and Settings\Administrator\桌面\12864.bmp --*//*-- 宽度x高度=128x64 --*/0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xF F,0xFF,0xFF,0xFF,0xC0,0x01,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF ,0xFF,0xFE,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF, 0xF8,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xE0,0 x00,0x00,0x0F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x 00,0x0F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x80,0x04,0x00,0x0 3,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x00,0x04,0x00,0x07,0xFF, 0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x00,0x04,0x00,0x03,0xFF,0xFF,0 xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFE,0x00,0x02,0x00,0x03,0xFF,0xFF,0xFF,0x F8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFE,0x00,0x02,0x00,0x01,0xFF,0xFF,0xFF,0xF8,0x0 0,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFC,0x00,0x12,0x00,0x01,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFC,0x00,0x12,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xF8,0x00,0x32,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0 x00,0x01,0xBF,0xFF,0xFF,0xFF,0xF8,0x00,0x22,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x 01,0xBF,0xFF,0xFF,0xFF,0xF8,0x00,0x33,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xB F,0xFF,0xFF,0xFF,0xF8,0x00,0x63,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF, 0xFF,0xFF,0xFC,0x00,0x61,0x80,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0 xFF,0xFC,0x00,0xE1,0x80,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0x FC,0x00,0xE1,0xC0,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFE,0x 00,0xE1,0xC0,0x01,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFE,0x01,0x E1,0xC0,0x01,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFE,0x01,0xF1,0x E0,0x03,0xFF,0xFF,0xFF,0xF8,0x00,0x02,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x03,0xE3,0xE0,0x0 2,0xFF,0xFF,0xFF,0xF8,0x01,0xFF,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x03,0xE1,0xF0,0x07,0xFF ,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x4B,0xF1,0xF8,0x06,0xFF,0xFF, 0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,0xF8,0x0F,0xFF,0xFF,0xFF,0 xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0xFC,0x1F,0xFF,0xFF,0xFF,0xF8,0x 00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x3F,0xFF,0xFF,0xFF,0xF8,0x00,0x0 0,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xF8,0x00,0x9C,0x0 1,0xBF,0xFF,0xFF,0xFF,0xFF,0xCF,0xFB,0xFF,0x00,0x7E,0xFF,0xFF,0xF8,0x01,0xF4,0x01,0xB F,0xFF,0xFF,0xDE,0x10,0x8F,0xF9,0xFF,0x01,0x2B,0x39,0xFF,0xF8,0x01,0xB4,0x01,0xBF,0xF F,0xFC,0x42,0xF0,0x1F,0xFD,0xFF,0x80,0x44,0x0A,0xFF,0xF8,0x01,0xBC,0x01,0xBF,0xFF,0x FD,0x07,0x20,0x3F,0xE9,0xFF,0xC0,0x41,0x45,0xFF,0xF8,0x01,0xB4,0x01,0xBF,0xFF,0xFE,0x ED,0x5A,0x8B,0xC0,0xFF,0xC0,0x05,0xDD,0xFF,0xF8,0x01,0xF4,0x01,0xBF,0xFF,0xFD,0xB0,0xF4,0x20,0x01,0x00,0x62,0xF7,0xFF,0xFF,0xF8,0x00, 0x95,0x01,0xBF,0xFF,0xFF,0xFF,0xB4,0x0F,0xF9,0x00,0x23,0x7F,0xFF,0xFF,0xF8,0x00,0xB7,0 x01,0xBF,0xFF,0xFF,0xFC,0x14,0x83,0xFF,0xF9,0x3C,0x08,0xFF,0xFF,0xF8,0x00,0x80,0x01,0 xBF,0xFF,0xFF,0xE6,0x56,0x81,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0 xFF,0xFF,0xFF,0xFD,0x00,0xFF,0xFF,0xFA,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0 xFF,0xFF,0xDA,0x87,0xFF,0xFF,0xDA,0x3F,0xFF,0xFF,0xF8,0x00,0xFC,0x01,0xBF,0xFF,0xFF, 0xEE,0xFF,0x02,0xFD,0x7F,0xF9,0x7F,0xFF,0xFF,0xF8,0x00,0x84,0x01,0xBF,0xFF,0xFF,0xFF, 0xF8,0xC0,0x01,0x02,0xDA,0xFF,0xFF,0xFF,0xF8,0x00,0xCC,0x01,0xBF,0xFF,0xFF,0xFF,0xF6 ,0x11,0x80,0xC0,0x1A,0x3F,0xFF,0xFF,0xF8,0x00,0xB4,0x01,0xBF,0xFF,0xFF,0xFF,0xFD,0x0E ,0xC1,0xF9,0x41,0xFF,0xFF,0xFF,0xF8,0x00,0xB4,0x01,0xBF,0xFF,0xFF,0xF8,0xA2,0xAF,0xF0 ,0xFF,0x93,0xFF,0xFF,0xFF,0xF8,0x00,0xCC,0x01,0xBF,0xFF,0xFF,0xFF,0xFD,0x8F,0xF8,0xFF ,0x2E,0xBF,0xFF,0xFF,0xF8,0x00,0x85,0x01,0xBF,0xFF,0xFF,0xFF,0xFD,0x57,0xF8,0xFF,0x18, 0xFF,0xFF,0xFF,0xF8,0x01,0x03,0x01,0xBF,0xFF,0xFF,0xFF,0xFD,0x07,0xF1,0xFE,0x47,0xFF, 0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xE3,0xF9,0xFE,0x3F,0xFF,0xFF,0 xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x83,0xF1,0xF9,0x7F,0xFF,0xFF,0xFF,0x F8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFA,0xC1,0xE1,0xF8,0x7F,0xFF,0xFF,0xFF,0xF8,0x 00,0x02,0x01,0xBF,0xFF,0xFF,0xFF,0xF9,0x00,0xF1,0xF0,0x34,0xFF,0xFF,0xFF,0xF8,0x01,0x5 F,0x01,0xBF,0xFF,0xFF,0xFF,0xF7,0x2C,0xE1,0xE4,0xFF,0xFF,0xFF,0xFF,0xF8,0x01,0xCC,0x0 1,0xBF,0xFF,0xFF,0xFF,0xFF,0xD0,0x61,0xC0,0x7F,0xFF,0xFF,0xFF,0xF8,0x01,0x5E,0x01,0xB F,0xFF,0xFF,0xFF,0xFE,0xAC,0x61,0xC1,0x67,0xFF,0xFF,0xFF,0xF8,0x01,0x5A,0x01,0xBF,0x FF,0xFF,0xFF,0xFE,0x80,0x21,0xC0,0x3F,0xFF,0xFF,0xFF,0xF8,0x01,0x5A,0x01,0xBF,0xFF,0xFF,0xFF,0xFD,0xC0,0x21,0x00,0x07,0xFF,0xFF,0xFF,0xF8,0x01,0xDA,0x01,0xBF,0xFF,0xFF,0xFF,0xFA,0x60,0x01,0x00,0x13,0xFF,0xFF,0xFF,0xF8,0x03,0x4C, 0x01,0xBF,0xFF,0xFF,0xFF,0xFC,0xD0,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xF8,0x02,0x52,0x01, 0xBF,0xFF,0xFF,0xFF,0xE1,0x00,0x00,0x00,0x08,0xD7,0xFF,0xFF,0xF8,0x00,0x21,0x01,0x80,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xF F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};//这个是在串口时指令和数据之间的延时/*void delay10US(Uchar x){Uchar k;for(k=0;k<x;k++);}*/const Uchar delay=250; //延时时间常数static void Wait1ms(void)//延迟1 ms{Uchart=0;while (cnt<delay)t++;}//延迟n msvoid WaitNms(int n){Uchar i;for(i=1;i<=n;i++)Wait1ms();}void ini_int1(void){EA=1;EX0=1;//允许外部INT0的中断IT0=1;// 允许中断}int scankey1() interrupt 2 using 3 //使用外部中断1,寄存器组3{while(P3^2==0){for(;;);}IE1=0;//中断标志清零}//**************************************************************************// //以下是并口时才开的//读忙标志,void RDBF(void){Uchar temp;RS=0; // RS=0RW=1; // RW=1while(1){P0=0xFF; //数据线为输入E=1;temp=P0;E=0; // E=0if ((temp&0x80)==0) break;}}//写数据到指令寄存器void WRCommand(Uchar comm){RDBF();RS=0;RW=0;P0=comm;E=1;E=0;}//写数据到数据寄存器void WRData(Uchar TEMP){RDBF();RS=1;RW=0;P0=TEMP;E=1;E=0;//stopint();}///////////////////////////////////////////////////////////////////////////////////以下是串口时开的读写时序/*void SendByteLCD(Uchar WLCDData){Uchar i;for(i=0;i<8;i++){if((WLCDData<<i)&0x80)RW=1;else RW=0;E=0;E=1;}}SPIWR(Uchar Wdata,Uchar WRS){SendByteLCD(0xf8+(WRS<<1));SendByteLCD(Wdata&0xf0);SendByteLCD((Wdata<<4)&0xf0);}void WRCommand(Uchar CMD){RS=0;RS=1;SPIWR(CMD,0);delay10US(90);//89S52来模拟串行通信,所以,加上89S52的延时,}void WRData(Uchar Data){RS=0;RS=1;SPIWR(Data,1);}*//*******************************************************************/ //初始化LCD-8位接口void LCDInit(void){// PSB=0; //串口PSB=1;//并口时选这个,上一行取消REST=1;REST=0;REST=1;WRCommand(0x30); //基本指令集,8位并行WRCommand(0x06); //启始点设定:光标右移WRCommand(0x01); //清除显示DDRAMWRCommand(0x0C); //显示状态开关:整体显示开,光标显示关,光标显示反白关WRCommand(0x02); //地址归零}//显示数组字符串(显示半宽字型16*8点阵)void ShowQQChar(Uchar addr,Uchar *english,Uchar count){Uchar i;WRCommand(addr); //设定DDRAM地址for(i=0;i<count;){WRData(english[i*2]);WRData(english[i*2+1]);i++;}}//显示连续字串(半宽字符)void ShowNUMChar(Uchar addr,Uchar i,Uchar count){Uchar j;for(j=0;j<count;){WRCommand(addr); //设定DDRAM地址WRData(i+j);j++;WRData(i+j);addr++;j++;}}//自定义字符写入CGRAMvoid WRCGRAM(Uchar data1,Uchar data2,Uchar addr){Uchar i;for(i=0;i<16;){WRCommand(addr+i); //设定CGRAM地址WRData(data1);WRData(data1);i++;WRCommand(addr+i); //设定CGRAM地址WRData(data2);WRData(data2);i++;}}//显示自定义的字符,并把这个字符填满全屏16*16void ShowCGChar(Uchar addr,Uchar i){Uchar j;for(j=0;j<0x20;){WRCommand(addr+j); //设定DDRAM地址WRData(0x00);WRData(i);j++;}}void CLEARGDRAM(void){Uchar j;Uchar i;WRCommand(0x34);WRCommand(0x36);for(j=0;j<32;j++){WRCommand(0x80+j);WRCommand(0x80);//X坐标for(i=0;i<32;i++)//{WRData(0x00);}}}//写入GDRAM 绘图,Y是Y绘图坐标,2个字节一行,CLONG是图形长度,以字节//为单位;HIGHT是图形高度,TAB是图形数据表.12864M的图形显示是相当于256*32点阵. //由两屏128*32上下两屏组成,同一行的下屏的头地址紧接上屏的未地址。
12864文字加图像显示
/***************************************************************************标题:LCD12864程序效果:本程序在LCD12864液晶屏显示汉字、字符及图形内容工作于:L Y5A-L2A开发板******************************************************************************/ #include "reg51.h"/********IO引脚定义***********************************************************/ sbit LCD_RS=P1^0;sbit LCD_RW=P1^1;sbit LCD_E=P1^2;sbit PSB =P1^6; //PSB脚为12864-12系列的串、并通讯功能切换,我们使用8位并行接口,PSB=1/********宏定义***********************************************************/#define LCD_Data P0#define Busy 0x80 //用于检测LCD状态字中的Busy标识/********函数声明*************************************************************/ void WriteDataLCD(unsigned char WDLCD); //写数据void WriteCommandLCD(unsigned char WCLCD,BuysC); //写指令unsigned char ReadDataLCD(void); //读数据unsigned char ReadStatusLCD(void); //读状态void LCDInit(void); //初始化void LCDClear(void); //清屏void LCDFlash(void); //闪烁效果void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData); //按指定位置显示一个字符void DisplayListChar(unsigned char X, unsigned char Y, unsigned char code *DData); //按指定位置显示一串字符void Delay5Ms(void); //短延时void Delay400Ms(void); //长延时/********数据定义*************************************************************/ code unsigned char uctech[] = {"5 1 单片机实验板"};code unsigned char net[] = {" "};code unsigned char mcu[] = {"单片机因你而精彩"};code unsigned char qq[] = {" QQ: 12345678 "};code unsigned char tmp[]={//128*64点阵图形数据0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x8F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0xEF,0xFF,0x80,0x02,0x08,0x00,0x88,0x02,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0xFF,0xFF,0x80,0x02,0x08,0x0C,0xC8,0x02,0x00,0x7F,0xE1,0xEF,0xC0,0x01, 0x80,0x00,0xFF,0xFF,0x80,0x02,0x08,0x04,0x08,0x3F,0xE0,0x01,0x81,0x29,0x40,0x01, 0x80,0x00,0xFF,0xFC,0x40,0x0F,0xFF,0x01,0xFE,0x22,0x20,0x03,0x01,0x29,0x40,0x01, 0x80,0x01,0xFF,0xFC,0x20,0x02,0x18,0x10,0x20,0x22,0x20,0x06,0x01,0x29,0x40,0x01, 0x80,0x01,0xFF,0xFC,0x00,0x06,0x18,0x18,0x20,0x3F,0xE0,0x06,0x01,0x29,0x40,0x01, 0x80,0x01,0xFF,0xF8,0x10,0x07,0x2C,0x01,0xFC,0x22,0x20,0xFF,0xF1,0x2F,0xC0,0x01, 0x80,0x01,0xFF,0xFC,0x30,0x0E,0xAE,0x00,0x20,0x22,0x20,0x06,0x01,0x28,0x40,0x01, 0x80,0x03,0xFF,0xFC,0x38,0x0A,0x6A,0x00,0x20,0x22,0x20,0x06,0x01,0xE8,0x00,0x01, 0x80,0x03,0xFF,0xFE,0x18,0x0A,0x49,0x0F,0xFE,0x3F,0xE0,0x06,0x01,0x28,0x00,0x01, 0x80,0x03,0xFF,0xFE,0x18,0x02,0x08,0x08,0x20,0x22,0x00,0x06,0x01,0x08,0x20,0x01, 0x80,0x07,0xFF,0xFF,0x17,0x02,0x08,0x18,0x20,0x02,0x08,0x06,0x00,0x08,0x20,0x01, 0x80,0x07,0xFF,0xBF,0x8F,0x82,0x08,0x10,0x20,0x03,0xF8,0x0C,0x00,0x07,0xE0,0x01, 0x80,0x0F,0xFE,0x03,0xF7,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x0F,0xFC,0x00,0x8A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x07,0xF8,0x00,0x08,0x00,0x00,0x00,0x0C,0x01,0x80,0xE0,0x00,0x00,0x00,0x01, 0x80,0x01,0xF8,0x00,0x20,0x00,0x00,0x00,0x04,0x00,0x81,0x20,0x00,0x00,0x00,0x01, 0x80,0x00,0xF8,0x00,0x20,0x00,0x00,0x00,0x04,0x00,0x81,0x20,0x00,0x00,0x00,0x01, 0x80,0x01,0xF8,0x04,0x80,0x01,0xFF,0xFC,0x04,0xFB,0xBC,0xC0,0x39,0x9F,0x00,0x01, 0x80,0x00,0x5C,0x01,0x00,0x01,0x6B,0x58,0x04,0x54,0x89,0x20,0x42,0x55,0x00,0x01, 0x80,0x00,0x0E,0x05,0x00,0x00,0xA5,0x28,0x04,0x24,0x91,0x20,0x42,0x55,0x00,0x01, 0x80,0x00,0x07,0xE8,0x00,0x00,0xA5,0x29,0x0E,0x43,0xFC,0xC4,0x39,0x95,0x00,0x01, 0x80,0x00,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0xFE,0xE8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01, 0x80,0x00,0xFB,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x01, 0x80,0x00,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x00,0x01, 0x80,0x00,0xF7,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x01, 0x80,0x00,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x01, 0x80,0x01,0xF7,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x01, 0x80,0x00,0xFF,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xE0,0x00,0x01, 0x80,0x01,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x60,0x00,0x01, 0x80,0x01,0xFF,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x20,0x38,0x01, 0x80,0x01,0xF7,0xB7,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x30,0xFE,0x01, 0x80,0x03,0xFB,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x21,0xFF,0x01, 0x80,0x01,0xFD,0xFF,0xC0,0x00,0x40,0x00,0x00,0x13,0x00,0x00,0x03,0x61,0xFF,0x81, 0x80,0x03,0xFF,0xFA,0xE0,0x00,0x40,0x27,0xF8,0x22,0x00,0x00,0x01,0x83,0xFF,0x81, 0x80,0x07,0xFF,0x7F,0xC0,0x3E,0xFE,0x36,0x48,0x67,0xF0,0x20,0x01,0xC1,0xFF,0x81, 0x80,0x07,0xFB,0xDC,0xC0,0x02,0x86,0x06,0x48,0x6C,0x90,0x20,0x01,0x63,0xFF,0x81, 0x80,0x03,0x7E,0xFF,0xC0,0x12,0x84,0x06,0x48,0xA0,0x80,0x20,0x03,0x3B,0xFF,0x81, 0x80,0x0F,0xDF,0xFE,0x00,0x15,0xA0,0x76,0x48,0x24,0xB0,0x20,0x0E,0x1F,0xFF,0x81,0x80,0x03,0xFF,0xBE,0x00,0x0C,0x20,0x16,0x48,0x21,0x80,0x20,0x3F,0x07,0xFF,0x87,0x80,0x0F,0xBF,0xBE,0x00,0x0E,0x30,0x17,0x58,0x02,0x00,0x20,0x3F,0x1F,0xFF,0xC7,0x80,0x3F,0xDF,0xFE,0x00,0x1A,0x70,0x16,0x50,0x2B,0x20,0x20,0x7E,0x1F,0xFF,0xC7,0x81,0xFF,0xFF,0xBF,0x80,0x12,0x48,0x10,0x40,0x49,0x10,0x30,0x1E,0x1F,0xFF,0xC7,0x9F,0xFF,0x3F,0xFF,0xE0,0x30,0x84,0x38,0x00,0x48,0x58,0x00,0x1C,0x1F,0xFF,0xFD,0xDF,0xFF,0x7F,0xBF,0xF0,0x03,0x02,0x47,0xFC,0x4F,0xC0,0x00,0x3C,0x0F,0xFF,0xF5,0xFF,0xFC,0xFF,0xF7,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x0F,0xFF,0x81,0xFF,0xF8,0x7F,0xFB,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0xFE,0x01,0xBF,0xE8,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x03,0xF8,0x01,0x9F,0xA0,0xFF,0xFB,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x01,0x60,0x01,0x80,0x81,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0xFF,0xFD,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};/***********主函数开始********************************************************/ void main(void){Delay400Ms(); //启动等待,等LCD讲入工作状态LCDInit(); //LCD初始化Delay5Ms(); //延时片刻(可不要)while(1){LCDClear();DisplayImage(tmp); //显示图形Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();LCDClear();DisplayListChar(0,1,uctech); //显示字库中的中文数字DisplayListChar(0,2,net); //显示字库中的中文数字DisplayListChar(0,3,mcu); //显示字库中的中文DisplayListChar(0,4,qq); //显示字库中的中文数字Delay400Ms();Delay400Ms();Delay400Ms();Delay400Ms();LCDFlash(); //闪烁效果}。
吴鉴鹰单片机项目项目实战精讲之12864系列基于单片机驱动12864的滚动文字以及漫画图片的显示
吴鉴鹰单片机项目项目实战精讲之12864系列基于单片机驱动12864的滚动文字以及漫画图片的显示备注:相关原理图百度文库可以找到陪伴我长大的小伙伴多啦a梦首先吴鉴鹰让大家来欣赏几张漫画图片,重温一下童年的的美好时光。
这是一只可爱的老虎,可能也就画的比较可爱而已。
这是少儿的偶像喜羊羊鹰哥当时就产生了一个想法,作为一个学电子的专业的学生,能不能用液晶屏将这些图片显示出来呢?于是尝试着用12864显示着,事实证明效果还是可以的。
所以要相信电子行业很多东西,只有你想不到,没有做不到的,要敢想敢做。
下面鹰哥再带大家欣赏一下12864显示的效果:多啦A梦可爱的小老虎小狗显示喜羊羊小猫又像小老虎下面是相应的美女显示程序,只要你愿意做你也可以显示你的女神哦!程序介绍:1/******************************************************2*程序:LCD12664液晶显示原理3*4**这一讲的主要内容:LCD12664液晶显示原理5**功能描述:对滚动汉字和漫画图片的LCD12864的显示6**输入:7**液晶:Proteus元件库—AMPIRE128X64(无字库)8**内容:显示滚动汉字和漫画图片9**输出:10**11**全局变量:12**调用模块:13**14**作者:吴鉴鹰15**日期:14.03.121617备注:有什么错误的地方,欢迎各大烧友指正1819O(∩_∩)O~20*******************************************************/2122#include<AT89X52.h>23#include<intrins.h>24#include<math.h>25//#include"source.h"26#define uchar unsigned char27#define uint unsigned int2829#define LCD_databus P0//LCD12864的8位数据口3031sbit LCD_RS_OUT=P2^2;//LCD_RS_OUT为0---命令;1----数据32sbit LCD_RW_OUT=P2^1;//LCD_RW_OUT为1---写;0---读33sbit LCD_EN_OUT=P2^0;//使能端34sbit LCD_CS1_OUT=P2^4;//片选1低电平有效,控制左半屏35sbit LCD_CS2_OUT=P2^3;//片选1低电平有效,控制右半屏3637sbit KK_KEY1_OUT=P3^0;38sbit KK_KEY2_OUT=P3^1;39sbit KK_KEY3_OUT=P3^2;40sbit KK_KEY4_OUT=P3^3;41sbit KK_KEY5_OUT=P3^4;42sbit KK_KEY6_OUT=P3^5;43sbit KK_KEY7_OUT=P3^6;4445//五个按键控制口4647void CHECK_busy();4849uchar coderrrr_table[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,500x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,510x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,520x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,530x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,540x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF8,560x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0xF8,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,570x00,0x00,0x00,0x0E,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x87,0x13,0x00,0x00,0x00,0x00,0x00,0x00,580x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x03,0xF7,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x30,0x0E,0x30,590x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x78,0x1C,0x78,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,600x00,0x3C,0xFC,0x38,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x79,0xDE,0x71,0xDE,0x00,0x00,0x00,0x00,0x00,0x00,610x00,0x00,0x00,0x00,0x00,0x00,0x79,0x9E,0x79,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x3B,0x9E,0x78,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,630x0F,0xF7,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07, 0xEF,0x37,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,640x00,0x00,0x00,0x00,0x00,0x03,0xDE,0x7B,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0xBC,0xFD,0x80,0x00,0x00,650x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xDE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,660x79,0x8E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C, 0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,670x00,0x00,0x00,0x00,0x00,0x1E,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x0F,0xF0,0x00,0x00,0x00,0x00,680x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,690xC0,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,700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,710x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x20,740x00,0x01,0x9C,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0xC0,0x00,0x99,0x00,0x00,0x30,0x00, 0x03,0x9A,0x00,0x0C,0x23,0x00,0x00,0x00,0x02,0xC6,750x00,0x99,0x80,0x06,0xB4,0x00,0x02,0x21,0x00,0x06,0x33,0x00,0x10,0x80,0x07,0x26,0x00, 0x98,0x00,0x12,0x88,0x00,0x02,0x24,0x80,0x06,0x3F,760x00,0x1F,0xC0,0x05,0x26,0x00,0x15,0x00,0x1C,0x00,0x00,0x03,0x66,0x70,0x17,0x67,0x00, 0x0F,0x00,0x01,0xBE,0x00,0x02,0x00,0x0E,0x70,0x00,770x03,0x7E,0x00,0x17,0xE2,0x00,0x07,0x00,0x07,0x00,0x01,0xA0,0x40,0x18,0x00,0x00,0x06, 0xCE,0x00,0x0E,0x62,0x00,0x07,0x00,0x03,0xA6,0x00,780x9C,0x80,0x12,0x38,0x00,0x06,0x0F,0x80,0x06,0x62,0x00,0x06,0x00,0x03,0x08,0x00,0x84, 0x00,0x10,0xF0,0x00,0x0C,0xFC,0x00,0x06,0x22,0x00,790x1E,0x00,0x05,0x1C,0x00,0x1E,0x00,0x10,0x40,0x00,0x12,0x24,0x80,0x3E,0x42,0x00,0x1E, 0x00,0x01,0x1C,0x00,0x04,0x00,0x10,0x80,0x00,0x02,800x44,0xC0,0x3C,0x43,0x00,0x7F,0xF0,0x01,0x0E,0x00,0x04,0x00,0x11,0x10,0x80,0x02,0x64, 0x80,0x00,0x03,0x00,0x20,0x00,0x00,0xFA,0x80,0x08,810x00,0x13,0x08,0x80,0x02,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x18,0x00, 0x00,0x07,0x00,0x02,0x0C,0x00,0x00,0x00,0x00,0x00,820x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,830x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,840x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,850x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,860x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,870x00,0x00};8889unsigned char code picture_DIS[][64]={/*--调入了一幅图像:E:\学习资料\专业课程相关资料\单片机学习\吴鉴鹰单片机项目详细解析\12864项目系列\LCD12864显示\Proteus_12864程序包\12864美女图片显示\图片\1888-11120210532720.bmp--*/90/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\50406c075de5b_600x.bmp --*/91/*--宽度x高度=128x64--*/920x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,930x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,940x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,950x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,960x00,0x80,0x80,0xF0,0x1C,0x0C,0x06,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x03,970x03,0x02,0x06,0x06,0x0C,0xB8,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,980x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,990x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1000x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x40,0x40,0x40,0x40,0xC0,0x80,0x80,0x00,0x00, 1010x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1020x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1030x00,0x00,0x80,0x80,0xC0,0xC0,0x60,0x20,0x30,0x10,0x18,0x0C,0x0C,0x06,0x06,0x03, 1040x03,0x01,0x01,0x81,0x83,0xC6,0xCC,0xEC,0xF8,0xF8,0xF8,0xF8,0xF8,0x58,0x58,0x78, 1050x78,0x78,0x6C,0x2E,0xAE,0xEB,0x69,0x38,0x3C,0x1C,0x1C,0x1C,0x1C,0x18,0x18,0x18, 1060x18,0x18,0x38,0x38,0x78,0xF8,0xD8,0x90,0x90,0xB0,0x30,0x20,0x20,0x60,0x60,0xC0, 1070xC0,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1080x00,0xFC,0x0F,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFD,0x0F,0x06,0x04, 1090x04,0x04,0x04,0x0C,0x0C,0x08,0x08,0x08,0x0C,0x8C,0x8C,0xCC,0xCC,0x44,0x64,0x64, 1100x24,0x24,0x24,0x24,0x34,0x34,0x34,0x24,0x24,0x24,0x24,0x24,0x64,0x64,0xC6,0xC6, 1110x87,0x87,0x05,0x05,0x00,0xC0,0xE0,0xF0,0xF8,0xF8,0xF8,0x78,0x38,0x1C,0x1C,0x0E, 1120x0E,0x07,0x07,0x83,0x83,0xC1,0xC1,0xE1,0xE0,0xF0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC, 1130xFE,0xFE,0xFE,0xFF,0xFF,0x81,0x00,0x0F,0xFC,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF, 1140x00,0x00,0x00,0x02,0x03,0x03,0xE0,0x78,0x1F,0x01,0x03,0x03,0x06,0x0C,0x1C,0x78, 1150xE0,0xC0,0x01,0x01,0x03,0x06,0x06,0x0C,0x18,0x30,0x70,0xE0,0x80,0x00,0x00,0x00, 1160x00,0x3F,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xE0,0x80,0x80,0x00, 1170x00,0x00,0x00,0xE0,0xF0,0x1C,0x0E,0x86,0xE3,0x31,0x19,0x0C,0x0C,0x06,0x02,0x02, 1180x03,0x03,0x01,0x01,0x01,0xF1,0xFF,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0x40, 1190x40,0xC1,0xC3,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x01,0x00,0xC0,0xF0,0xF8,0xFC, 1200xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1210xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xE0,0x00,0x07,0x3E,0x00,0x00,0x00,0x00,0x3F, 1220x00,0x00,0x00,0x70,0x3C,0x07,0x83,0x80,0x80,0x80,0x80,0xF0,0xB8,0x0C,0x04,0x06, 1230x82,0x83,0x82,0xC3,0xC3,0xC3,0x83,0x82,0x02,0x02,0x06,0x04,0x0F,0xBF,0xFC,0xF0, 1240x00,0x00,0xC0,0xE1,0x31,0x13,0x12,0x12,0x12,0x13,0x13,0xF1,0xE1,0x61,0x31,0x3F, 1250x0E,0x00,0x00,0xFF,0xE0,0x00,0x0C,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1260x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x0E,0x1F,0x37,0x65,0x6C,0x4E,0x4E,0x4C, 1270x40,0xFF,0xFF,0xFF,0xE1,0xF3,0xFF,0xFF,0xFF,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF, 1280xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1290xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x04,0x84,0x84,0x04,0x04,0x84,0x84, 1300x04,0x04,0x04,0x84,0x9F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7B,0xFB,0x7F,0x3F,0x1F,0x0E, 1310x2D,0x7F,0x7F,0x7F,0x77,0x77,0x7F,0x7D,0x0C,0x0C,0x0E,0x1E,0x1B,0x73,0xE1,0xFF, 1320x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x81,0x00,0x00,0x00, 1330x00,0x00,0x00,0x00,0x03,0x07,0x0E,0x1C,0x19,0x33,0x66,0x64,0x4C,0xD8,0xD8,0x90, 1340x90,0xB0,0xB0,0xA0,0x20,0x23,0x3F,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0, 1350x60,0x30,0x38,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xC0,0x00,0x00,0x03,0x07,0x0F,1360x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1370xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x01,0x00,0xE0,0x7F,0x03,0x00,0x00,0x00,0xFF, 1380x80,0x00,0x00,0x00,0x03,0x1E,0x78,0xC0,0x00,0x00,0x00,0x03,0x07,0x0C,0x0C,0x98, 1390xF8,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x98,0xCC,0xFE,0x3F,0x0F,0x03, 1400x00,0x1F,0x38,0x60,0x40,0xC0,0x80,0x80,0x80,0xC0,0xC0,0x63,0x7F,0x1C,0x08,0x08, 1410x08,0x08,0x08,0x0C,0x0C,0x04,0x04,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x08,0x08,0x08, 1420x88,0x89,0xC9,0xC9,0x49,0xC9,0xF9,0x39,0x19,0x09,0x09,0x09,0x08,0x08,0x08,0x08, 1430x08,0x8C,0x8C,0xC0,0x60,0x63,0x37,0x1F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0E,0x1E,0x1C, 1440x3C,0x38,0x78,0x70,0x50,0xF0,0xF0,0xA0,0xE1,0xE1,0x43,0x43,0x43,0xC7,0xC7,0xC7, 1450x8F,0x8F,0x8F,0x9F,0xFF,0xE0,0xC0,0x80,0x1F,0x03,0x00,0x00,0x00,0x00,0x00,0x3F, 1460x3F,0x00,0x00,0x08,0x98,0xF0,0xE0,0x63,0x2F,0x38,0x10,0x18,0x9C,0x8E,0x86,0xC3, 1470xC1,0x40,0x60,0x30,0x30,0x18,0x18,0x0C,0x06,0x03,0x03,0x01,0x00,0x00,0x00,0x00, 1480x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1490x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x3F, 1500x61,0xC1,0xC0,0x80,0x80,0x80,0x81,0x03,0x83,0x82,0x82,0x86,0xC6,0xC6,0x62,0x3F, 1510x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1520x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x02, 1530x02,0x06,0x06,0x06,0x04,0x04,0x05,0x05,0x07,0x07,0x06,0x06,0x06,0x06,0x06,0x06, 1540x06,0x06,0x07,0x07,0x07,0x03,0x02,0x02,0x03,0x03,0x03,0x01,0x01,0x01,0x00,0x00, 1550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 156};157158159unsigned char code picture_DIS_ONE[][64]={160/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\20070708032327421.bmp --*/161/*--宽度x高度=128x64--*/1620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1650x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1660x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1670x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1680x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7C,0xF8,0xEC,0xFF,0xDF,0xCE,0xCE,0xCE, 1690xC0,0xC4,0xEC,0xFC,0xFC,0x6C,0x1C,0xF8,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x80,0x00, 1700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1710x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,1720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1740x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xE0, 1750xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0, 1760xC0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01, 1770x01,0x03,0x0F,0xFF,0xFF,0xFF,0xFB,0xFB,0xBD,0xBC,0x1D,0x1B,0xFF,0xFF,0xFF,0xFE, 1780x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1790x00,0x78,0xFF,0xFF,0xC3,0x83,0xEF,0xF9,0xFB,0xFB,0xFF,0x37,0x3E,0x1C,0xB8,0xAC, 1800xFC,0xFC,0xFC,0xFE,0xFE,0xFE,0xFC,0xFC,0xFC,0x7C,0xFC,0xFC,0xFC,0xFC,0x7C,0xFC ,1810xFA,0xBF,0x7F,0xF7,0xF7,0xE7,0xE7,0xE6,0x76,0x76,0x76,0x76,0x66,0x6E,0x7E,0xFE, 1820xFE,0xFF,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xEF,0x8F,0x0F,0x1F,0x3F,0x7F,0xFB,0xFB, 1830xF3,0xE3,0x03,0x07,0x0F,0x1F,0x3E,0xFE,0xFD,0xF9,0xF3,0x83,0x07,0x0F,0x1F,0x7F, 1840xFF,0xFD,0xFB,0xE7,0x0F,0x3F,0xFF,0xFE,0xFE,0xFC,0xFC,0x1C,0x1C,0x1C,0x3C,0x7E, 1850xFE,0x7E,0x0F,0x9F,0xBF,0xFF,0xFF,0xFB,0xC3,0xE7,0xF7,0xFE,0xFF,0x7F,0x3F,0x1F, 1860x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0x60, 1870x38,0x3C,0x3E,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x33,0x39,0x18,0x00,0x00,0x00, 1880x80,0x83,0x01,0x01,0x01,0x01,0xF1,0xF9,0xFD,0xFC,0xFC,0xFF,0xFF,0xFC,0xFE,0xFF, 1890xF8,0x6C,0x0C,0x40,0xC1,0xC1,0xC1,0xE6,0xFF,0xFF,0xFD,0xFD,0xEC,0xEC,0x70,0x78, 1900x3D,0x3F,0x1F,0x00,0x00,0x03,0x07,0x3F,0xFF,0xFF,0xFF,0xFE,0xF8,0x00,0x00,0x03, 1910x1F,0xFF,0xFF,0xFC,0xF8,0x00,0x00,0x01,0x03,0xFF,0xFF,0xFF,0x0E,0x00,0x00,0x00, 1920xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0xEF,0xFF,0x3F,0x07,0x00,0x00,0x00,0x00,0x03, 1930x0F,0xFF,0xFF,0xF9,0xE1,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00, 1940x00,0x00,0x00,0x00,0x04,0x04,0x04,0x24,0x34,0x14,0x1F,0x1F,0x3D,0x3D,0xF7,0xE3, 1950xE4,0xE0,0xE0,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xBE,0x3E,0x5E,0xBC,0xAE,0xAF, 1960xF7,0xF3,0xF9,0x58,0x58,0xC8,0xC8,0xE9,0xF9,0xFB,0xFB,0xFB,0xFB,0x9B,0x1B,0x01, 1970x00,0x00,0x03,0x03,0x87,0xA7,0xB6,0x67,0x67,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x40, 1980x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x3F,0x1F,0x1F,0x0F,0x00,0x00,0x00, 1990x00,0x0F,0x0F,0x0F,0x03,0x00,0x00,0x00,0x04,0x07,0x87,0x80,0x80,0x00,0x00,0x03, 2000x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,2010xFC,0xFF,0xFF,0x1F,0x0F,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2020x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xBF, 2030xB7,0xB3,0xB0,0xB0,0xF0,0xF8,0xFC,0xDF,0xFF,0xF1,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF, 2040xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0xBF,0xBF,0xDF,0xFF,0x6F,0x77,0x3B,0x19,0x19,0x0C, 2050x6C,0xEC,0xE6,0xE6,0xC7,0xCF,0x8F,0x8F,0x9F,0xBE,0x9C,0x81,0x81,0x81,0x81,0x80,2060x00,0x00,0xE0,0xE0,0xF8,0x7E,0x3E,0x3E,0x38,0x38,0x38,0x30,0xF0,0xF0,0xF8,0xF8, 2070xF8,0xF8,0xD8,0xDC,0xDC,0xDE,0x1E,0x0E,0xFE,0xFF,0xFF,0x67,0x67,0xE7,0xCF,0x1E, 2080x1C,0x3E,0x36,0x7E,0xFE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEF,0x6F,0x77,0x77,0xB8,0x98, 2090x03,0x0F,0xBF,0xFC,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 2100x38,0xFC,0xFC,0xFE,0xFE,0xFE,0x3E,0xAE,0x8E,0x8F,0x0F,0x0F,0x0F,0x0F,0xCF,0xEF, 2110xE7,0x7F,0x79,0x3C,0x1C,0x3D,0x39,0x19,0x0F,0x0F,0x08,0x0E,0x07,0x0D,0x07,0x07, 2120x07,0x07,0x07,0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2130x00,0x00,0x01,0x03,0x0F,0x1F,0x3F,0x7D,0xFF,0xFF,0xDF,0xDD,0xDD,0xDD,0xCD,0xEE, 2140x6E,0x60,0x1F,0x3F,0xFD,0xFC,0xFC,0xBC,0x18,0xF8,0xF8,0xF8,0xF8,0xFF,0xFF,0x6F, 2150x8F,0xCF,0xCE,0xCE,0x0E,0x8E,0xC0,0xFE,0xFF,0xFF,0x3F,0x01,0x03,0x03,0x01,0xC0, 2160xC0,0xE0,0xE0,0x70,0xF0,0xF1,0x3F,0x3F,0x3F,0x3F,0x1F,0x1E,0x1E,0x1F,0x3F,0x3B, 2170x31,0xC0,0xFF,0xFF,0xFF,0x7C,0x31,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 2180x00,0x00,0x01,0x01,0x03,0x03,0x07,0x07,0x0F,0x0E,0x0E,0x0E,0x0F,0x0F,0x0F,0x03, 2190x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2200x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2210x00,0x38,0x7C,0x7E,0x7F,0x67,0x73,0x7B,0xFB,0xDF,0xCF,0xC3,0xE1,0xF1,0xF1,0xF0, 2220xC0,0xC0,0xC0,0xE6,0xFF,0xFF,0x7F,0x73,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x03, 2230x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x03, 2240x03,0x03,0x07,0x0F,0x0F,0x1D,0x19,0x18,0x1F,0x1F,0x1F,0x3B,0x39,0x38,0x38,0x1C, 2250x1C,0x1F,0x0F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 226};227228unsigned char code picture_DIS_TWO[][64]={229/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\u=2035217269,1567906622&fm=21&gp=0.bmp--*/230/*--宽度x高度=128x64--*/2310x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x18,0x1C,0x1E,0x1F,0x1F, 2320x1E,0x1F,0x1F,0x1E,0x1E,0x0C,0x0C,0x18,0x10,0x10,0x10,0x10,0x10,0x18,0x88,0x8C, 2330x84,0x84,0x42,0x42,0x42,0x42,0xE2,0xC2,0x0A,0x0A,0x0A,0x0E,0x0C,0x7C,0x3C,0x08, 2340x08,0x88,0xD0,0x70,0x60,0x60,0x40,0x40,0x40,0x40,0xC0,0x80,0x80,0x00,0x00,0x00, 2350x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2360x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2370x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2380x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2390x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x1A,0x12,0x36,0x24,0x64,0x48,0xC0, 2400x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x81,0x81,2410x01,0x03,0x02,0x06,0x06,0x07,0x01,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x38,0x0E, 2420x03,0x01,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x06,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFE, 2430x04,0x0C,0x3C,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2440x00,0x00,0x00,0x00,0x00,0xE0,0xB8,0x0C,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 2450x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2460x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2470x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 2480x80,0x81,0x83,0x86,0x84,0xBC,0xF8,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x19, 2490x18,0x03,0x07,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x8C,0x98,0xF0,0xE0, 2500x40,0x80,0x87,0x0F,0x0F,0x07,0x07,0x83,0x80,0xC3,0x43,0x43,0x60,0x61,0x21,0x31, 2510x10,0x18,0x0C,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2520x00,0x00,0x00,0x00,0x00,0x01,0x07,0x0C,0x18,0xF7,0xE7,0xCC,0x18,0x30,0xE0,0x80, 2530x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2540x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0x4F, 2560x6F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0xBF,0xBE,0x3E,0x3E,0x3E,0x3E, 2570x3E,0x3E,0x3E,0xBE,0x9E,0x9E,0x9F,0x5F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x0F,0x1F, 2580x13,0x30,0x21,0x21,0x21,0x21,0x21,0x21,0x20,0x20,0xA0,0xA0,0xB0,0x90,0x90,0x90, 2590x90,0x90,0x98,0x88,0x88,0x88,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 2600x08,0x08,0x08,0x18,0x10,0x10,0x18,0x3C,0x26,0x23,0x63,0x63,0x60,0xF0,0xBC,0x07, 2610x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x07,0x0F,0x78,0xE0, 2640x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x7B,0x3B,0x81,0xF8,0x1C,0x06, 2650x02,0x02,0x7B,0xFD,0xFC,0xFE,0xFE,0x7E,0x7E,0x3E,0x1E,0x00,0x00,0x00,0x00,0x00, 2660x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x03,0x03,0x07,0x07,0x07,0x07,0x07, 2670x1F,0x3F,0x3F,0x3F,0x07,0x07,0x3F,0x3F,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00, 2680x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0E,0x0E,0x0E,0x04,0x00,0x00,0x00,0x01,0x03, 2690x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2710x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2720x00,0x01,0x03,0x06,0x04,0x04,0x8C,0xC8,0x48,0x78,0x30,0x0C,0x07,0x83,0x80,0x00, 2730x00,0x00,0x03,0x07,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80, 2740x80,0xE0,0x7E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2750x00,0x00,0x00,0x00,0x00,0x01,0x02,0x06,0x04,0x0C,0x08,0x18,0x30,0x20,0x20,0x40, 2760x40,0xC0,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x02,0x06,0x06,0x0E,0x0E,2770x0E,0x0C,0x0C,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x06,0x04,0x04,0x0C,0xCC,0xC8, 2780xC8,0x88,0x98,0x30,0x20,0x60,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2790xC0,0xE0,0xB0,0xF0,0x50,0x78,0xA8,0x98,0xD8,0x58,0x58,0x58,0x50,0xF0,0xA0,0x20, 2800x30,0x30,0x18,0x0C,0x06,0x03,0x23,0x70,0x30,0x30,0x00,0x00,0x03,0x83,0xC3,0x43, 2810x40,0x60,0x30,0x30,0x10,0x18,0x08,0x0C,0x04,0x06,0x02,0x02,0x03,0x01,0x01,0x83, 2820xC2,0xC2,0xC2,0xC6,0xCE,0x5A,0x72,0x62,0x46,0xC6,0x86,0x84,0x04,0x04,0x04,0x34, 2830x74,0x64,0x1C,0x7C,0x44,0xC6,0x26,0x7A,0xFA,0xDE,0xF6,0x82,0x02,0xE2,0x93,0x01, 2840x01,0x01,0x01,0x00,0x81,0xF1,0x19,0x0F,0x05,0x03,0x03,0x03,0x03,0x02,0x02,0x02, 2850x02,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x84,0xC4,0xCC,0xC8,0x48,0xD8,0xF0,0x61, 2860x41,0x41,0x41,0x80,0x80,0xC0,0x40,0xC1,0x81,0x83,0x06,0x0C,0x08,0x18,0x70,0xC0, 2870xC3,0xC7,0xC5,0xCE,0xDA,0xD1,0xF1,0xF8,0xEC,0xE4,0xE6,0xC2,0xC2,0xC3,0xC3,0xE2, 2880xE0,0xE0,0xF0,0xD8,0xD8,0xC8,0xCC,0xC4,0xC4,0xC4,0xC6,0xC3,0xC1,0xC1,0xC0,0xC0, 2890xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC6,0xDF, 2900xD7,0xDF,0xDF,0xF9,0xF0,0xE0,0xFE,0xE3,0xE1,0xE1,0xE0,0xE1,0xE1,0xE1,0xE0,0xF0, 2910xD8,0xCC,0xC6,0xC3,0xC1,0xC1,0xC0,0xC0,0xC0,0xC0,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1, 2920xC1,0xC1,0xC1,0xC1,0xC1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, 2930xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xCF,0xC9,0xDE,0xDB,0xD0,0xDF,0xD1,0xD0,0xF0, 2940xF0,0xF0,0xFF,0xF1,0xF0,0xF0,0xF0,0xF0,0xD0,0xD0,0xD8,0xCC,0xC2,0xC3,0xC1,0xC0, 295};296297298unsigned char code picture_DIS_THREE[][64]={299/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\picture1240x3205580988506.bmp--*/300/*--宽度x高度=128x64--*/3010x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,3020x00,0x00,0x00,0xC0,0x60,0x20,0x10,0x10,0x18,0x08,0x08,0x08,0x08,0x04,0x04,0x04, 3030x04,0x04,0x08,0x08,0x08,0x08,0x18,0x90,0xF0,0xC0,0x00,0x00,0x3E,0x62,0x82,0xE1, 3040x81,0x81,0xC1,0x22,0x82,0x82,0xC6,0x6C,0x38,0x00,0x80,0x40,0x40,0x20,0x00,0x30, 3050x18,0x08,0x04,0x04,0x00,0x04,0x04,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,3060x02,0x01,0x01,0x01,0x02,0x02,0x06,0x04,0x06,0x02,0x02,0x02,0x04,0x06,0x0D,0x08, 3070x08,0x09,0x03,0x0A,0x0C,0x0C,0x18,0x30,0x20,0x20,0x20,0x20,0x40,0x80,0x80,0x80, 3080x80,0x80,0xC0,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0x3F,0x00,0x00, 3090x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,3100x00,0x00,0x03,0x06,0x0E,0x0C,0x1C,0x18,0x18,0x18,0x18,0x18,0xD8,0x38,0x38,0x58, 3110x58,0x5C,0x3C,0x1C,0x0E,0x0A,0x07,0x03,0x03,0x00,0x02,0x02,0x02,0x04,0x03,0x07,3120x07,0x0E,0x0A,0x0B,0x0B,0x13,0x96,0xD8,0xF8,0x30,0x37,0x18,0x90,0x90,0x90,0x90, 3130x90,0x90,0x20,0x00,0x20,0x10,0x10,0x00,0x00,0x10,0x18,0x08,0x84,0x84,0x84,0x44, 3140x46,0x44,0x4C,0x48,0xC8,0x88,0x88,0x0C,0x08,0x08,0x18,0x10,0x10,0x10,0xF0,0x40, 3150x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03, 3160x03,0x07,0x07,0xCF,0xFF,0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x03,0x01,0x00,0x00,0x00, 3170x80,0xC0,0xE0,0x60,0x30,0x30,0x18,0x38,0xFC,0xFC,0xFC,0xFC,0xFC,0x3C,0x3C,0x3C, 3180x78,0xF0,0x80,0x80,0x00,0x00,0xE0,0x30,0x1C,0x06,0x02,0x01,0x01,0x00,0x00,0x00, 3190x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x90,0x90,0xD8,0xC8,0xC8, 3200x18,0x10,0xF8,0x7C,0xDE,0x67,0x3B,0xCC,0x36,0x1A,0x87,0xC3,0xFF,0xFF,0xFF,0x1F, 3210xC7,0x33,0x8F,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x1E,0x21,0x40,0x5C,0x9E, 3220xBE,0xBE,0xBE,0x9A,0xDE,0x40,0x61,0x33,0x1E,0x00,0x00,0x00,0x80,0xF0,0x7F,0x9E, 3230x80,0xC0,0x7F,0x30,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3240x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1D,0x16,0x30,0xE0,0x00,0x00,0x00,0x00,0x00, 3250x0F,0x09,0x08,0x08,0x08,0x08,0x08,0x08,0x0C,0x0F,0x07,0x07,0x07,0x02,0x02,0x06, 3260x04,0x0C,0x08,0x09,0x09,0x1D,0xFB,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3270x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x02,0x02,0x02,0x32, 3280xFE,0xFE,0xEF,0x18,0xE3,0x00,0xFF,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0x0F,0xC0,0x78, 3290x07,0x1F,0x1F,0x3F,0x1F,0x1E,0x0F,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 3300x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x8E,0x03,0x01,0x00, 3310x00,0x00,0x00,0x00,0x03,0x02,0x04,0x00,0x04,0x04,0x08,0x00,0x00,0x00,0x00,0x00, 3320x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC4,0x4E,0x3B,0x00,0x00,0x00,0x00,0x00, 3330x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3340x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x04,0x04,0x04,0x04, 3350x08,0x00,0x08,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x98,0x08,0x08, 3360x0B,0x0F,0xFF,0xDC,0x71,0x43,0x47,0x4E,0x5F,0x5F,0x5F,0x5F,0x5F,0x98,0x0F,0x00, 3370x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x23,0x41,0x80,0xBC,0xBC,0xBE,0x3E,0xBC,0xBC, 3380x9C,0x41,0x63,0x3E,0x00,0x00,0x00,0x00,0x80,0xF0,0x7F,0x9C,0x83,0x46,0x44,0x38, 3390x18,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x08,0x04,0x00,0x00,0x00,0x00,0x00, 3400x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x11,0x1B,0x06,0x00,0x00,0x00,0x00,0x00,0x00, 3410x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3420x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3430x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x1C,0x30, 3440xE0,0x30,0x18,0x89,0x8F,0x06,0x04,0x04,0xE4,0x90,0x10,0x04,0x04,0x04,0x05,0x89, 3450x99,0x71,0x03,0x0C,0x08,0x00,0x08,0x08,0x08,0x18,0x10,0x10,0x10,0x10,0x08,0x08, 3460x08,0x08,0x18,0x08,0x0C,0x04,0x04,0x02,0x03,0x02,0x03,0x00,0x00,0x00,0x00,0x00, 3470x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x40,3490x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3500x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3510x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3520x07,0x1F,0x31,0x40,0x40,0x7D,0x63,0x81,0x81,0x81,0x83,0x47,0x79,0x11,0x31,0x21, 3530x61,0x42,0xC2,0x82,0x84,0x04,0x04,0x04,0x08,0x08,0x18,0x90,0x60,0x40,0x40,0x40, 3540xC0,0x40,0x20,0x40,0x40,0x40,0x80,0x80,0xC0,0xC0,0x40,0x20,0x20,0x20,0x00,0x20, 3550x20,0x20,0x18,0x1C,0x1C,0x3C,0x7C,0xFC,0xFC,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFC, 3560xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3570x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3580x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3590x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3600x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3610x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00, 3620x03,0x06,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x1F,0x7F,0xFF,0xFF,0x7F,0x3F,0x1F, 3640x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 365366};367368369unsigned char code picture_DIS_FOUR[][64]={370/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\u=3745094681,1433150117&fm=21&gp=0.bmp--*/371/*--宽度x高度=128x64--*/3720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3740x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3750x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x20,0x30,0x10,0x30,0x30,0x20, 3760x20,0x60,0x40,0x40,0x60,0x40,0x40,0x40,0x40,0x60,0x20,0x20,0xB0,0x90,0xD8,0xC8, 3770xC8,0x48,0x64,0x64,0x64,0xE6,0xA2,0xE2,0xB2,0xF2,0xF2,0xF2,0xF2,0xB2,0xB2,0xB2, 3780xB2,0xB2,0xB6,0xF4,0xF4,0x6C,0x28,0x08,0x08,0x0C,0x04,0x04,0x02,0x82,0xC2,0x42, 3790xC3,0xC1,0x01,0x01,0x01,0x83,0xE2,0x3E,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3800x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3810x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3820x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,。
12864液晶图像显示图文教程——最全版
由图可以看到水平坐标一个单位是两字节(即 16 位 D15~D0),X 地址会自动加 1,是直接加一个单位 (即两字节 16 位),比如 0001(也即 0X80+000X80+01),从第一行第一列跳到第一行第二列。 代码: void display_image(uchar *p) { uchar i,j; write_cmd(0x34);//扩充指令集动作 write_cmd(0x34);//关绘图显示功能 /*上半屏显示设置*/ for(i=0;i<32;i++)//上半屏 { write_cmd(0x80+i);//垂直地址 write_cmd(0x80); //水平地址 for(j=0;j<16;j++) { write_data(*p);//连续写入 16 个字节 p++; } } /*下半屏半屏显示设置*/ for(i=0;i<32;i++)//下半屏 { write_cmd(0x80+i);//垂直地址 write_cmd(0x88);//水平地址 for(j=0;j<16;j++)//连续写入 16 个字节 { write_data(*p); p++; } } write_cmd(0x36);//开绘图显示 write_cmd(0x30);//回到基本指令集 } 源程序: #include <reg52.h> #include "12864.h" X 坐标(水平)方向以 2 字节 Byte 为单位,Y 坐标(垂直) 方向以 1 位 Bit 为单位,先连续写入垂直与水平坐标,再写入 两字节数据到 GDRAM。 这里是这样进行的:i=0 时,j=0,1 时,写入两字节到垂直 (0X80+00)水平(0X80+00)这格(D15~D0)里;然后 X 坐标地址自增 1, 地址变为垂直 (0X80+00) , 水平 (0X80+01) 这格,在 j=2,3 时写入两字节,………一直到垂直(0X80+00) 水平(0X80+07)这格,在 j=14,15 时写入两字节,此时循环 for(j=0;j<16;j++)结束跳出,刚好第一行 128 位写完数据;然后 i++,开始写第二行……
带字库12864超详细扩展操作,写自定义字符,画图,画直线,画圆,读取数据等操作
在此指出,这一篇文章出至网络上zhaoshan413之手,感谢他的无私贡献,让大家轻松玩转带字库12864!~~[p=30, 2, left]之前说学完12864字库液晶后和大家交流一下心得,一直没有时间,今天整理一下发上来,希望对想学习的朋友能有点帮助…首先说明一点,本人也是初学者,自感水平不高,若有不足及不对之处,望情指正…以下以并行口传输为例,别的还不会,呵呵![/p][p=30, 2, left]先传一下ST7920的芯片说明书:[/p][p=30, 2, left]/bbs/redirect.php?tid=7676&goto=lastpo st#lastpost[/p][p=30, 2, left]ST7920(字库)12864.pdf(2010-12-01 10:46:58, Size: 1.65 MB, Downloads: 1689)[/p][p=30, 2, left]一、首先说一下关于驱动函数的书写,这些是液晶显示的基础一般包括四个函数:1、写命令函数;2、写数据函数;3、读状态函数;4、读数据函数;这四个函数并不是必须全部写的,具体要看你实现的功能,如果只是单纯的显示汉字和字符,写命令、写数据、读状态这三个函数就够了,如过你还需要进行一些绘图的操作,那读数据函数也必须书写。
另外关于读状态函数,其实也就是用于判忙操作,我看郭天祥的书里面是这样说的:原则上每次对控制器进行读写操作之前,都必须进行读写检测,由于单片机的操作速度慢于液晶控制器的反应速度,因此可不进行读写检测,或者只进行简短的延时即可。
因此,读状态函数也可以不写,只用简短的延时函数替换即可。
1、写操作的编写:首先看一下时序图[/p][p=30, 2, left]时序.JPG[/p][p=30, 2, left]由图可见操作很简单:1>RS=1(写数据操作);或者RS=0(写命令操作);2>RW=0;//指明为写操作3>E=1;4>DB=data;//data为你要写入的命令或数据值5>E=0;[/p][p=30, 2, left]以下是我的驱动函数,仅供参考:[/p][p=30, 2, left]CODE:/********************************液晶端口定义**************************/#define lcd_data P0 //数据口sbit RS = P2^4; //选择寄存器(并行) 0:指令寄存器1:数据寄存器;sbit RW = P2^5; //读写控制脚(并行) 0:写入 1:读出sbit E = P2^6; //读写数据启始脚(并行)sbit PSB = P2^1; //串并方式选择引脚,0为串行模式,1为8/4位数据口模式sbit RST = P2^3; //复位引脚//******************************************************* *//延时函数//******************************************************* *void delay(unsigned int k){unsigned int i;unsigned char j;for(i=0;i<k;i++){for(j=0;j<10;j++);}}//******************************************************* *//延时1ms函数//******************************************************* *void delay_ms(unsigned int k)//延时0.994us,晶振12M{unsigned int x,y;for(x=k;x>0;x--)for(y=121;y>0;y--);}//******************************************************* *//写命令函数//******************************************************* *void LcdWcom(unsigned char WCom){delay(1);RS=0; //指明操作对象为指令寄存器RW=0; //指明为写操作E=1;lcd_data=WCom; //将命令写入总线E=0;}//******************************************************* *//写数据函数//******************************************************* *void LcdWdata(unsigned char WData){delay(1);RS=1; //指明操作对象为数据寄存器RW=0; //指明为写操作E=1;lcd_data=WData; //将数据写入总线E=0;}[/p][p=30, 2, left]二、初始化操作[/p][p=30, 2, left]以8位并行操作为例,操作流程图如下:[/p][p=30, 2, left]初始化.JPG[/p][p=30, 2, left]初始化操作如下:[/p][p=30, 2, left]1>芯片上电;[/p][p=30, 2, left]2>延时40ms以上;[/p][p=30, 2, left]3>复位操作:RST出现一个上升沿(RST=1;RST=0;RST=1;);[/p][p=30, 2, left]4>功能设定;[/p][p=30, 2, left]5>延时100us以上;[/p][p=30, 2, left]6>再次进行功能设定;[/p][p=30, 2, left]7>延时37us;[/p][p=30, 2, left]8>显示开关控制;[/p][p=30, 2, left]9>延时100us 以上;[/p][p=30, 2, left]10>清除显示;[/p][p=30, 2, left]11>延时10ms以上;[/p][p=30, 2, left]12>进入点设置;[/p][p=30, 2, left]13>初始化结束;[/p][p=30, 2, left]这里我遇到了一个小问题,我的液晶按照这个顺序进行初始化结果不正确,无法显示,最后我把调整了一下就可以了,调整后的顺序为:清除显示进入点设置显示开关控制,不知道是什么原因,知道的告诉我一声…[/p][p=30, 2, left]CODE://******************************************************* *//显示初始化函数//******************************************************* *void Display_Init(void){delay_ms(45); //延时45msPSB=1; //8位并行口//复位操作RST=1;delay(1);RST=0;delay(1);RST=1;delay(1);//功能设定LcdWcom(0x30); //设置为8位并行口,基本指令集delay(10);LcdWcom(0x30); //再次设置为8位并行口,基本指令集delay(5);// //显示开关控制// LcdWcom(0x0c); //游标显示关,正常显示,整体显示开// delay(10);//清除显示LcdWcom(0x01);delay_ms(12); //延时12ms//进入点设置LcdWcom(0x06); //设置为游标右移,DDRAM位地址加1,画面不移动delay(5);LcdWcom(0x0C); //开显示}[/p][p=30, 2, left]三、显示基本的字符和汉字[/p][p=30, 2, left]1、要想显示汉字或字符,首先要确定显示的位置,看看芯片说明书上关于屏幕地址的分配:[/p][p=30, 2, left]DDRAM位址.JPG[/p][p=30, 2, left]由于此液晶为128*64,即是横向128个点,竖向64个点,由于该液晶控制器支持的字符为8*16,汉字为16*16,因此只能显示四行,如果是汉字,为每行显示8个,如果是字符,每行显示16个。
12864液晶显示模块概述
TC
13,000
Address setup time
TAS
1,500
Address hold time
TAH
1,500
Data setup time
TDDR
1,000
Unit KHz UNIT
ns ns ns ns ns ns ns
ns ns ns ns
使用说明书
Data hold time Enable pulsewidth Enable rise/fall time
2、 “RE”为基本指令集与扩充指令集的选择控制位元,当变更“RE”位元后,往后的指令集将维 持在最后的状态,除非再次变更“RE”位元,否则使用相同指令集时,不需每次重设“RE”位元。
72us
读出 RAM
从 内 部 RAM 读 取 资 料
的值
1 1 D7 D6 D5 D4 D3 D2 D1 D0 (DDRAM/CGRAM/IRAM/GDRAM)
72us
指令表—2:(RE=1:扩充指令集)
指令
指令码
RS RW DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
说明
执行时间 (540KHZ)
8 RS
H/L H: Data L: Instruction Code
9 NC
- 空脚
10 /RST
H/L Reset Signal 低电平有效
注K
背光源负极(LED-OV)
引脚 名称 11 DB0 12 DB1 13 DB2 14 DB3 15 DB4 16 DB5 17 DB6 18 DB7 19 NC 20 NC
A
方向 说明 I/O 数据 0 I/O 数据 1 I/O 数据 2 I/O 数据 3 I/O 数据 4 I/O 数据 5 I/O 数据 6 I/O 数据 7
12864图片显示
/************************************/ /* */ /* 12864图像显示程序*/ /* */ /************************************/#include<reg52.h>#include"qq.h"#define uchar unsigned char#define uint unsigned intsbit lcdrs=P2^4;sbit lcdrw=P2^5;sbit lcden=P2^6;/******************************函数名:delayus()功能:延时k微秒参数:k返回值:无*******************************/void delayus(uint k){while(k--);}/******************************函数名:delayms()功能:延时i微秒参数:i返回值:无*******************************//*void delayms(uint i){uchar j;for(i;i>0;i--)for(j=125;j>0;j--);}*//******************************函数名:lcd_wrcom()功能:12864写命令参数:lcd_com返回值:无*******************************/void lcd_wrcom(char lcd_com){uchar temp;lcdrs=0;lcdrw=1;do //12864判忙{lcden=1;temp=P0;delayus(6);lcden=0;}while(temp & 0x80);//不忙则退出循环lcdrw=0;P0=lcd_com; //写命令lcden=1;delayus(6);lcden=0;}/******************************函数名:lcd_wrdata()功能:12864写数据参数:lcd_dat返回值:无*******************************/void lcd_wrdata(char lcd_dat){uchar temp;lcdrs=0;lcdrw=1;do //12864判忙{lcden=1;temp=P0;delayus(6);lcden=0;}while(temp & 0x80); //第八位为判忙标志位lcdrs=1;P0=lcd_dat; //写数据lcden=1;delayus(6);lcden=0;}/******************************函数名:init_12864()功能:12864初始化参数:无返回值:无*******************************/void init_12864(){delayus(100); //延时100微秒lcd_wrcom(0x30);//功能设定delayus(5000);lcd_wrcom(0x02);//地址归位delayus(100);lcd_wrcom(0x0e);//显示状态delayus(100);lcd_wrcom(0x1c);//游标和显示的移位delayus(100);lcd_wrcom(0x01);//清屏delayus(5000); //延时5毫秒}/******************************函数名:clearGDRAM()功能:清除GDRAM参数:无返回值:无*******************************/void clearGDRAM(){uchar i,j,k;lcd_wrcom(0x34); //打开扩展指令集i = 0x80; //液晶纵向首地址0x80for(j = 0;j < 32;j++) //0x80,0x90两个汉字行共32个纵点(小方格){lcd_wrcom(i++); //纵向地址增1lcd_wrcom(0x80);for(k = 0;k < 32;k++)//横向80-8f(16个汉字)或90-9f每行32个字节lcd_wrdata(0x00);//每个字节都清零}}//也可以80,90各汉字行分开清零原理一样/* i = 0x80; //80行清零for(j = 0;j < 16;j++) //每行16个纵电(即16行小方格){lcd_wrcom(i++);lcd_wrcom(0x80);for(k = 0;k < 32;k++)//横向80-8f(16个汉字即16列){lcd_wrdata(0x00);}}i = 0x90; //90行清零90-9Ffor(j = 0;j < 16;j++){lcd_wrcom(i++);lcd_wrcom(0x80);for(k = 0;k < 32;k++){lcd_wrdata(0x00);}}*/lcd_wrcom(0x30); //返回基本指令集}/*******************************************函数名称:Draw_TX功能:显示一个16*16大小的图形参数:Yaddr--Y地址Xaddr--X地址dp--指向图形数据存放地址的指针返回值:无********************************************/void Draw_TX(uchar Yaddr,uchar Xaddr,const uchar *p){uchar j;uchar k=0;lcd_wrcom(0x34); //使用扩展指令集,关闭绘图显示for(j=0;j<16;j++){lcd_wrcom(Yaddr++); //Y地址16个纵点lcd_wrcom(Xaddr); //X地址横向地址可自增lcd_wrdata(p[k++]); //写入一个字(2字节)lcd_wrdata(p[k++]);}lcd_wrcom(0x36); //打开绘图显示lcd_wrcom(0x30); //回到基本指令集模式}/******************************函数名:draw_128*64()功能:显示128*64全屏图画参数:数组指针*point返回值:无*******************************/void draw_12864(uchar code *point){uchar i,j,k;lcd_wrcom(0x34); //打开扩展指令集i = 0x80; //分4屏写for(j = 0;j < 16;j++) //第一屏80-87(8个汉字宽度) {lcd_wrcom(i++); //纵向16个纵点lcd_wrcom(0x80); //横向地址可自增for(k = 0;k < 16;k++) //横向16个字节lcd_wrdata(*point++);}i = 0x90; //第二屏90-97for(j = 0;j < 16;j++){lcd_wrcom(i++);lcd_wrcom(0x80);for(k = 0;k < 16;k++)lcd_wrdata(*point++);}i = 0x80; //第三屏88-8ffor(j = 0;j < 16;j++){lcd_wrcom(i++);lcd_wrcom(0x88);for(k = 0;k < 16;k++)lcd_wrdata(*point++);}i = 0x90; //第四屏98-9ffor(j = 0;j < 16;j++){lcd_wrcom(i++);lcd_wrcom(0x88);for(k = 0;k < 16;k++)lcd_wrdata(*point++);}/* uchar i,j,k; //上下分两屏写(典型用法) lcd_wrcom(0x34); //打开扩展指令集i = 0x80; //80-87and90-97for(j = 0;j < 32;j++){lcd_wrcom(i++);lcd_wrcom(0x80);for(k = 0;k < 16;k++){lcd_wrdata(*point++);}}i = 0x80; //88-8f and 98-9ffor(j = 0;j < 32;j++){lcd_wrcom(i++);lcd_wrcom(0x88);for(k = 0;k < 16;k++){lcd_wrdata(*point++);}}*/lcd_wrcom(0x36); //打开绘图显示lcd_wrcom(0x30); //回到基本指令集}/******************************函数名:main()功能:调用显示图片参数:无返回值:无*******************************/void main(){/*uchar laba[]= //喇叭图代码{0x00,0x00,0x00,0xC0,0x01,0x48,0x02,0x44,0x04,0x52,0xF8,0x49,0x88,0x49,0x88,0x49, 0x88,0x49,0x88,0x49,0xF8,0x49,0x04,0x52,0x02,0x44,0x01,0x48,0x00,0xC0,0x00,0x00 };*/clearGDRAM(); //清除GDRAMlcd_wrcom(0x01); //清除DDRAMinit_12864(); //液晶初始化draw_12864(qq1); //qq图128*64// Draw_TX(0x86,0x96,laba);//喇叭图16*16while(1);}/****************************************************************************** *************感言:①、12864实际上只有80-8f和90-9f两行工艺上把(80-87、90-97)和(88-8f、98-9f)之间切下来做成两部分接在下半屏即有4行(80-87、90-97、88-8f、98-9f),所以清屏和写数据的时候要特别注意!②、画图的时候横向是算字节的,而纵向则算像素(小方格)。
12864显示文字+图像
引用12864液晶原理分析3他山之石2010-07-21 20:52:05 阅读7 评论0 字号:大中小小峰的12864液晶原理分析3一、ST7920控制IC的LCD12864实现反白显示从使用手册上可知,扩展指令里的0x03+行号即可实现反白对应行。
但是ST7920 控制器的128×64 点阵液晶其实原理上等同256×32 点阵,第三行对应的DDRAM 地址紧接第一行;第四行对应的DDRAM 地址紧接第二行。
所以128×64 点阵的液晶执行反白功能时实用意义不大,因为用户对第一行执行反白显示操作时,第三行必然也反白显示;第二行反白,第四行也必然反白。
其实还是有办法做到单行反白的,解决方法就是混用图形显示和字符显示。
其理论支持在于:在ST7920中,字符显示的DDRAM和图形的GDRAM是相互独立的,而最后显示到液晶上的结果,是两个RAM中数据的异或。
具体来说:假如某个点上,绘图RAM的没有绘图(数据为0),而字符RAM上有点阵(数据为1),那么异或的结果就是1,也就是说正常显示字符;当字符上RAM没有点阵的时候,异或的结果是0,自然也就不显示了。
假如该点上绘图RAM绘图了(数据为1),当字符RAM上有点阵(数据为1时),异或的结果为0,效果就是反白显示;如果字符RAM没有点阵(数据为0时),异或结果为1,效果就是显示绘图的背景。
所以,如果要在某个地方反白显示,那么就在该点绘图并且写字,如果要取消反白,就重新用全0擦掉那个地方的绘图!这样一来可以实现任何地方、任意大小的反白显示,反而比原指令中的单行反白的功能更好更强大。
二、对于整屏既有图象又有文本,则可以用两种方式实现:1、首先文本DDRAM写入要写的字符,其余全部空格(即0X00),然后再在没有字符的地方(即非点亮的晶格中,0X00)绘入图象。
DDRAM与GDRAM异或后就可以整屏实现图象与文本。
参见程序实例1。
12864显示图形和文字
/*******************************************************/
void lcd_out(unsigned char send_byte)
/*******************************************************/
void lcd_control()
{
WR_control(0x30);
WR_control(0x0C);
}
/*******************************************************/
/****** 参 数: 无 ******/
/****** 返回值 : 无 ******/
/*******************************************************/
{
bcd &= 0x0F;
if(bcd > 9)
bcd +=('7'); // 将A~F转换为ASCII
else
bcd += '0'; // 将0~9转换为ASCII 0~9
return(bcd);
{
unsigned char i,s;
for (i=0;i<8;i++)
{
if((send_byte&0x80)==0)
{
LCD_DATAL;
}
else
{
LCD_DATAH;
} //送数据
12864ZW说明书
4) 显示状态开/关:
功能:D=1: 整体显示ON ; D=0: 整体显示OFF。 C=1: 光标显示ON ; C=0: 光标显示OFF。 B=1: 光标位置反白且闪烁 ; B=0: 光标位置不反白闪烁。
5) 光标或显示移位控制:
功能:S/C:光标左/右移动,AC减/加1。 R/L:整体显示左/右移动,光标跟随移动,AC值不变。
6) 功能设定:
功能:DL=1: 8-BIT 控制指令集动作; RE=0: 基本指令集动作。
7) 设定CGRAM地址:
12864ZW 使用说明书
液晶显示器使用手册
目录
(一)概述 (二)外形尺寸 (三)模块外部接口 (四)时序说明 (五)指令集说明 (六)显示步骤 (七)初始化时序 (八)应用举例
一、概述 12864ZW是一种图形点阵液晶显示器,它主要由行驱动器/列驱
动器及128X64全点阵液晶显示器组成,可完成图形显示,也可以显 示8X4个(16X16点阵汉字,与外部CPU接口可采用串行或并行方式 控制。 二、外形尺寸图
项目 LCM 尺寸(长×宽×厚)
可视区域(长×宽) 点间距(长×宽) 点尺寸(长×宽 逻辑工作电压(Vdd LCD 驱动电压(Vdd-V0) 工作温度(Ta) 储存温度(Tsto) 工作电流(背光除外)
参考值 93.0×70.0×13.5
72.0×40.0 0.52×0.52 0.48×0.48 +5.0V 或+3.3V(出厂时设定+5.0V) +3.0 ~ +5.0V 0 ~ +50℃(常温)/ -20 ~ +70℃(宽温) -10 ~ +60℃(常温)/ -30 ~ +80℃(宽温) 3.0mA(max)
12864显示图形
看到工具箱旁边那个LCD12864很久没用了(当初买回来用的时候只是简单地测试了一下),于是萌生了重新写一次接口程序的想法(而且这次要给它加个图片显示的功能),好,说做就做,就用Atmega16和ICCAVR来做吧,最近这MCU和平台用得比较熟练。
马上从书堆里把当初打印出来的中文datasheet给翻了出来,依葫芦画瓢地写了个初始化程序。
好,OK。
编译通过。
于是又写了一个可以自定义从XY坐标值开始输出显示的函数,再次编译,也通过,OK。
于是呼马上写了四行简单的字符烧到单片机上试了一下,嘿嘿,一次通过。
如下图:后来在进一步测试的时候也出了点小问题。
就是我是使用USBISP烧写器把程序烧写进AVR的(此时实验板由USBISP烧写器供电),想要实现从第一行的第一个字符开始连续显示"0123456789"。
刚烧写完程序后能看到LCD12864上正常显示"0123456789",但是把烧写器从实验板上断开连接,单独用USB给实验板供电的时候,LCD的第一行只是显示"123456789",第一个字符消失了……,左思右想地弄了一个多小时后,终于把问题给解决了,就是把初始化程序的延时适当增加了些,真是奇怪。
刚开始一直想不通为什么在烧写器供电的情况下就正常显示,而换到USB供电后就出了问题。
后来再想想,估计是跟供电有关。
在使用USBISP烧写器供电的时候,LCD的背光灯明显比用USB供电的时候来得亮,而且对比度也高很多,看来是因为换到USB供电后,供电不怎么充足,以至于LCD在上电初始化的时候花上了更多的时间去初始化(因为供电低了,功率小了,跑起来有点力不从心,用的时间就久了嘛……我是觉得可以这样去理解的)接下来呢,就到了有点难度的画图了。
当初刚买到12864的时候只是简单测试了字符显示功能,除了因为画图还不需要用到,另外一个原因就是那datasheet上关于画图那部分的内容不怎么看得懂……。
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液晶显示图片,画点,画任意直线
玩转12864液晶(2)--显示图片,画点,画任意直线本帖被红金龙吸味执行加亮操作(2009-07-04)通过上一篇的实验,相信大家都掌握了显示字符的基本用法。
下面我们来看一下12864液晶更高级的用法。
首先是它的绘图功能。
让我们先来显示一整副的图片吧,也就是128x64大小。
在使用绘图功能时,先要打开扩充指令集,然后再打开绘图功能。
接着就是送数据显示了。
这里我们首先要弄明白ST7920的显示坐标关系。
其显示坐标如下。
从图中可以看出,X方向共有8个字(16个字节)Y方向共有0~31 行分为上下两个屏。
弄懂了之后我们就可以依照此坐标来显示一整屏的图片了。
随便用一个图片的提取转换软件,讲一副126X64大小的图片转换成字节数据,总共字节大小为128*64/8 = 1024个字节。
下面我们来看看这个显示整屏图像的函数void v_Lcd12864DrawPicture_f( unsigned char code *pPicture ){unsigned char i, j, k ;for( i = 0 ; i < 2 ; i++ )//分上下两屏写{for( j = 0 ; j < 32 ; j++ ){v_Lcd12864SendCmd_f( 0x80 + j ) ;//写Y坐标if( i == 0 ) //写X坐标{v_Lcd12864SendCmd_f( 0x80 ) ;}else{v_Lcd12864SendCmd_f( 0x88 ) ;}for( k = 0 ; k < 16 ; k++ ) //写一整行数据{v_Lcd12864SendData_f( *pPicture++ ) ;}}}v_Lcd12864SendCmd_f( 0x30 ) ;}看看效果图片如下:显示一个人的图像下面来看看如何在任意一个位置显示或者是擦除一个点对于12864这种二值显示屏来说,其显示状态无外乎显示和不显示一个点这两种状态。
12864液晶使用说明书
功能:S/C:光标左/右移动,AC减/加1。 R/L:整体显示左/右移动,光标跟随移动,AC值不变。
6) 功能设定:
功能:DL=1: 8-BIT 控制接口; DL=0: 4-BIT 控制接口。 RE=1: 扩充指令集动作; RE=0: 基本指令集动作。
7) 设定CGRAM地址:
● RS=0: 当 MPU 进行读模块操作,指向地址计数器。 当 MPU 进行写模块操作,指向指令寄存器。
● RS=1: 无论 MPU 读/写操作,均指向数据寄存器。
串口方式: CS:串行片选信号,高电平有效。
并口方式: ● R/W=0 写操作。 ● R/W=1 读操作。
串口方式: 串行数据输入端 并口方式:使能信号,高电平有效。 串口方式:串行时钟信号。 MPU 与模块之间并口的数据传送通道, 4 位总线模式下 D0 ~ D3 脚断开 串/并口控制选择端: ● H:并口控制; ● L:串口控制。
字节的LSB部分,至于相关的另四位则都为0。串行传输讯号请参考下图说明
4、串行接口时序图:
(1) MPU写数5℃,VDD=4.5V)
五、用户指令集说明:
1、指令表一:(RE=0:基本指令集)
指令表二:(RE=1:扩充指令集)
备注说明: ● 当模块在接受指令前,微处理顺必须先确认模块内部处于非忙碌状态,即读取 BF 标志时BF需为0,方可接受新的指令;如果在送出一个指令前并不检查BF标 志,那么在前一个指令和这个指令中间必须延迟一段较长的时间,即是等待前一 个指令确实执行完成,指令执行的时间请参考指令表中的个别指令说明。 ● “RE”为基本指令集与扩充指令集的选择控制位,当变更“RE”位后,往后 的指令集将维持在最后的状态,除非再次变更“RE”位,否则使用相同指令集 时,不需每次重设“RE”位。
12864汉字和图片的显示
12864汉字和图片的显示课程设计报告书设计题目:12864汉字和图片的显示课程名称:单片机快速入门系部:电子信息系专业:应用电子技术班级:电子0901姓名:组长:学号:成绩:2011年6月16日目录任务安排 (3)一、项目介绍 (3)1.1 设计内容 (3)1.2 设计要求 (3)1.3 系统主要功能 (4)二、硬件设计 (4)2.1 原理电路图 (4)2.2主要元件功能说明 (5)三、系统软件设计 (10)3.1 分析论证 (10)3.2 程序流程图 (12)3.3 源程序清单 (13)四、个人心得 (19)五、结束语 (20)六、参考文献 (21)七、12864汉字和图片的显示原理图 (21)任务安排一、项目介绍1.1 设计内容利用单片机和12864液晶显示屏通过按键功能实现汉字和图片的显示1.2 设计要求(1)在12864上第一次显示汉字“安徽财贸职业学院大学城翡翠路900/doc/dd174fd133d4b14e852468a7.ht ml ”(2)在12864上第二次显示汉字“单片机实训周6月11日星期六”(3)第三次显示图片:服装,帽子,鞋,皮包等(4)第四次显示汉字:“这就是我们小组的设计方案谢谢欣赏”1.3系统主要功能:12864LCD指令系统及时序该类液晶显示模块(表1-1)控制信号控制代码指令名称R/W RS DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 显示开关0 0 0 0 1 1 1 1 1 1/0 起始行设置0 0 1 1 X X X X X X 页设置0 0 1 0 1 1 1 X X X 列地址设置0 0 0 1 X X X X X X 读状态 1 0 BUSY 0 ON/OFF RST 0 0 0 0 写数据0 1 写数据读数据 1 1 读数据二、硬件设计2.1 原理电路图12864显示屏(图2-1a)独立按键原理图(图2-1b)2.2主要元件功能说明1)12864显示屏内部功能器件及相关功能如下指令寄存器(IR): IR是用于寄存指令码,与数据寄存器数据相对应。
LCD12864液晶显示器中文说明.
一、液晶显示模块概述12864A-1汉字图形点阵液晶显示模块,可显示汉字及图形,内置8192个中文汉字(16X16点阵)、128个字符(8X16点阵)及64X256点阵显示RAM(GDRAM)。
主要技术参数和显示特性:电源:VDD 3.3V~+5V(内置升压电路,无需负压);显示内容:128列× 64行显示颜色:黄绿显示角度:6:00钟直视LCD类型:STN与MCU接口:8位或4位并行/3位串行配置LED背光多种软件功能:光标显示、画面移位、自定义字符、睡眠模式等二、外形尺寸1.外形尺寸图2.主要外形尺寸二、模块引脚说明逻辑工作电压(VDD):4.5~5.5V电源地(GND):0V工作温度(Ta):0~60℃(常温) / -20~75℃(宽温)三、接口时序模块有并行和串行两种连接方法(时序如下):8位并行连接时序图MPU写资料到模块MPU从模块读出资料2、串行连接时序图串行数据传送共分三个字节完成:第一字节:串口控制—格式11111ABCA为数据传送方向控制:H表示数据从LCD到MCU,L表示数据从MCU到LCDB为数据类型选择:H表示数据是显示数据,L表示数据是控制指令C固定为0第二字节:(并行)8位数据的高4位—格式DDDD0000第三字节:(并行)8位数据的低4位—格式0000DDDD串行接口时序参数:(测试条件:T=25℃VDD=4.5V)四、用户指令集备注:1、当模块在接受指令前,微处理顺必须先确认模块内部处于非忙碌状态,即读取BF标志时BF需为0,方可接受新的指令;如果在送出一个指令前并不检查BF标志,那么在前一个指令和这个指令中间必须延迟一段较长的时间,即是等待前一个指令确实执行完成,指令执行的时间请参考指令表中的个别指令说明。
2、“RE”为基本指令集与扩充指令集的选择控制位元,当变更“RE”位元后,往后的指令集将维持在最后的状态,除非再次变更“RE”位元,否则使用相同指令集时,不需每次重设“RE”位元。
12864打点 自定义图
一. 显示图片显示图片的要点在于:1.取模2.利用扩展指令设置液晶3.清楚液晶地址的概念1.1取模取模软件用的是“字模221”下图是他的参数设置这里对参数设置先解释一下,所谓横向取模就是,一张图片从图片最左上角的8位开始取模,从左向右,每次取8位二进制数据转化为16进制保存,第一排取完之后,接着到第二排最左边8位开始取模,以此类推。
为什么要这样取模呢?因为12864液晶的横纵坐标就是这个取模顺序,这点在之后还会详细提到。
1.2液晶的设置液晶显示图片必须用扩充指令集,初始化和显示字符的初始化不一样。
我用的初始化函数如下:void init_picture() //显示图片的初始化函数{//lcd_wcmd(0x34);//写指令函数,扩充指令集,绘图关//lcd_wcmd(0x36);//8位数据传输,扩展指令操作,绘图开lcd_wcmd(0x3E);//8位数据传输,扩展指令操作,绘图开lcd_wcmd(0x01);//清屏Light = 0;//打开背光}到0x80+0F是下半屏的坐标。
水平坐标每个两字节,先写入的数据填充在高字节。
垂直坐标只有0x80+00到0x80+1F,图中上半截0x80+00到0x80+1F是上半屏的垂直地址,另外的那部分一样的是下半屏垂直地址。
每个垂直地址只确定一排,所以水平和垂直地址不能确定某个点的位置,只能确定某个两字节的位置,通过写进2字节数据确定点亮某个点或几个点。
比如我们写入 [垂直地址]: lcd_wcmd(0x80+1);[水平地址]: lcd_wcmd(0x80); 这就是说我们将在图中水平坐标00,垂直坐标01的位置(红圈处)输入数据。
知道地址的知识之后就明白为什么要横向取模了,接下来只要将取模的数据一个个按取模生成的顺序写进液晶就行了。
下面是我用的代码,其中uchar=unsigned char,uint=unsigned int。
void show_Pic(uchar* address)//显示图片函数{ //address是是指向数组的指针,用法:show_Pic(XY)当中XY 为数组名uchar i,j;for(i=0;i<32;i++) //上半屏的32排依次先写满{lcd_wcmd(0x80+i); //先送垂直地址lcd_wcmd(0x80); //再送水平地址,水平地址可自加1for(j=0;j<16;j++) //每排128个点,所以一共要16个两位16进制数(也就是8位二进制数)才能全部控制{lcd_wdat(*address);address++;}}for(i=0;i<32;i++) //下半屏的32排操作原理和上半屏一样{lcd_wcmd(0x80+i);lcd_wcmd(0x88);for(j=0;j<16;j++){lcd_wdat(*address);address++;}}}1.4实际显示结果下图是我显示的一个坐标系和一条龙下面的代码是我的主函数,这部分加上上面我上面讲的函数和一些基本设置就是整个代码,XY是这幅坐标图片取模得到的数组void main(){init_picture();show_Pic(XY);while(1) // 进入程序主循环{}}二. 用打点方式显示任意图像有的同学认为打点只需按照上面的显示图片的方法点亮需要的点就是了,其实这不行。
用12864显示任意一张图片
可在12864上显示任何图片有了取模软件,可以将任意一张图片变成代码显示在12864上面;取模软件可以到网上下载,也可以找我要,加qq494891864#include<reg52.h>sbit rs=P1^2;sbit rw=P1^1;sbit cs=P1^0;sbit psb=P1^3;unsigned char lcd_x,lcd_y;unsigned char code image[]={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,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,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,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,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,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,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,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,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,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,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,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,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x0F,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x0B,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x3F,0xD0,0x00,0x0F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x3F,0xF0,0x00,0x0F,0x90,0x37,0xE0,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x3F,0xF0,0x00,0x07,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x3F,0xF0,0x1F,0xBF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x3F,0xC0,0x1F,0xFF,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x01,0xBF,0xCE,0xDF,0xFF,0xFF,0xFF,0xFF,0xDE,0xC0,0x00,0x00,0x00,0x00 ,0x00,0x00,0x01,0xBF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00 ,0x00,0x00,0x01,0xFF,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x80,0x00,0x00,0x00,0x00 ,0x00,0x00,0x05,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00 ,0x00,0x00,0x07,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00 ,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x80,0x00,0x00,0x00 ,0x00,0x00,0x13,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAD,0x7E,0xC0,0x00 ,0x00,0x00,0x1F,0xFF,0xFF,0xF0,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xC0,0x00 ,0x00,0x00,0x1F,0xFF,0xFE,0xBC,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xB7,0xC0,0x00 ,0x00,0x00,0x1F,0xFF,0xFF,0xFC,0x3F,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00 ,0x00,0x00,0x1F,0xFF,0x80,0x00,0x00,0x0D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00 ,0x00,0x00,0x1F,0xFF,0x60,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00 ,0x00,0x00,0xFF,0xFF,0xE0,0x00,0x00,0x0F,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00 ,0x00,0x00,0xDF,0xF8,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00 ,0x00,0x00,0xFF,0xB8,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00 ,0x00,0x00,0xBF,0x18,0x00,0x00,0x00,0x00,0x14,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00 ,0x00,0x00,0x7D,0x00,0x00,0x00,0x00,0x00,0x02,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00 ,0x00,0x03,0x7F,0x00,0x00,0x00,0x00,0x00,0x07,0xBF,0xFF,0xFF,0xFF,0xEE,0x00,0x00 ,0x00,0x03,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0xFF,0xFF,0xFF,0xF8,0x00,0x00 ,0x00,0x03,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0xF8,0x00,0x00 ,0x00,0x03,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x3D,0xFF,0xFF,0xFF,0x78,0x00,0x00 ,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFE,0x00,0x00,0x00 ,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x00,0x00,0x00 ,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xCF,0xFF,0xE3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0x60,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x97,0xE0,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,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x0F,0xFC,0x0F,0xFE,0x1F,0xF8,0x78,0x7C,0x3F,0xF8,0x00,0x00 ,};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 init(){psb=1; //1并行,0串行write_com(0x30); //基本指令操作delay(5);write_com(0x0c); //显示开,关光标delay(5);write_com(0x01); //清除led的显示内容delay(5);}/*====================================================函数功能:清除GCROM的内容,如果不清除会出现花屏现象清除方法:向GCROM中写入0x00来清除内========================================================*/void clear_gcrom(){unsigned char i,j,k;lcd_x=0x80;lcd_y=0x80;write_com(0x34);for(i=0;i<2;i++){for(j=0;j<32;j++){write_com(lcd_y+j);write_com(lcd_x);for(k=0;k<16;k++){write_date(0x00);}}lcd_x=0x88;}write_com(0x36);write_com(0x30);}/*================================================================函数功能:向12864中写入一幅图片函数参数:lcd_x为水平显示位置,lcd_y为垂直显示位置,函数将12864屏分成上下两屏写入,上半屏LCD_x=0x80,下半屏lcd_x=0x88 =================================================================*/void write_image(unsigned char *p){unsigned char i,j,k;lcd_x=0x80;lcd_y=0x80;write_com(0x34);for(i=0;i<2;i++) //分为上下两屏{for(j=0;j<32;j++){write_com(lcd_y+j);write_com(lcd_x);for(k=0;k<16;k++) //写入显示数据{write_date(*p++);}}lcd_x=0x88;}write_com(0x36);write_com(0x30);}void main(){init();write_com(0x1c);clear_gcrom();write_image(image);while(1);}(注:可编辑下载,若有不当之处,请指正,谢谢!)。
12864显示火影图片
#include "config.h"/*******************定义与LCD相关的宏*******************/#define LCD_DATA 0xFF#define LCD_DI 1<<8 //与p0.8对应#define LCD_RW 1<<9 //与p0.9对应#define LCD_EN 1<<10 //与p0.10对应.#define LCD_PSB 1<<11 //与p0.11对应//电路直接拉高#define LCD_RST 1<<12 //与p0.12对应//上电自动复位,一般也可以不接*#define clear_screen 0x01#define reset_address 0x02#define set_point 0x06 // 0000_0110#define display_set 0x0c //显示设定#define cursor_shift_control 0x1c //0001_1100#define function_set 0x30 //功能设定基本指令集#define function_set_ext 0x36 //功能设定扩充指令集绘图开//#define set_CGRAM_ADD#define set_DDRAM_ADD 0x80//#define write_data_intenalRAM#define uint unsigned int/*****************************************************************************/ void Delay_1ms(uint8 d){uint8 i;while (d--!=0){for(i=0;i<40;i++);}}void Delay(uint32 dly){while(dly--!=0);}/*****************************************************************************/void LCD_DATA_input(){IO0DIR = IO0DIR & (~LCD_DA TA); //把p1.16-p1.23设定为输入}/*****************************************************************************/ void LCD_DATA_output(){IO0DIR = IO0DIR | LCD_DA TA; //设定p0.0-p0.7为输出}/*****************************************************************************/ void CheckState( ) //状态检查,LCD是否忙?{Delay_1ms(200);//}/*****************************************************************************//********************************************************************************* 函数名称:GPIO_Init()*** 函数功能:初始化IO端口,包含一个uart0,三个按键输入,以及几个普通的输入输出端口.*** 入口参数:无*** 出口参数:无******************************************************************************/ void GPIO_init(){PINSEL0 = 0;IO0DIR= 0xFF<<8;}/****************************************************************************** ***************************** 函数名称:w_data(unsigned char data_Lcm)*** 函数功能:给LCD发送数据或者命令.*** 入口参数:data_Lcm*** 出口参数:无******************************************************************************* ***************************/void W_data(uint8 data_Lcm){CheckState();LCD_DATA_output();IO0SET = LCD_DI;IO0CLR = LCD_RW;IO0CLR = 0xFF;IO0SET = data_Lcm;IO0SET = LCD_EN;IO0CLR = LCD_EN;}/****************************************************************************** ***************************** 函数名称:*** 函数功能:*** 入口参数:*** 出口参数:******************************************************************************* ***************************/void W_instruct(uint8 data_Lcm){CheckState();LCD_DATA_output();IO0CLR = LCD_DI;IO0CLR = LCD_RW;IO0CLR = 0xFF;IO0SET = data_Lcm;IO0SET = LCD_EN;IO0CLR = LCD_EN;}/****************************************************************************** ***************************** 函数名称LCD_Init()*** 函数功能:初始化lcd显示屏*** 入口参数:无*** 出口参数:无******************************************************************************* ***************************/void init_lcd(void){IO0SET = LCD_RST;IO0CLR = LCD_RST;IO0SET = LCD_RST;IO0SET = LCD_PSB;IO0SET = LCD_PSB;W_instruct(function_set);W_instruct(display_set);W_instruct(clear_screen);W_instruct(reset_address);W_instruct(set_DDRAM_ADD);}/*====================================================函数功能:清除GDROM的内容,如果不清除会出现花屏现象清除方法:向GDROM中写入0x00来清除内容========================================================*/void clear(){uint8 i,j,k,lcd_x,lcd_y;lcd_x=0x80;lcd_y=0x80;W_instruct(0x34);//打开扩充指令关闭绘图显示(绘图指令为扩充指令,并且在绘图期间必须关闭绘图显示功能)for(i=0;i<2;i++)//分为上下两半屏清除显示{for(j=0;j<32;j++){W_instruct(lcd_y+j);W_instruct(lcd_x);for(k=0;k<16;k++){W_data(0x00);}}lcd_x=0x88;//将x指向下半屏}W_instruct(0x36);//打开绘图指令W_instruct(0x30);//操作恢复为常用指令}/*****************************************************************************/ void write_image(uint8 *p){uint8 i,j,k,lcd_x,lcd_y;lcd_x=0x80;lcd_y=0x80;W_instruct(0x34);//打开扩充功能for(i=0;i<2;i++) //分为上下两屏{for(j=0;j<32;j++){W_instruct(lcd_y+j);W_instruct(lcd_x);for(k=0;k<16;k++) //写入显示数据{W_data(*p++);}}lcd_x=0x88;//将x地址指向下半屏}W_instruct(0x36);//打开绘图功能W_instruct(0x30);//操作恢复为常用指令}uint8 tu[]={/*火影图片*//*-- 宽度x高度=128x64 --*/0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFC,0X00,0X00,0X03,0XFF,0XFF,0XF1,0X33,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0X3 F,0XFC,0X00,0X00,0X40,0X3E,0XFC,0X00,0X10,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0X 7F,0XFC,0X00,0X00,0X40,0X38,0X00,0X00,0X01,0XC3,0XFF,0XFF,0XFF,0XF8,0X00,0XFF,0X7 F,0XFC,0X00,0X00,0XC0,0X50,0X27,0XFE,0X00,0X07,0XFF,0XFF,0XC0,0X00,0X00,0X7F,0X 3F,0XFC,0X00,0X00,0XC0,0X11,0XFF,0XFE,0X00,0X0F,0XFF,0X00,0X00,0X00,0X00,0X2F,0X3 F,0XFC,0X00,0X00,0XC0,0X00,0XF7,0XFE,0X00,0X1F,0XF8,0X03,0XFF,0XFF,0XF8,0X23,0X BF,0XFC,0X00,0X01,0XC0,0X00,0XF7,0XFE,0X80,0X3F,0XF0,0XFF,0XFF,0XFF,0XF4,0X11,0X BF,0XFC,0X00,0X01,0XC0,0X01,0XFF,0XFE,0X01,0X3F,0X61,0X7F,0XFF,0XCF,0XFC,0X00,0X FF,0XFC,0X00,0X01,0XC0,0X00,0XF9,0XFE,0X00,0XEE,0X23,0X3F,0XF8,0X1F,0XFC,0X00,0X 3F,0XFC,0X00,0X01,0XD0,0X00,0XFF,0X80,0XE4,0X0C,0X03,0X3F,0XF7,0XFF,0XFC,0X00,0X 3F,0XFC,0X00,0X01,0XC0,0X00,0X00,0X00,0XF5,0X0A,0X03,0X3F,0XEC,0X3F,0XF8,0X00,0X0XFC,0X00,0X01,0X80,0X02,0X01,0X03,0X79,0X16,0X02,0X3F,0XE9,0X3F,0XF8,0X00,0X3 F,0XFC,0X00,0X00,0X00,0X03,0X07,0X66,0XFB,0X14,0X02,0X7F,0XCB,0X5F,0XFC,0X00,0X 3F,0XFC,0X00,0X00,0X00,0X03,0X87,0XFF,0XFF,0X20,0X02,0X7F,0XCC,0X5F,0XFC,0X00,0X 3F,0XFC,0X00,0X00,0X00,0X03,0XDF,0XFF,0XF0,0X00,0X03,0X7F,0XA7,0X9F,0XFC,0X00,0X 3F,0XFC,0X00,0X00,0X00,0X01,0XFF,0XFF,0XF0,0X00,0X03,0X7F,0XA0,0X3F,0XF0,0X00,0X3 F,0XFC,0X00,0X00,0X00,0X01,0XFF,0XFF,0XD0,0X40,0X01,0X7F,0XFD,0XFF,0XF4,0X01,0X BF,0XFC,0X00,0X00,0X00,0X01,0XFF,0XFF,0XF0,0X00,0X01,0X7F,0XFF,0XFD,0XF8,0X01,0X3 F,0XFC,0X00,0X00,0X00,0X00,0XFF,0XFF,0XC0,0X00,0X00,0X7F,0XFF,0XF0,0X00,0X02,0X3 F,0XFC,0X00,0X00,0X00,0X00,0XF9,0X7F,0XE0,0X03,0X00,0X00,0X00,0X00,0X00,0X0C,0XB F,0XFC,0X00,0X00,0X00,0X00,0X7D,0XFF,0X80,0X01,0X80,0X00,0X00,0X00,0X0F,0XE8,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X7F,0XFF,0X00,0X00,0XA8,0X00,0X00,0X02,0X03,0XE1,0XB F,0XFC,0X00,0X00,0X00,0X00,0X3E,0X30,0X00,0X03,0X4F,0X81,0XFF,0XFC,0X01,0XE1,0X BF,0XFC,0X00,0X00,0X00,0X00,0X0F,0XE0,0X00,0X03,0X0F,0X00,0XFF,0XC4,0X45,0XE1,0X BF,0XFC,0X00,0X00,0X00,0X00,0X1F,0X00,0X00,0X03,0X1F,0X40,0X47,0XEC,0X0F,0XE9,0XB F,0XFC,0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X03,0X0F,0X40,0X6F,0XFE,0X0F,0XF9,0XB F,0XFC,0X00,0X00,0X00,0X00,0X20,0X00,0X00,0X03,0X0F,0XC3,0XFF,0XFF,0X0F,0XF3,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X3F,0XE0,0XFF,0XFF,0XDF,0XE3,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFB,0XFF,0XFF,0XFF,0XE6,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X8F,0XFF,0XFF,0XFF,0XFF,0XCC,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC7,0XFF,0XFF,0XFF,0XFF,0XCC,0X 3F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X77,0XFF,0XFF,0XFF,0XFF,0XDC,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X37,0XFF,0XFF,0XFF,0XFF,0X18,0X30XFC,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X33,0XFF,0XFF,0XFF,0XFF,0XB8,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X13,0XFF,0XFF,0XFF,0XFF,0XFE,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFF,0XFF,0XFF,0XFF,0XFF,0X3 F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1D,0XFF,0XFF,0XFF,0XFF,0X3F,0XB F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFD,0X3F,0XFF,0X7F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3C,0XFF,0XFC,0X3F,0XFF,0X7F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFC,0XFF,0XFE,0X7F,0XFE,0X7F,0X FF,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF8,0X7F,0XFF,0XFF,0XFC,0X4F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XF8,0X3F,0XFF,0XFF,0XF8,0X4F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF8,0X1F,0XFF,0XFF,0XF9,0X07,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF0,0X0F,0XFF,0XFF,0XE7,0X07,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF8,0X07,0XFF,0XFF,0XC3,0X07,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF8,0X63,0XFF,0XFF,0X81,0X0F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFC,0X50,0XFF,0XFE,0X00,0X0F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFC,0X40,0X3F,0XFC,0X00,0X1F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFC,0X41,0X0F,0XF0,0X00,0X3F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFE,0X01,0XC0,0X00,0X38,0X7F,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0X27,0XF0,0X00,0X7C,0XFF,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XA7,0XFC,0X00,0XFF,0XFF,0X FF,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XE7,0XFF,0XFE,0XFF,0XFF,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XF7,0XFF,0XFD,0XFF,0XFF,0XF F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0XFF,0XFC,0XFF,0XFF,0XF0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0XFE,0X3F,0X7F,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF F,};int main (void){GPIO_init();init_lcd();clear();write_image(tu);While(1) ;}/******************************************************************************End Of File******************************************************************************/。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/*12864zw 8位并行显示一幅图片--曾小贤*/#include<reg52.h>#include <intrins.h>sbit RS=P2^2;//串口时为CSsbit RW=P2^3; //串口为SIDsbit E=P2^4; //串口为时钟SCLKsbit PSB=P2^5;sbit REST=P2^7;#define IO P0#define BF 0x80#define Uint unsigned int#define Uchar unsigned charvoid delay(Uint z)//延时函数大约1毫秒{Uint x,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}Uchar code TAB1[]={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,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,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,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00, 0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x00, 0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x00, 0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x00, 0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00, 0x00,0x01,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00, 0x00,0x01,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00, 0x00,0x03,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x7F,0xE0,0x00,0x00, 0x00,0x03,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0xFF,0xFF,0xF0,0x00, 0x00,0x03,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xFF,0xFF,0xFF,0xF8,0x00, 0x00,0x07,0xFF,0x80,0x00,0x00,0x00,0x00, 0x00,0x00,0x03,0xFF,0xF9,0xFF,0xFC,0x00, 0x7F,0xFF,0xCF,0xFF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x03,0xFF,0xF9,0xFF,0xFC,0x00, 0xFF,0xFF,0xCF,0xFF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x01,0xFF,0xF0,0xFF,0xF8,0x01, 0xFF,0xFF,0xC7,0xFF,0xFE,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0x80,0x1F,0xF0,0x01, 0xFF,0xFF,0x87,0xFF,0xFE,0x00,0x00,0x00, 0x00,0x00,0x00,0x7F,0xC0,0x3F,0xE0,0x00, 0xFF,0xFF,0x03,0xFF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0xE0,0x7F,0x80,0x00, 0x7F,0xC0,0x00,0x0F,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0xE0,0x7F,0x00,0x00, 0x1F,0xF0,0x00,0x3F,0xE0,0x00,0x00,0x00, 0x00,0x00,0x00,0x03,0xE0,0x7C,0x00,0x00, 0x0F,0xF8,0x00,0x7F,0xC0,0x00,0x00,0x00, 0x00,0x00,0x00,0x07,0xEF,0x7E,0x00,0x00, 0x03,0xFC,0x00,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x07,0xDF,0xFE,0x00,0x00, 0x01,0xFC,0x00,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x07,0xFF,0xFE,0x00,0x00, 0x00,0x7C,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0xF8,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0xFF,0xFF,0x00,0x00, 0x00,0xFC,0x78,0xFC,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0xFF,0xFF,0x00,0x00, 0x00,0xF9,0xFE,0x7C,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0xF0,0xFF,0x80,0x00, 0x00,0xFB,0xFF,0xFC,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0xC0,0x3F,0x80,0x00, 0x01,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0x80,0x1F,0x80,0x00, 0x01,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0E,0x00,0x07,0x00,0x00, 0x01,0xFF,0xCF,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0xFF,0x87,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0xFE,0x01,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0xF8,0x00,0x7F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0xE0,0x00,0x1F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0xC0,0x00,0x0E,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,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,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,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, 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,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,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,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,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,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,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,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00};//**************************************************************************// //以下是并口时才开的//读忙标志,void RDBF(void){Uchar temp;RS=0;RW=1;while(1){IO=0xFF; //数据线为输入E=1;temp=IO;E=0;if ((temp&0x80)==0) break;}}//写数据到指令寄存器void WRCommand(Uchar comm){RDBF();RS=0;RW=0;IO=comm;E=1;E=0;}//写数据到数据寄存器void WRData(Uchar TEMP){RDBF();RS=1;RW=0;IO=TEMP;E=1;E=0;}/*******************************************************************///初始化LCD-8位接口void LCDInit(void){PSB=1;//并口时选这个,上一行取消REST=1;REST=0;REST=1;WRCommand(0x30); //基本指令集,8位并行WRCommand(0x06); //启始点设定:光标右移WRCommand(0x01); //清除显示DDRAMWRCommand(0x0C); //显示状态开关:整体显示开,光标显示关,光标显示反白关WRCommand(0x02); //地址归零}void CLEARGDRAM(void) //清除GDRAM数据{Uchar j;Uchar i;WRCommand(0x34);WRCommand(0x36);for(j=0;j<32;j++){WRCommand(0x80+j);WRCommand(0x80);//X坐标for(i=0;i<32;i++){WRData(0x00);}}}//写入GDRAM 绘图,Y是Y绘图坐标,2个字节一行,CLONG是图形长度,以字节//为单位;HIGHT是图形高度,TAB是图形数据表.12864M的图形显示是相当于256*32点阵. //由两屏128*32上下两屏组成,同一行的下屏的头地址紧接上屏的未地址。