LCD12864驱动程序-C51
51单片机LCD_12864驱动
LCD_RST=0; //复位
delay(1); //延时
LCD_RST=1; //复位置高
delay(10);
}
/*********************************************************
* *
* 清屏函数 *
/* */
/* LCD初始化设定 */
/* */
* *
*********************************************************/
void LCD_ClearScreen()
{
LCD_wcmd(0x34); //扩充指令操作
lcd_delay(5);
LCD_wcmd(0x30); //基本指令操作
lcd_delay(5);
LCD_wcmd(0x01); //清屏
lcd_delay(5);
}
/*******************************************************************/
LCD_wcmd(0x30); //Extended Function Set :8BIT设置,RE=0: basic instruction set, G=0 :graphic display OFF
delay(100); //大于100uS的延时程序
LCD_wcmd(0x30); //Function Set
/*写指令数据到LCD */
/*RS=L,RW=L,E=高脉冲,D0-D7=指令码。 */
/* */
lcd_delay(3);
12864液晶显示程序51驱动
#include <reg52.h>#include <intrins.h>sbit LCD_RS =P0^0; //L:COMMAND; H:DATA sbit LCD_RW =P0^1; //L:WRITE; H:READ sbit LCD_E =P0^2; //INPUT ENABLEsbit LCD_CS1 =P0^3; //L有效sbit LCD_RES =P0^4; //L有效#define data_bus P2#define control_bus P0#define uchar unsigned char#define uint unsigned int//=====延时N微秒==============void delay_nus(uint n){while(n--);return;}//=====延时N毫秒==============void delay_nms(uint n){int i;for(i=0;i<n;i++)delay_nus(123);}//=====忙检测=================void check_busy(void){uchar read_data=0xff;data_bus=0xff;LCD_RS=0;LCD_RW=1; //读命令LCD_CS1=0; //片使能while((read_data&0x80)==0x80){LCD_E=1;_nop_();_nop_();read_data=data_bus;LCD_E=0;}LCD_E=0;LCD_CS1=1; //片禁能}//=====写命令到寄存器========= void send_cmd(uchar cmd) small{check_busy();LCD_RS=0; //写的是命令LCD_RW=0; //写命令LCD_CS1=0; //片使能data_bus=cmd;LCD_E=1; //使能_nop_();_nop_();LCD_E=0;_nop_();_nop_();LCD_CS1=1; //片禁能}//=====写数据到DDRAM========= void send_dat(uchar dat) small{check_busy();LCD_RS=1; //写的是数据LCD_RW=0; //写数据LCD_CS1=0; //片使能data_bus=dat;LCD_E=1;_nop_();_nop_();LCD_E=0;_nop_();_nop_();LCD_CS1=1; //片禁能}//=======初始化============== void lcd_initial(void) small{LCD_RES=0;delay_nms(50);LCD_RES=1;LCD_E=0;delay_nms(50);send_cmd(0xA0);send_cmd(0xC8);send_cmd(0xA2);send_cmd(0x2C);send_cmd(0x2E);send_cmd(0x2F);send_cmd(0x25);send_cmd(0x81);send_cmd(0x14);send_cmd(0xAF);send_cmd(0xE0);send_cmd(0x40);}//=======写列地址==============void Set_Colume_Address(unsigned char dat){unsigned char tmp;tmp=dat>>4;send_cmd(0x10|tmp); //送列地址高三位tmp=0x0f&dat;send_cmd(tmp); //送列地址低四位}code unsigned char number[][16] = {/*-- 文字: 0 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,/*-- 文字: 1 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,/*-- 文字: 2 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,/*-- 文字: 3 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,/*-- 文字: 4 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,/*-- 文字: 6 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,/*-- 文字: 7 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,/*-- 文字: 8 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,/*-- 文字: 9 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,/*-- 文字: : --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, /*-- 文字: - --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01}; code unsigned char Hz[][32] = {/*-- 文字: 中--*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0xFC,0x08,0x08,0x08,0x08,0xFF,0x08,0x08,0x08,0x08,0xFC,0x08,0x00,0x00, 0x00,0x00,0x07,0x02,0x02,0x02,0x02,0xFF,0x02,0x02,0x02,0x02,0x07,0x00,0x00,0x00,/*-- 文字: 鼎--*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0xF8,0x00,0x00,0x7E,0x52,0x66,0x4A,0x52,0x7E,0x00,0x00,0xF8,0x00,0x00, 0x00,0x84,0x65,0x1D,0x05,0x05,0xFF,0x00,0x00,0xFF,0x05,0x05,0x05,0xFD,0x00,0x00,/*-- 文字: 技--*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xC8,0x48,0x48,0x7F,0x48,0xC8,0x48,0x08,0x00, 0x01,0x41,0x80,0x7F,0x00,0x40,0x40,0x20,0x13,0x0C,0x0C,0x12,0x21,0x60,0x20,0x00,/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0x10,0x10,0x10,0x90,0x50,0xFF,0x50,0x90,0x12,0x14,0x10,0x10,0x10,0x00, 0x10,0x10,0x08,0x04,0x02,0x01,0x00,0x7F,0x00,0x00,0x01,0x06,0x0C,0x18,0x08,0x00 };/****显示汉字的程序****/void DisplayHz(unsigned int Page,unsigned int Col,unsigned char Hz[],unsigned int zilie) {unsigned int PageCnt,ColCnt;for(PageCnt = Page;PageCnt < Page+2;PageCnt ++){send_cmd(0xb0|PageCnt); //page addressSet_Colume_Address(Col);for(ColCnt = 0;ColCnt < zilie;ColCnt ++){send_dat(Hz[(PageCnt-Page)*zilie + ColCnt]);}}}//=====主程序===================void main (void){unsigned char month=0,nian=10,yue=1,tian=1,shi=0,fen=0,miao=0,i=0,j=0; unsigned char months[12]={31,28,31,30,31,30,31,31,30,31,30,31};lcd_initial();send_cmd(0xa6);for(i=0;i<8;i++) //清屏{send_cmd(0xb0|i);Set_Colume_Address(0);for(j=0;j<128;j++)send_dat(0);}while(1){if(++miao>59){miao=0;if(++fen>59){fen=0;if(++shi>23){shi=0;if(++tian>months[month]){tian=0;if(++yue>11){yue=1;nian++;}}}}}DisplayHz(0,0,number[nian/10],8);DisplayHz(0,16,number[nian%10],8);DisplayHz(0,32,number[11],8);DisplayHz(0,48,number[yue/10],8);DisplayHz(0,64,number[yue%10],8);DisplayHz(0,80,number[11],8);DisplayHz(0,96,number[tian/10],8);DisplayHz(0,112,number[tian%10],8);DisplayHz(3,0,number[shi/10],8);DisplayHz(3,16,number[shi%10],8);DisplayHz(3,32,number[10],8);DisplayHz(3,48,number[fen/10],8);DisplayHz(3,64,number[fen%10],8);DisplayHz(3,80,number[10],8);DisplayHz(3,96,number[miao/10],8);DisplayHz(3,112,number[miao%10],8);DisplayHz(6,14,Hz[0],16);DisplayHz(6,42,Hz[1],16);DisplayHz(6,70,Hz[2],16);DisplayHz(6,98,Hz[3],16);delay_nms(6000);}}。
Protues中单片机驱动12864仿真
4.上面设置好之后我们就可以在文字输入区输入汉字了,以“Ctrl”+“Enter”结束:
5.然后点击“C51格式”,在点阵生成区就会出现相应的模如下,我们可以把每个汉字对应的模存放在相应的数组中:
上面为取模软件的使用方法,下面开始正式教给读者单片机驱动lcd12864液晶显示屏的方法,在这之前,需要对无字库lcd12864液晶显示屏有个基础的了解,相关引脚如下:
void LCDDelay (char t)
{
char i, j;
for (i = 0; i < t; i ++ )
for (j = 0; j < 10 ;j ++ );
}
void CheckState ( )
{
char dat;
LCDRs = 0;
LCDRw = 1;
do
{
dat = 0x00;
LCDEn = 1;
LCDEn = 0;
}
void LCDInit ( )
{
LCDDelay (100);
LCDCs1 = 1;
LCDCs2 = 1;
LCDDelay (100);
write_com (LCDDispOff);
write_com (PageAdd+0);
write_com (StartLine+0);
write_com (LCDColAdd+0);
(2)假设有一个已经编写好的函数LCDWriteNumBlack (char leftright, char page, char column, char num[]),
12864液晶屏(带字库)51单片机3线串口驱动程序
#include<reg51.h>typedef unsigned char uint8; typedef unsigned int uint16; typedef unsigned long uitn32;sbit CS = P1^0;//片选信号引脚sbit SDA = P1^1;//数据线sbit SCK = P1^2;//串行时钟线//sbit RST = P1^3;//复位引脚//sbit PSB = P1^4;//串并控制引脚code uint8 strint1[] = "I Love You !";/*void delay5ms(void) //误差0us {unsigned char a,b;for(b=185;b>0;b--)for(a=12;a>0;a--);}*///发送一个字节void Send_Byte(uint8 dat){uint8 i;SCK = 0;for(i=0;i<8;i++){SDA = dat&0x80;SCK = 1;dat <<= 1;SCK = 0;}}//读取一个字节数据uint8 Read_Byte(void){uint8 i;uint16 byte = 0;SCK = 0;for(i=0;i<16;i++){byte <<= 1;SCK = 1;if(SDA)byte |= 0x0001;SCK = 0;}byte = ((byte>>4)|(byte>>8))&0x00ff;return ((uint8)(byte));}//读忙标志void Read_Busy(void){uint8 temp;CS = 1;do{Send_Byte(0xfc);//发送读命令temp = Read_Byte();//读取数据}while(temp&0x80);CS = 0;}//发送命令void Write_Cmd(uint8 cmd){uint8 temph = 0;uint8 templ = 0;//制作发送命令格式temph = cmd & 0xf0;templ = (cmd & 0x0f) << 4;Read_Busy();CS = 1;Send_Byte(0XF8);//发送命令命令//发送命令Send_Byte(temph);Send_Byte(templ);CS = 0;}//发送数据void Write_Dat(uint8 dat){uint8 temph = 0;uint8 templ = 0;//制作发送数据格式temph = dat & 0xf0;templ = (dat & 0x0f) << 4;Read_Busy();CS = 1;Send_Byte(0XFA);//发送数据命令Send_Byte(temph);//发送数据Send_Byte(templ);CS = 0;}//在指定位置显示半字宽字符void Dis_HCGROM(uint8 x,uint8 y,uint8 dat) {uint8 addr;switch(y){case 0:addr = 0x80 + x;break;case 1:addr = 0x90 + x;break;case 2:addr = 0x88 + x;break;case 3:addr = 0x98 + x;break;default:break;}Write_Cmd(addr);Write_Dat(dat);}//指定位置显示字符串void Dis_String(uint8 x, uint8 y, uint8 len, uint8 *dat) {uint8 addr,i;switch(y){case 0:addr = 0x80 + x;break;case 1:addr = 0x90 + x;break;case 2:addr = 0x88 + x;break;case 3:addr = 0x98 + x;break;default:break;}Write_Cmd(addr);for(i = 0;i < len;i++){Write_Dat(*dat++);}}//制定位置显示8位无符号数字void Dis_UNum8(uint8 x,uint8 y,uint8 dat){uint8 addr;switch(y){case 0:addr = 0x80 + x;break;case 1:addr = 0x90 + x;break;case 2:addr = 0x88 + x;break;case 3:addr = 0x98 + x;break;default:break;}Write_Cmd(addr);Write_Dat(dat/100%10+'0');Write_Dat(dat/10%10+'0');Write_Dat(dat/1%10+'0');}//制定位置显示16位无符号数字void Dis_UNum16(uint8 x,uint8 y,uint8 dat) {uint8 addr;switch(y){case 0:addr = 0x80 + x;break;case 1:addr = 0x90 + x;break;case 2:addr = 0x88 + x;break;case 3:addr = 0x98 + x;break;default:break;}Write_Cmd(addr);Write_Dat(dat/10000%10+'0');Write_Dat(dat/1000%10+'0');Write_Dat(dat/100%10+'0');Write_Dat(dat/10%10+'0');Write_Dat(dat/1%10+'0');}//在指定位置显示汉字//x范围:0-7,y范围:0-3//dat:汉字字形码void Dis_GB(uint8 x,uint8 y,uint16 dat) {uint8 addr;switch(y){case 0:addr = 0x80 + x;break;case 1:addr = 0x90 + x;break;case 2:addr = 0x88 + x;break;case 3:addr = 0x98 + x;break;default:break;}Write_Cmd(addr);Write_Dat((uint8)(dat >> 8));Write_Dat((uint8)(dat));}//LCD初始化void LCD_Init(void){/*RST = 0;delay5ms();delay5ms();RST = 1;PSB = 0;*/Write_Cmd(0X30);Write_Cmd(0X01);Write_Cmd(0X02);Write_Cmd(0X0C);}void main(void){LCD_Init();while(1){Dis_GB(0,0,0xc9b5);Dis_HCGROM(1,0,0x03);Dis_String(0,1,13,strint1);Dis_UNum8(0,2,250);} }。
LCD12864液晶显示器C51单片机子程序
#include <reg52.h>#ifndef __LCD12864_H__#define __LCD12864_H__#include <intrins.h>#define uchar unsigned char#define uint unsigned int/*端口定义*/#define LCD_data P0 //数据口sbit LCD_RS = P2^7; //寄存器选择输入sbit LCD_RW = P2^6; //液晶读/写控制sbit LCD_EN = P2^5; //液晶使能控制sbit LCD_PSB = P1^4; //串/并方式控制#define delayNOP(); {_nop_();_nop_();_nop_();_nop_();};/* 延时函数*/void delay1(int ms){while(ms--){uchar i;for(i=0;i<250;i++){_nop_();_nop_();_nop_();_nop_();}}}/*检查LCD忙状态*/ /*lcd_busy为1时,忙,等待。
lcd-busy为0时,闲,可写指令与数据。
*/ bit lcd_busy(){bit result;LCD_RS = 0;LCD_RW = 1;LCD_EN = 1;delayNOP();result = (bit)(P0&0x80);LCD_EN = 0;return(result);/*写指令到LCD */ /*RS=L,RW=L,E=高脉冲,D0-D7=指令码。
*/ void lcd_wcmd(uchar cmd){//while(lcd_busy());LCD_RS = 0;LCD_RW = 0;LCD_EN = 0;_nop_();_nop_();P0 = cmd;delayNOP();LCD_EN = 1;delayNOP();LCD_EN = 0;}/*写数据到LCD */ /*RS=H,RW=L,E=高脉冲,D0-D7=数据。
51单片机实现的多图显示用12864液晶驱动程序设计
51单片机实现的多图显示用12864液晶驱动程序设计作者:佚名日期:2010年06月02日来源:不详【字体:大中小】我要评论(0)核心提示:/************************************************程序名称:12864液晶驱动程序(显示多图)简要说明:控制器:KS0107 LCD型号:FM12864、TS12864A-2或兼容型号(不带字库)&nbs/************************************************程序名称:12864液晶驱动程序(显示多图)简要说明:控制器:KS0107LCD型号:FM12864、TS12864A-2或兼容型号(不带字库)MCU:AT89S5*,晶体频率:11.0592MHz取模方式:纵向取模、字节倒序CS1和CS2为高电平有效************************************************/;***************硬件端口定义***********RS EQU P2.0RW EQU P2.1E EQU P2.2CS1 EQU P2.3CS2 EQU P2.4RST EQU P2.5COM EQU 20H ;指令数据寄存器DAT EQU 21H ;显示数据寄存器;**********************************主程序入口地址ORG 0000HAJMP STRORG 0003H;*********************************中断程序入口地址STR:AJMP L0100L0100: CLR RSTNOPNOPSETB RST;********************************以上是软件复位MOV SP,#60HMOV IE,#81H ;中断允许MOV IP,#01H ;优先中断MOV TCON,#00H ;电平中断MOV COM,#3FH ;显示开LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#0C0H ;第一行LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#0B8H ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;----------------------------------------------------------------------MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;********************************************************以上是软件初始化MOV B,#0AAHLCALL XIHX ;显示横线1LCALL DELAY; MOV B,#55H; LCALL XIHX; LCALL DELAY ;显示横线2MOV B,#0FFHMOV 29H,#00HLCALL XISXLCALL DELAY ;显示竖线1; MOV B,#00H; MOV 29H,#0FFH; LCALL XISX; LCALL DELAY ;显示竖线2MOV DPTR,#TAB1LCALL LEFTMOV DPTR,#TAB2LCALL RIGHTLCALL DELAY ;显示第一幅图片MOV DPTR,#TAB3LCALL LEFTMOV DPTR,#TAB4LCALL RIGHTLCALL DELAY ;显示第二幅图片MOV DPTR,#TAB5LCALL LEFTMOV DPTR,#TAB6LCALL RIGHTLCALL DELAY ;显示第三幅图片AJMP L0100;=======================================================以上是主程序LEFT: MOV R1,#0B8H_AB: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序MOV R0, #64S027B: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B1 ;左半屏写数据子程序INC DPTRDJNZ R0,S027BINC R1CJNE R1, #0C0H,_ABRET;======================================================以上是左半屏写数据子程序RIGHT: MOV R1,#0B8HABC: MOV COM,R1 ;第一页LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02C1 ;右半屏写指令子程序MOV R0, #64S027D: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B9 ;右半屏写数据子程序INC DPTRDJNZ R0,S027DINC R1CJNE R1, #0C0H,ABCRET;*******************************************************以上是右半屏写数据子程序XIHX: MOV R1,#0B8HBA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #64W027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,W027BINC R1CJNE R1, #0C0H,BARET;---------------------------------------------------------XISX: MOV R1,#0B8HCA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #32X027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序MOV DAT,29HLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,X027BINC R1CJNE R1, #0C0H,CARET;****************************************************以上是显示线条程序S02A9: SETB CS1LCALL S02C9CLR CS1 ;左半屏写指令子程序RETS02B1: SETB CS1 ;左半屏写数据子程序LCALL S02E0CLR CS1RETS02C1: SETB CS2 ;右半屏写指令子程序LCALL S02C9CLR CS2RETS02B9: SETB CS2 ;右半屏写数据子程序LCALL S02E0CLR CS2RET;****************************************************S02C9: CLR RSSETB RWS02C9A: MOV P0,#0FFHSETB EMOV A, P0CLR EJB ACC.7,S02C9ACLR RWMOV P0,COMSETB ENOPCLR ERET;*************************************************以上是写指令子程序S02E0: CLR RSSETB RWS02E0A: MOV P0,#0FFHSETB EMOV A, P0CLR EJB ACC.7,S02E0ASETB RSCLR RWMOV P0,DATSETB ENOPCLR ERET;************************************************以上是写数据子程序DELAY: MOV R5,#0BH ;延时D1: MOV R7,#0FFHD2: MOV R6,#0FFHD3: DJNZ R6,$DJNZ R7,D2DJNZ R5,D1RET;****************************************************************TAB1:;-- 调入了一幅图像:C\128x64-1.bmp --;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,0C0H,0C0 HDB0E0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F 8HDB0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,07CH,078H,078H,038H,038H ,030HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,0E0H,0F0H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0F FHDB0FFH,0FFH,0FFH,0FFH,0EFH,0CFH,0E7H,0E7H,0E7H,0F3H,073H,033H,03BH,019H,00DH,0 8DHDB0CDH,0E7H,0F6H,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,03EH,01CH, 000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,0E0H,0E0H,0F0H,0F0H,0F0H,0F8H,0F9H,0FDH,0FDH,0FDH,0DFH,09FH,08EH,08FH,0 8FHDB08FH,00FH,00FH,00FH,00FH,00FH,007H,003H,001H,060H,060H,06CH,06CH,06EH,06FH,06 7HDB067H,0E7H,0F7H,0F7H,0F3H,0F3H,0F3H,0F3H,0F9H,0F9H,0F8H,0F8H,0FCH,0FCH,0FEH,0 FEHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,01FH,00FH,007H,003H,003H,00 1HDB081H,0E0H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0FEH,0FEH, 0FEHDB0FEH,0FCH,0FCH,0FCH,0F8H,0F0H,061H,001H,001H,003H,003H,007H,0DFH,0FFH,0FFH,0 FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0E0H,0C0H,0C0H,080H,000H,000H,00 0HDB003H,007H,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00 7HDB087H,087H,0C3H,0C3H,0C1H,0E0H,0F0H,0F0H,0F8H,0FCH,0FCH,0FFH,0FFH,0FFH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,0F FHDB0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH ,0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,0 0FHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,003H,00FH,07FH,0FFH,0FFH,0FF HDB0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,00FH,00FH,00FH,007H,007H,003H,00 3HDB003H,001H,001H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB2:;-- 调入了一幅图像:C:\128x64-2.bmp --;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,080H,0C0 HDB0C0H,0C0H,0E0H,0E0H,0E0H,0F0H,0F0H,0F8H,0F8H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH, 0FFHDB0FFH,0FFH,0FFH,0FEH,0F8H,0C0H,000H,000H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB030H,038H,078H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,0C0H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,080H,0C0H,0F1H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,000H,000H,000H,0 00HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,001H,001H,001H,00 1HDB0E1H,0FDH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,01FH,007H,001H,001H,001H,0C1H,0 C1HDB001H,001H,001H,007H,01FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,000H,000H,000H,000H,0E0H,0F8H,0F FHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,000H,000H,000H,000H,038H,03EH,03FH,0B FHDB0BFH,0F8H,0C0H,0C0H,0E0H,0E0H,0E7H,0FFH,0FFH,09FH,01FH,00FH,00FH,007H,007H,0 00HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB0FFH,0FFH,0FFH,0FFH,0EFH,0E1H,0E0H,0E0H,0E0H,0E0H,0E0H,0F8H,07FH,07FH,07FH,0 3FHDB03FH,03FH,07FH,07FH,07FH,078H,07CH,07CH,07CH,07EH,00EH,007H,003H,003H,003H,00 3HDB003H,003H,003H,00FH,03FH,07FH,07FH,07FH,07FH,07FH,07CH,070H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB00FH,00FH,007H,007H,003H,003H,003H,001H,001H,001H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB3:;-- 调入趣味性文字和图片像右半屏:纵向取模下高位,数据排列:从左到右从上;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,0E0H,0C0H,080H,0C0H,0F8H,0F0H,0B 0HDB060H,068H,0D0H,0F0H,0F0H,020H,020H,060H,0C0H,0C0H,0C0H,0C0H,080H,080H,080H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,0C0H,0F0H,0FCH,0EFH,0F3H,0F9H,0FCH,0F1H,07BH,07DH,0 3FHDB03EH,038H,03EH,03CH,03DH,038H,03FH,03FH,03EH,03EH,03FH,03FH,03FH,03FH,07FH,0 7FHDB0FFH,0FEH,0FEH,0FCH,0F8H,0F0H,0E0H,080H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,0E0H,0FEH,0FFH,0FFH,0FFH,07FH,007H,001H,000H,000H,008H,008H,00 8HDB010H,010H,020H,040H,000H,000H,000H,000H,000H,040H,020H,010H,010H,008H,008H,008 HDB000H,000H,001H,007H,03FH,0FFH,0FFH,0FFH,0FEH,0E0H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,080H,09FH,0FFH,0FFH,063H,061H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0D0H,08 0HDB010H,010H,020H,020H,0C0H,060H,060H,060H,0C0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0D 0HDB010H,010H,010H,020H,0E0H,060H,061H,0FFH,0FFH,09FH,080H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB006H,009H,010H,010H,020H,039H,060H,080H,001H,003H,007H,007H,007H,007H,007H,007 HDB007H,004H,004H,022H,041H,040H,040H,040H,041H,023H,007H,007H,007H,007H,007H,007 HDB007H,004H,004H,002H,001H,080H,060H,039H,020H,010H,010H,019H,0E6H,000H,004H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,080H,0C0H,0C0H,0E1H,0E2H,0E2H,0F4H,0F4H,0F4H,0F8H,0F 8HDB0F8H,0F0H,0F0H,0F0H,090H,090H,090H,090H,090H,070H,0F0H,0F0H,0E8H,0E8H,0E8H,0C 4HDB0C4H,084H,082H,002H,0FBH,0F4H,0E4H,0F4H,0FCH,004H,002H,001H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,007H,00FH,01FH,03FH,03FH,07FH,07FH,0FFH,021H,001H,003H,007 HDB00FH,09FH,0FFH,0FFH,0FFH,0FEH,0F9H,0F7H,0FEH,0F8H,0FFH,0FFH,0FFH,0FFH,0FFH,0 E7HDB00FH,00FH,01FH,01FH,03FH,03FH,03FH,03FH,01FH,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,002H,004H,004H,004 HDB002H,001H,00FH,03FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,0FCH,0F0H,060H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HTAB4:;-- 调入了一幅图像:帅呆了吧DB000H,000H,0E0H,000H,0F8H,000H,0E0H,020H,0F8H,020H,020H,0E0H,000H,000H,000H,078 HDB048H,048H,0C8H,048H,048H,078H,000H,000H,000H,000H,008H,008H,008H,008H,0C8H,048 HDB028H,018H,008H,000H,000H,0F0H,010H,0F0H,000H,0F0H,010H,010H,0F0H,010H,0F8H,010 HDB000H,000H,000H,000H,000H,000H,000H,000H,0E0H,0F0H,0F0H,0E0H,000H,000H,000H,000 HDB000H,020H,017H,008H,007H,000H,00FH,000H,03FH,000H,008H,00FH,000H,021H,011H,009 HDB005H,003H,03FH,003H,005H,009H,011H,011H,000H,000H,000H,000H,020H,020H,03FH,000 HDB000H,000H,000H,000H,000H,007H,004H,007H,000H,01FH,021H,021H,021H,021H,021H,038 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,01BH,01BH,000H,000H,000H,000H,000 HDB000H,0F4H,05CH,034H,05CH,0F4H,000H,05CH,048H,07EH,048H,048H,000H,040H,05EH,0D 4HDB054H,054H,040H,0DEH,054H,054H,052H,058H,000H,000H,002H,002H,002H,002H,0F2H,012DB00AH,006H,002H,000H,000H,0FCH,084H,084H,0FCH,000H,03AH,022H,0A2H,0FEH,022H,02 2HDB000H,000H,000H,000H,000H,000H,000H,000H,038H,0FCH,0FCH,038H,000H,000H,000H,000 HDB000H,00FH,005H,005H,005H,00FH,000H,00FH,009H,009H,009H,00FH,000H,00AH,009H,00B HDB005H,003H,000H,00FH,00AH,009H,009H,00EH,000H,000H,000H,000H,008H,008H,00FH,000 HDB000H,000H,000H,000H,000H,001H,000H,008H,009H,004H,002H,009H,008H,00FH,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,006H,006H,000H,000H,000H,000H,000 HDB000H,018H,0FFH,008H,050H,044H,044H,0FFH,044H,044H,07CH,040H,000H,020H,022H,02 AHDB0B2H,062H,0FFH,062H,0B2H,02AH,022H,020H,000H,004H,004H,0FFH,004H,004H,0FCH,00 0HDB0FCH,004H,004H,0FCH,000H,000H,000H,000H,0C1H,031H,00EH,030H,0C0H,000H,000H,00 0HDB000H,000H,000H,07CH,055H,056H,0FCH,056H,055H,054H,07CH,000H,000H,000H,000H,00 0HDB000H,000H,007H,0C4H,004H,002H,001H,0C0H,001H,002H,004H,004H,000H,002H,002H,0C 1HDB000H,000H,087H,080H,080H,0C1H,082H,002H,000H,004H,003H,080H,044H,004H,003H,000 HDB0C7H,002H,002H,007H,000H,004H,082H,001H,000H,0C0H,000H,000H,000H,0C1H,002H,00 4HDB000H,001H,001H,0C1H,041H,041H,0C7H,041H,041H,041H,0C1H,001H,000H,000H,000H,00DB000H,000H,080H,07FH,012H,012H,012H,013H,0F2H,002H,002H,002H,000H,061H,019H,0FF HDB009H,091H,07FH,000H,000H,0FFH,000H,0C0H,000H,0FFH,091H,091H,091H,0FFH,004H,00 BHDB031H,001H,001H,0FFH,000H,002H,0FFH,002H,002H,07FH,022H,022H,022H,07FH,002H,002 HDB000H,020H,020H,017H,08DH,075H,007H,005H,0FDH,015H,027H,020H,000H,000H,000H,000 HDB000H,001H,000H,000H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,001 HDB001H,000H,000H,000H,000H,001H,001H,001H,000H,001H,000H,000H,000H,001H,000H,000 HDB001H,001H,001H,000H,000H,000H,001H,001H,001H,001H,001H,001H,001H,001H,001H,001 HDB000H,000H,001H,001H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,000 HTAB5:;-- 调入图像:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64 --DB000H,000H,000H,000H,000H,000H,000H,000H,000H,0C0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F 0HDB0F0H,0F0H,0F8H,0BCH,01CH,08CH,0CEH,0CFH,0CFH,0EBH,0C9H,0D0H,090H,010H,010H, 010HDB020H,021H,061H,041H,043H,0C2H,08CH,000H,001H,001H,002H,006H,00CH,00FH,010H,03 EHDB023H,046H,085H,089H,019H,033H,066H,08DH,0DBH,0F9H,0A6H,02FH,03FH,007H,08FH,0C FHDB000H,000H,000H,080H,0E0H,0F0H,0F0H,0F0H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHDB0FFH,07FH,0FFH,0EFH,0FFH,0FFH,0FFH,0FFH,07FH,06FH,037H,01BH,00FH,007H,001H,0 0FHDB009H,00AH,00EH,006H,006H,004H,004H,00CH,008H,018H,010H,020H,060H,040H,0C0H,08 0HDB000H,000H,000H,001H,0C3H,007H,00DH,037H,022H,0C2H,083H,001H,00FH,037H,01FH,03 7HDB000H,000H,000H,0FFH,0FFH,0FFH,0FFH,01FH,006H,0C6H,0E6H,066H,07EH,0FFH,0EFH,0 D1HDB0D9H,0E9H,0E9H,0F9H,0F2H,0E6H,01CH,030H,000H,000H,000H,000H,000H,000H,000H,00 0HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001 HDB003H,0C6H,078H,0B0H,0E0H,083H,00EH,018H,0E0H,080H,003H,00EH,038H,0C0H,018H,0F 0HDB000H,000H,000H,000H,007H,00FH,01FH,01FH,01CH,0FFH,07FH,060H,038H,027H,079H,0C 1HDB0F3H,0F3H,0FFH,0FFH,078H,03FH,002H,000H,000H,000H,000H,000H,000H,000H,002H,071 HDB039H,019H,0F9H,0F9H,0F9H,0FBH,0FBH,073H,073H,0E6H,0CEH,09CH,038H,030H,000H,0 00HDB000H,01FH,0E0H,0FFH,0FFH,0FFH,0FCH,0F8H,0E0H,087H,0F8H,000H,000H,007H,0FEH,0 F1HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,07FH,0C0H,000H,000H,000H,000H,000 HDB080H,000H,000H,010H,010H,000H,020H,020H,020H,000H,000H,000H,000H,000H,01CH,03E HDB070H,07CH,07CH,078H,0FFH,0FFH,07FH,07EH,03EH,01FH,003H,003H,002H,000H,000H,00 0HDB000H,000H,000H,0FBH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,000H,000H,000H,0FFH,0 F3HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,003H,018H,0E0H,000H,000H,000 HDB003H,006H,00EH,00EH,00EH,018H,018H,018H,008H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080 HDB0C0H,0C6H,0EFH,0A7H,073H,07BH,009H,084H,0CCH,0E3H,0FFH,0F8H,0FCH,0FEH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,002H,006 HDB000H,00CH,008H,008H,000H,010H,010H,010H,010H,010H,018H,018H,008H,084H,084H,004 HDB006H,0F2H,0B2H,016H,034H,0E4H,004H,004H,004H,00CH,0CCH,08CH,01CH,018H,03FH,0 3FHDB07CH,0DEH,0DFH,0DFH,0EEH,0F7H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFHDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000 HDB000H,000H,000H,000H,000H,000H,000H,004H,004H,00EH,036H,064H,07CH,018H,001H,003 HDB00EH,000H,001H,001H,003H,001H,000H,000H,000H,000H,003H,003H,003H,001H,000H,000 HDB000H,000H,001H,007H,00FH,03FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0 FFHTAB6:;-- 调入图像:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64;-- 调入了一幅图像:我们年轻.bmp --;-- 宽度x高度=64x64 --DB000h,000h,000h,000h,000h,000h,000h,000h,080h,080h,000h,0C0h,000h,080h,000h,000h DB000h,000h,000h,000h,000h,0C0h,000h,040h,080h,000h,080h,080h,080h,000h,000h,000h DB000h,000h,0C0h,000h,000h,000h,000h,000h,000h,000h,080h,000h,000h,000h,000h,000h DB0C0h,000h,000h,000h,080h,080h,080h,080h,080h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,044h,044h,045h,025h,0FFh,014h,014h,084h,07Fh,0C4h,024h,015h,084h DB000h,000h,008h,004h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,0FFh,000h,000h,000h DB044h,042h,079h,049h,049h,049h,0FFh,049h,049h,049h,049h,041h,000h,000h,089h,08Fh DB049h,0FDh,029h,001h,028h,024h,0E2h,023h,024h,008h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,080h,080h,088h,0B2h,003h,020h,0A1h,028h,030h,020h,0E1h,022h,023h DB000h,000h,080h,040h,03Bh,020h,023h,020h,0E0h,020h,020h,022h,033h,020h,000h,000h DB020h,0E0h,038h,0A0h,020h,020h,013h,090h,050h,070h,090h,000h,000h,000h,020h,0A0h DB0A8h,0B3h,0A0h,0A2h,082h,0FAh,083h,092h,0A2h,082h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,040h,020h,01Fh,020h,050h,048h,045h,042h,045h,048h,050h,040h DB000h,000h,008h,008h,00Fh,009h,009h,009h,07Fh,009h,009h,009h,009h,008h,000h,000h DB011h,011h,009h,07Fh,005h,040h,045h,044h,07Ch,044h,044h,041h,000h,000h,020h,01Bh DB042h,07Eh,00Ah,053h,020h,01Fh,000h,07Fh,040h,070h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,040h,040h,040h,05Fh,055h,055h,0D5h,055h,05Fh,040h,040h,040h DB000h,000h,010h,011h,0F6h,000h,000h,0FCh,056h,055h,054h,05Eh,0C4h,000h,000h,000h DB010h,0D4h,014h,0FFh,094h,094h,022h,022h,0FEh,022h,022h,020h,000h,000h,008h,008hDB008h,008h,0C8h,03Fh,048h,088h,008h,008h,00Ch,008h,000h,000h,000h,000h,000h,000hDB000h,000h,000h,000h,000h,0C8h,044h,043h,0C4h,008h,0CFh,049h,049h,049h,0E9h,048h DB000h,000h,008h,084h,0C3h,0A4h,088h,00Bh,00Ah,0EAh,08Ah,08Ah,08Bh,008h,000h,000h DB08Ch,003h,004h,0E7h,008h,008h,008h,0E8h,00Bh,008h,008h,008h,000h,000h,048h,044hDB042h,041h,040h,041h,046h,040h,041h,042h,06Ch,044h,000h,000h,000h,000h,000h,000hDB000h,000h,000h,000h,000h,0FFh,022h,025h,018h,000h,0FFh,044h,044h,044h,0FFh,000hDB000h,000h,000h,0FFh,088h,088h,0FFh,002h,005h,018h,080h,000h,0FFh,000h,000h,000hDB020h,013h,008h,0FFh,002h,002h,002h,0FFh,002h,002h,002h,002h,000h,000h,000h,0FFhDB009h,011h,0FFh,000h,000h,0FFh,009h,011h,0FFh,000h,000h,000h,000h,000h,000h,000hDB 000h,000h,000h,000h,000h,001h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB 000h,000h,000h,001h,000h,000h,001h,000h,000h,000h,000h,001h,000h,000h,000h,000h DB 000h,000h,000h,001h,000h,001h,001h,001h,001h,001h,001h,000h,000h,000h,000h,001h DB 000h,001h,001h,000h,000h,001h,000h,001h,001h,000h,000h,000h,000h,000h,000h,000h END上传两个显示画面液晶屏是朋友托卖的,无背光无字库,带负压产生电路,有些成色比较新,先到先得了,45RMB一块,送资料,驱动程序,QQ以下是程序//**************************************;* 控制器:KS0107 *;* LCD型号:TS12864A-2或兼容型号 *;* MCU:AT89S5* ,晶体频率:11.0592MHz *;* 取模方式:纵向字节倒序 *;* CS1和CS2为高电平有效 * *;***************硬件端口定义***********RS EQU P2.4RW EQU P2.3E EQU P2.2CS1 EQU P2.7CS2 EQU P2.6RST EQU P2.5BUF EQU P0;******************************************COM EQU 20H ;指令数据寄存器DAT EQU 21H ;显示数据寄存器;**********************************主程序入口地址ORG 0000HAJMP STRORG 0003H;*********************************中断程序入口地址STR:AJMP L0100L0100: CLR RSTNOPNOPSETB RST;********************************以上是软件复位MOV SP,#60HMOV IE,#81H ;中断允许MOV IP,#01H ;优先中断MOV TCON,#00H ;电平中断MOV COM,#3FH ;显示开LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#0C0H ;第一行LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#0B8H ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;---------------------------------------------------------------------- MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序;********************************************************以上是软件初始化MOV B,#0AAHLCALL XIHX ;显示横线1LCALL DELAYMOV B,#55HLCALL XIHXLCALL DELAY ;显示横线2MOV B,#0FFHMOV 29H,#00HLCALL XISXLCALL DELAY ;显示竖线1MOV B,#00HMOV 29H,#0FFHLCALL XISXLCALL DELAY ;显示竖线2MOV DPTR,#TAB1LCALL LEFTMOV DPTR,#TAB2LCALL RIGHTLCALL DELAY ;显示第一幅图片MOV DPTR,#TAB3LCALL LEFTMOV DPTR,#TAB4LCALL RIGHTLCALL DELAY ;显示第二幅图片MOV DPTR,#TAB5LCALL LEFTMOV DPTR,#TAB6LCALL RIGHTLCALL DELAY ;显示第三幅图片AJMP L0100;=======================================================以上是主程序LEFT: MOV R1,#0B8H_AB: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序MOV R0, #64S027B: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B1 ;左半屏写数据子程序INC DPTRDJNZ R0,S027BINC R1CJNE R1, #0C0H,_ABRET;======================================================以上是左半屏写数据子程序RIGHT: MOV R1,#0B8HABC: MOV COM,R1 ;第一页LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02C1 ;右半屏写指令子程序MOV R0, #64S027D: MOV A,#00HMOVC A,@A+DPTRMOV DAT,ALCALL S02B9 ;右半屏写数据子程序INC DPTRDJNZ R0,S027DINC R1CJNE R1, #0C0H,ABCRET;*******************************************************以上是右半屏写数据子程序XIHX: MOV R1,#0B8HBA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #64W027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,W027BINC R1CJNE R1, #0C0H,BARET;--------------------------------------------------------- XISX: MOV R1,#0B8HCA: MOV COM,R1 ;第一页LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV COM,#40H ;第一列LCALL S02A9 ;左半屏写指令子程序LCALL S02C1 ;右半屏写指令子程序MOV R0, #32X027B: MOV DAT,BLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序MOV DAT,29HLCALL S02B1 ;左半屏写数据子程序LCALL S02B9 ;右半屏写数据子程序DJNZ R0,X027BINC R1CJNE R1, #0C0H,CARET;****************************************************以上是显示线条程序S02A9: SETB CS1LCALL S02C9CLR CS1 ;左半屏写指令子程序RETS02B1: SETB CS1 ;左半屏写数据子程序LCALL S02E0CLR CS1RETS02C1: SETB CS2 ;右半屏写指令子程序LCALL S02C9CLR CS2RETS02B9: SETB CS2 ;右半屏写数据子程序LCALL S02E0CLR CS2RET;****************************************************S02C9: CLR RSSETB RWS02C9A: MOV BUF,#0FFHSETB EMOV A, BUFCLR EJB ACC.7,S02C9ACLR RWMOV BUF,COMSETB ENOPCLR ERET;*************************************************以上是写指令子程序S02E0: CLR RSSETB RWS02E0A: MOV BUF,#0FFHSETB EMOV A, BUFCLR EJB ACC.7,S02E0ASETB RSCLR RWMOV BUF,DATSETB ENOPCLR ERET;************************************************以上是写数据子程序DELAY: MOV R5,#0BH ;延时D1: MOV R7,#0FFHD2: MOV R6,#0FFHD3: DJNZ R6,$DJNZ R7,D2DJNZ R5,D1RET;****************************************************************TAB1:;-- 调入菲戈幅图像左半屏:纵向取模下高位,数据排列:从左到右从上到下;-- 宽度x高度=64x64DB000h,000h,000h,040h,080h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,010h DB060h,080h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FCh,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,0C0h,030h,008h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,080h,040h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,001h,002h,004h,008h,010h,020h,040h,080h,000h,000h,000h DB000h,001h,006h,018h,060h,080h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h DB000h,000h,000h,000h,000h,0C0h,030h,00Ch,003h,000h,000h,000h,000h,080h,040h,020h DB010h,008h,004h,002h,001h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB002h,002h,004h,004h,008h,008h,010h,010h,020h,020h,040h,040h,080h,081h,002h,004h DB008h,010h,020h,040h,080h,001h,006h,018h,020h,000h,000h,000h,080h,09Fh,080h,000h DB000h,040h,030h,00Ch,003h,080h,040h,020h,010h,008h,004h,002h,001h,000h,000h,080h DB080h,040h,040h,020h,020h,010h,010h,010h,008h,008h,004h,004h,002h,002h,000h,000h000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,001h,001h DB002h,002h,004h,004h,008h,009h,000h,030h,0CCh,002h,001h,001h,000h,000h,000h,001h DB001h,002h,0CCh,030h,001h,000h,008h,008h,004h,004h,002h,002h,001h,001h,001h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,004h,018h DB060h,080h,000h,000h,000h,000h,000h,000h,000h,001h,002h,002h,084h,0FCh,044h,042h DB022h,021h,020h,020h,010h,010h,010h,060h,080h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,003h,004h,004h,002h,002h,002h,001h,001h,001h,001h,000h,0FFh,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,001h,006h,008h,010h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h DB000h,000h,080h,080h,040h,040h,020h,020h,010h,010h,008h,008h,004h,00Fh,010h,020h。
LCD12864液晶显示器C51单片机子程序
#include <reg52.h>#ifndef __LCD12864_H__#define __LCD12864_H__#include <intrins.h>#define uchar unsigned char#define uint unsigned int/*端口定义*/#define LCD_data P0 //数据口sbit LCD_RS = P2^7; //寄存器选择输入sbit LCD_RW = P2^6; //液晶读/写控制sbit LCD_EN = P2^5; //液晶使能控制sbit LCD_PSB = P1^4; //串/并方式控制#define delayNOP(); {_nop_();_nop_();_nop_();_nop_();};/* 延时函数*/void delay1(int ms){while(ms--){uchar i;for(i=0;i<250;i++){_nop_();_nop_();_nop_();_nop_();}}}/*检查LCD忙状态*/ /*lcd_busy为1时,忙,等待。
lcd-busy为0时,闲,可写指令与数据。
*/ bit lcd_busy(){bit result;LCD_RS = 0;LCD_RW = 1;LCD_EN = 1;delayNOP();result = (bit)(P0&0x80);LCD_EN = 0;return(result);/*写指令到LCD */ /*RS=L,RW=L,E=高脉冲,D0-D7=指令码。
*/ void lcd_wcmd(uchar cmd){//while(lcd_busy());LCD_RS = 0;LCD_RW = 0;LCD_EN = 0;_nop_();_nop_();P0 = cmd;delayNOP();LCD_EN = 1;delayNOP();LCD_EN = 0;}/*写数据到LCD */ /*RS=H,RW=L,E=高脉冲,D0-D7=数据。
LCD12864液晶显示器模块化程序51单片机
LCD12864 液晶显示器模块化程序(51单片机)/**********************lcd12864.h 头文件**********************/#ifndef _LCD12864_H_#define _LCD12864_H_extern void lcd12864_busy(); //忙标志函数extern void led12864_clear();//清屏extern void lcd12864_init(); //初始化函数extern void lcd12864_pxy(unsigned char p,unsigned char x,unsigned char y);//数据的显示位置,p=0左半屏,p=1右半屏,p=2两半屏全选,xy为显示的坐标,第四象限,用正值表示。
extern void lcd12864_zifu(unsigned char p,unsigned char x,unsigned char,unsigned char m);//第m个字符的显示位置,与汉字的定义一样,只是xy的坐标的值应小于等于7.extern void lcd12864_hanzi(unsigned char p,unsigned char x,unsigned char y,unsigned char m);//第m个汉字的显示位置,p=0左半屏,p=1右半屏,p=2两半屏全选,xy为显示的坐标,第四象限,用正值表示,x或y的值都应小于等于3。
m为显示的第m个汉字。
#endif/**********************lcd12864.c 文件**********************/#include;#define uint unsigned int#define uchar unsigned charsbit cs2=P2^0;sbit cs1=P2^1;sbit e=P2^2;sbit rw=P2^3;sbit rs=P2^4;uchar code zifu[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,//,00x00,0x00,0x58,0x38,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//。
12864点阵型驱动程序(51单片机、c语言)
** 功能描述:在液晶显示器上写一个ASCII字符,写之前需要使用setxy()函数确定位置
** 输入参数:uchar ascii:字符对应的ascii码
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/
** 功能描述:C语言下最精确最简单的延时函数,延时时间为2*t+2(us)
** 输入参数:t-延时时间参数
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/
void setp(uchar n)
{
switch(n){
case 0: cs1=1;cs2=1; break;
case 1: cs1=1;cs2=0; break;
case 2: cs1=0;cs2=1; break;
default:break;}
}
/*********************************************************
** 输入参数:uchar dat
** 输出参数:
** 返 回 值:
** 作 者:xiwangcumt
** 日 期:
**********************************************************/
基于C51的LCD12864液晶动画显示
成绩课程论文题目:基于C51的LCD12864液晶动画显示课程名称:Proteus学生姓名:王文奇学生学号:1114210132系别:电气信息工程学院专业:自动化年级:2011(3)任课教师:王丽电气信息工程学院制2015年1月基于C51的LCD12864液晶动画显示学生:王文奇指导教师:王丽电气信息工程学院自动化专业1.主要芯片简介1.1 AT89C51单片机简介AT89C51是美国ATMEL公司生产的低电压,高性能CMOS 8位单片机,片内含4k bytes的可反复擦写的Flash只读程序存储器和128 bytes的随机存取数据存储器(RAM ),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51指令系统,片内置通用8位中央处理器(CPU)和Flash存储单元,功能强大的AT89C51单片机能应用许多高性价比的场合,可灵活应用于各种控制领域。
图1 AT89C51封装图主要性能参数(1)主要特性:·4K字节可编程闪烁存储器;·全静态工作:0Hz-24Hz·三级程序存储器锁定·128*8位内部RAM·32可编程I/O线·两个16位定时器/计数器·5个中断源·可编程串行通道·低功耗的闲置和掉电模式·片内振荡器和时钟电路(2)部分管脚说明:VCC:供电电压。
GND:接地。
P0口:P0口为一个8位漏级开路双向I/O口,每脚可吸收8TTL门电流。
P1口:P1口是一个内部提供上拉电阻的8位双向I/O口,P1口缓冲器能接收输出4TTL门电流。
P2口:P2口为一个内部上拉电阻的8位双向I/O口,P2口缓冲器可接收.P3口:P3口管脚是8个带内部上拉电阻的双向I/O口,可接收输出4个TTL门电流。
RST:复位输入。
当振荡器复位器件时,要保持RST脚两个机器周期的高电平时间。
ALE/PROG:当访问外部存储器时,地址锁存允许的输出电平用于锁存地址的地位字节。
LCD19264的驱动程序
LCD19264的驱动程序#include "Public.h"#define Fisrt 01#define Second 02#define Third 03/*定义LCD控制端口*/sbit LCD_RS = P0^7;sbit LCD_RW = P0^6;sbit LCD_CE = P0^5;sbit LCD_CSA = P0^4;sbit LCD_REST = P0^3;sbit LCD_CSB = P0^2;sbit LCD_CSC = P0^1;#define DATA_BUS P2/************************************************************** *****函数功能说明:判断LCD忙函数1、2、3、*************************************************************** ****/void Read_busy(unsigned char Area){unsigned char temp = 0;do{LCD_CE = 0;LCD_RS = 0; switch(Area){case Fisrt:LCD_CSA = 0; break;case Second: LCD_CSB = 0; break;case Third:LCD_CSC = 0; break;default:break;}_nop_();LCD_CE = 1;_nop_();temp = DATA_BUS; LCD_CE = 0;LCD_RW = 0; switch(Area){case Fisrt:LCD_CSA = 1; break;case Second: LCD_CSB = 1; break;case Third:break;default:break;}LCD_CE = 1;}while(temp&0x80);}/************************************************************** *****函数功能说明:设置坐标1、液晶分为三个区 A、B、C2、设置每个区的坐标3、送坐标到总线上*************************************************************** ****/void Set_Locatexy(unsigned char x_add,unsigned char y_add) {switch(x_add&0xc0){case 0x00:Write_command(Fisrt,x_add&0x3f)break;case 0x40:break;case 0x80:break;default:break;}/************************************************************** *****函数功能说明:写数据1、液晶分为三个区 A、B、C2、设置每个区的片选信号3、送数据到总线上*************************************************************** ****/void Write_data(unsigned char Area_Num,unsigned char Lcd_data){Read_busy(Area_Num);LCD_CE = 0; /*写入到LCM*/LCD_RW = 0;LCD_RS = 1; //数据switch(Area_Num){case Fisrt:LCD_CSA = 0;break;case Second:LCD_CSB = 0;break;case Third:LCD_CSC = 0;break;default:break;_nop_();LCD_CE = 1;_nop_();DATA_BUS = Lcd_data;_nop_();_nop_();LCD_CE = 0;LCD_RW = 1;switch(Area_Num){case Fisrt:LCD_CSA = 1;break;case Second:LCD_CSB = 1;break;case Third:LCD_CSC = 1;break;default:break;}LCD_CE = 1;}/************************************************************** *****函数功能说明:写命令1、液晶分为三个区 A、B、C2、设置每个区的片选信号3、送命令到总线上*******************************************************************/void Write_command(unsigned char Area_Num,unsigned char Lcd_Command){Read_busy(Area_Num);LCD_CE = 0; /*写入到LCM*/LCD_RW = 0;LCD_RS = 0; //指令switch(Area_Num){case Fisrt:LCD_CSA = 0;break;case Second:LCD_CSB = 0;break;case Third:LCD_CSC = 0;break;default:break;}_nop_();LCD_CE = 1;_nop_();DATA_BUS = Lcd_Command;_nop_();_nop_();LCD_CE = 0;LCD_RW = 1;switch(Area_Num){case Fisrt:LCD_CSA = 1;break;case Second:LCD_CSB = 1;break;case Third:LCD_CSC = 1;break;default:break;}LCD_CE = 1;}void Lcminit( void ){LCD_REST = 0;_nop_();LCD_REST = 1;Write_command(Fisrt,0x40); Write_command(Second,0x40); Write_command(Third,0x40);Write_command(Fisrt,0xb8); Write_command(Second,0xb8); Write_command(Third,0xb8);Write_command(Fisrt,0xc0);Write_command(Second,0xc0); Write_command(Third,0xc0);Write_command(Fisrt,0x3f); Write_command(Second,0x3f); Write_command(Third,0x3f); }。
基于51单片机的LCD12864程序设计
基于51单片机的LCD12864程序设计作者:张玲玲来源:《中小企业管理与科技·上中下旬刊》 2015年第5期张玲玲(郴州职业技术学院电子信息工程专业)摘要液晶显示器分为段位式LCD、字符式LCD 和点阵式LCD,具有机身薄,节省空间,省电,不产生高温,低辐射,益健康,画面柔和不伤眼等诸多优点,已经广泛的应用于各个领域。
本文通过51 单片机控制系统控制点阵式LCD12864 显示来介绍LCD12864 的工作原理及LCD12864 的驱动程序设计编写方法。
关键词 51 单片机 LCD12864 程序设计0 引言液晶显示器根据显示方式可分为:段位式、字符式和点阵式LCD,其中段位式与字符式只能显示数字与字符。
而点阵式LCD 不仅能显示数字与字符,还能显示各种图形、曲线及汉字等。
本文研究的TG12864B是能显示曲线、图形及汉字的点阵式LCD。
1 TG12864 介绍TG12864 是一款无字库的图形点阵显示器,其屏幕由64 行×128 列点阵组成,可以显示16 点阵的4 行×8列(32 个)汉字、8 点阵的8 行×8 列(64 个)字母和128×64 全屏幕点阵图形。
1.1 TG12864B 内部功能器件介绍在使用TG12864B 前须了解其相关功能器件,如下所示:①指令寄存器(IR):用于寄存指令码。
②数据寄存器(DR):用于寄存数据的。
DR 和显示数据存储器DDRAM(见表1)之间的数据传输是模块内部自动执行的。
③显示数据RAM (DDRAM):DDRAM 是存储图形显示数据的。
数据为1 表示显示选择,数据为0 表示显示非选择。
DDRAM 与地址和显示位置的关系见DDRAM 地址表。
④XY 地址计数器。
XY 地址计数器是一个9 位计数器。
高3位是X 地址计数器,低6 位为Y 地址计数器,XY 地址计数器实际上是作为DDRAM 的地址指针,X 地址计数器为DDRAM 的页指针,Y 地址计数器为DDRAM 的Y 地址指针。
51单片机控制LCD12864液晶屏显示图形菜单
51单片机控制LCD12864液晶屏显示图形菜单想了很久,每次做菜单都受限于12864字符模式的各种限制,比如字体大小,不能显示图标等等,没有任何效果,这次就来个彻底的解脱,写一个单函数就能完成所有功能的函数,只需要2个图片就能完成任意菜单内容的菜单,可以有2的8次方=256个选择结果,应该能满足所有的要求了吧?菜单的内容就是图片的内容,因此可以显示任意大小的图形文字混合的菜单条目,比如使用字符模式,一屏只能显示4行菜单(64/16=4),且只能显示汉字和字符等,显示位置等等的都受限,而这个方法可以显示比如12*12(64/12=5行)的字符,8*8(64/8=8行)的字符,甚至不是字符,可以是图标+文字+任意其他的图像,只要是图片能显示的,都可以。
哈哈,比较复杂,现在只写了一少半,预期能够提供多种显示效果,希望我能完成。
void Lcd_Draw_BmpMenu(UINT8 *pMenu,UINT8*pTitleBmp,UINT8 *pMenuBmp){/*使用2张图片作为纯图形菜单来选择和操作,返回被选择的项,pMenu是一个指向菜单的各种参数的结构体的指针,pTitleBmp指向作为菜单标题的一张图片,pMenuBmp指向作为菜单内容的图片(液晶的控制芯片是ST7920)yx-->;>;|\|/*/xdata struct { //除非另有说明x坐标均为大列的坐标,一个大列是16个像素,一行共有8大列数据//========= 以下是入参基本参数,一旦确定,最好不要随意更改 ======UINT8 Title_x;//标题图片在屏幕上的显示起始位置X UINT8 Title_y;//标题图片在屏幕上的显示起始位置Y UINT8 Title_Len_x;//标题图片的宽UINT8 Title_Len_y;//标题图片的高UINT8 Menu_x;//菜单在屏幕上的显示起始位置XUINT8 Menu_y;//菜单在屏幕上的显示起始位置YUINT8 Menu_End_y;//菜单在屏幕上的显示结束位置Y UINT8 Menu_Bmp_x;//菜单图片的宽UINT8 Menu_Bmp_y;//菜单图片的高UINT8 Menu_Item_Height;//每一菜单项的高度(像素为单位)UINT8 Line_x;//最后下划线的起始坐标xUINT8 Line_y;//最后下划线的起始坐标YUINT8 Line_Len;//最后下划线的长度,如果为0,则表示不画出这条线(像素为单位)//====== 以下是菜单的风格设置 ========UINT8 Scroll_Speed;//菜单滚动的速度,0~9个级别,越低越快,越高越慢(液晶屏显示速度有快有慢,调整这个参数用于适用不同的液晶屏UINT8 Continue_Scroll;//指定菜单是否可以形成一个连续滚动选择的效果;0不连续,背景和反白位置都会根据实际情况滚动 1菜单连续滚动,反白位置不动UINT8 RePaint;//=0不重画菜单,=1重画整个菜单的图像,一般都是首次调用本函数的时候置1,用于画出整个菜单,以后调用置0就可以了UINT8 MenuEffect;//菜单运动的效果;0没有任何效果,只是最普通的菜单形态,1平滑滚动,2平滑滚动,具有惯性效果,3具有减速效果,没有惯性效果,4具有减速和惯性效果//====== 以下用于控制菜单的选择参数 =======UINT8 Last_Select_Item;//上次执行本函数后,所选择的菜单项UINT8 Select_Item;//本次执行本函数,要选择的菜单项}M;//============== 以下是变量定义 =============== UINT8 xdata Menu_Item_Count;//总共有几个菜单项UINT8 xdata Menu_Screen_Count;//当前一屏最多可以显示几个菜单项UINT8 xdataMenu_Box_x,Menu_Box_y,Menu_Box_End_x,Menu_Box_End _y;//需要刷新的区域的坐标UINT8 *pMenu_Box_Bmp;//需要显示的菜单项的指针StructCopy(&M.Title_x,pMenu,19);//把参数复制到本函数内,便于操作Menu_Item_Count=M.Menu_Bmp_y/M.Menu_Item_Height;/ /总共有几个菜单项Menu_Screen_Count=(M.Menu_End_y-M.Menu_y)/M.Menu_ Item_Height;//一屏最多可以显示多少项菜单//---------------------------------------------------------------------------if(M.RePaint==1)//如果需要重画整个菜单图像{Lcd_Draw_BMP(M.Title_x,M.Title_y,M.Title_x+M.Title_Len_x,M.Title_y+M.Title_Len_y,pTitleBmp);//画出标题的图片if(M.Line_Len!=0)Lcd_DrawRowLine(M.Line_x,M.Line_y,M.Line_Len,1);/ /画出最下面的线}//---------------------------------------------------------------------------//-----------需要刷新的图像的区域Menu_Box_x=M.Menu_x;Menu_Box_y=M.Menu_y;Menu_Box_End_x=M.Menu_x+M.Menu_Bmp_x;Menu_Box_End_y=M.Menu_End_y;。
12864液晶屏驱动程序
BMPwith=*PicData;
PicData++;
BMPheight=(*PicData)/8;
PicData++;
//BMPLen=BMPheight/8*BMPwith
for(BMPheightLen=0;BMPheightLen<BMPheight;BMPheightLen++)
Series = Series << 1;
}
}
/***********************************
** 函数名称: Write_Data
** 功能描述: 传送数据
** 输 入: dat
** 输 出 : 无
** 全局变量:无
** 调用模块: Busy,
******************************************/
//图像反色显示 0 否 1是
bit LCD_DisplayReserve_Driver;
//定义LCD显示的全局变量
#define CS_Port P3_0
#define A0_Port P3_1
#define SI_Port P3_2
{
switch (PIN)
{
case CS :
CS_Port=1;
break;
case A0 :
A0_Port=1;
break;
case SI :
SI_Port=1;
break;
case SCL :
SCL_Port=1;
c51驱动19264液晶软件
sbit Led1 = P0^0;
sbit Led2 = P0^1;
sbit an1 = P1^0;
sbit key = P2^0;
uint hanzi_ascii;
uint zimu_ascii;
uchar tab_ascii[]="0123456789ABCDEF-";
uchar xdata tab_hanzi[]=
{
0x43,0xD3,0xEF,0xD1,0xD4,0xCA,0xC7,0xD4,0xDA,0x37,0x30,0xC4,0xEA,0xB4,0xFA,0xB3,
0xA8,0xB9,0xAB,0xCB,0xBE,0x28,0x41,0x54,0x26,0x54,0x29,0xB1,0xB4,0xB6,0xFB,0xCA,
0xB5,0xD1,0xE9,0xCA,0xD2,0xD5,0xFD,0xCA,0xBD,0xB7,0xA2,0xB1,0xED,0xC1,0xCB,0x43,
{
if((m>63)&&(m<128))chispselect(1); //选屏
void cmdwrite(uchar cmdcode)//3
{
RS=0;
RW=0;
LCD_BUS=cmdcode;
EN=1;
EN=0;
}
/*-----------------------写数据--------------------------------------*/
void Clearscr()
{
uchar i,j,k;
12864 LCD驱动程序
/*LCD.C128×64 LCD驱动程序*/#include <INTRINS.H>#include <ABSACC.H>#include "LCD.H"//定义屏幕光标(取值0~63,光标本身不可见)unsigned char LcdCursor;/*函数:LcdLightOn()功能:点亮背光灯*/void LcdLightOn(){LCD_BL = 1;}/*函数:LcdLightOff()功能:熄灭背光灯*/void LcdLightOff(){LCD_BL = 0;}/*函数:LcdGetBF()功能:读出状态位BF返回:BF=1,表示忙,不可进行任何操作BF=0,表示不忙,可以进行正常操作*/bit LcdGetBF(){unsigned char dat;dat = XBYTE[0xD002]; //XBYTE的定义见<ABSACC.H>return (bit)(dat & 0x80);}/*函数:LcdWriteCmd()功能:向LCD发送命令参数:cmd:命令字,详见器件的数据手册*/void LcdWriteCmd(unsigned char cmd){while ( LcdGetBF() );XBYTE[0xD000] = cmd;}/*函数:LcdWriteDat()功能:向LCD写入数据参数:dat,要写入的数据说明:目标地址由地址计数器AC隐含指定,写完后AC自动加1*/void LcdWriteDat(unsigned char dat){while ( LcdGetBF() );XBYTE[0xD001] = dat;}/*函数:LcdReadDat()功能:从LCD读出数据返回:读出的数据*//*unsigned char LcdReadDat(){volatile unsigned char dat;while ( LcdGetBF() );dat = XBYTE[0xD003];dat = XBYTE[0xD003]; //需要连续执行两次才能够读出真正的数据return dat;}*//*函数:LcdSetAC()功能:设置DDRAM(显示数据RAM)的AC(地址计数器)值参数:ac:地址计数器值,范围0~63*/void LcdSetAC(unsigned char ac){ac &= 0x3F;ac |= 0x80;LcdWriteCmd(ac);}/*函数:LcdClear()功能:LCD清屏,并使光标回到0*/void LcdClear(){LcdWriteCmd(0x01); //清屏命令LcdCursor = 0;}/*函数:LcdDelay()功能:延时(t*100)个机器周期*/void LcdDelay(unsigned char t){unsigned char n;do{n = 49;while ( --n != 0 );} while ( --t != 0 );}/*函数:LcdInit()功能:LCD初始化*/void LcdInit(){LcdWriteCmd(0x30); //设置基本指令集LcdDelay(3);LcdWriteCmd(0x30); //设置基本指令集(需要再执行一次)LcdDelay(1);LcdWriteCmd(0x0C); //开启显示LcdDelay(3);LcdClear(); //清屏LcdDelay(250);LcdWriteCmd(0x06); //设置进入点LcdDelay(10);}/*函数:LcdCheckAC()功能:根据光标位置调整AC*/void LcdCheckAC(){switch ( LcdCursor ){case 16:LcdSetAC(16);break;case 32:LcdSetAC(8);break;case 48:LcdSetAC(24);break;case 64:LcdCursor = 0;LcdSetAC(0);break;default:break;}/*函数:LcdPutChar()功能:显示ASCII码参数:c为可显示的ASCII码(0x20~0x7F)*/void LcdPutChar(unsigned char c){LcdWriteDat(c);LcdCursor++;LcdCheckAC();}/*函数:LcdPutHZ()功能:显示汉字参数:ch,cl:汉字编码*/void LcdPutHZ(unsigned char ch, unsigned char cl){if ( LcdCursor & 0x01 ){//显示汉字时,必须偶地址对准,即光标位置不能是奇数LcdPutChar(' '); //额外输出一个空格}LcdWriteDat(ch);LcdWriteDat(cl);LcdCursor += 2;LcdCheckAC();}/*函数:LcdPuts()功能:显示字符串参数:*s:要显示的字符串(可同时包含ASCII码和汉字)*/void LcdPuts(unsigned char *s){unsigned char ch, cl;for (;;){ch = *s++;if ( ch == '\0' ) break;if ( ch < 0x80 ){LcdPutChar(ch);}else{cl = *s++;LcdPutHZ(ch,cl);}}}。
LCD12864液晶显示原理电路图程序
LCD12864系列点阵型液晶显示模块使用说明书一、OCM12864液晶显示模块概述1.OCM12864液晶显示模块是128×64点阵型液晶显示模块,可显示各种字符及图形,可与CPU直接接口,具有8位标准数据总线、6条控制线及电源线。
采用KS0107控制IC。
2.外观尺寸:113×65×11mm(ocm12864-1), 93×70×10mm(ocm12864-2)78×70×10mm(ocm12864-3),3.视域尺寸:×38.8mm(ocm12864-1) ×38mm(ocm12864-2),64×44mm(ocm12864-3)4.重量:大约g补充说明:外观尺寸可根据用户的要求进行适度调整。
二、最大工作范围1、逻辑工作电压(Vcc):~2、电源地(GND):0V3、LCD驱动电压(Vee):0~-10V4、输入电压:Vee~Vdd5、工作温度(Ta):0~55℃(常温) / -20~70℃(宽温)6、保存温度(Tstg):-10~65℃三、电气特性(测试条件 Ta=25,Vdd=+/1、输入高电平(Vih):2、输入低电平(Vil):3、输出高电平(Voh):4、输出低电平(Vol):5、工作电流:四、接口说明12864-3A接口说明表管脚号管脚电平说明CODE: R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0L H D7D6D5D4D3D2D1D0功能:写数据到DD RAM,DD RAM是存储图形显示数据的,写指令执行后Y地址计数器自动加1。
D7-D0位数据为1表示显示,数据为0表示不显示。
写数据到DD RAM前,要先执行“设置页地址”及“设置列地址”命令。
7、读显示数据CODE: RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0H H D7D6D5D4D3D2D1D0功能:从DD RAM读数据,读指令执行后Y地址计数器自动加1。
基于51单片机的12864LCD显示驱动
基于51单片机的12864LCD显示驱动摘要:利用51单片机对12864LCD显示屏进行驱动,并令其显示动态及静态图像。
可使用4位/8位并行、2线或3线串行多种接口方式,拥有多种字库的点阵图形液晶显示模块;接口方式灵活,操作指令简单、方便,可构成全中文人机交互图形界面。
可以显示汉字,也可完成图形显示;电压、功耗较低;硬件电路结构与显示程序都要简洁,同时价格也略低于相同点阵的图形液晶模块。
关键词:51单片机12864LCD 显示屏动态静态图像引言带中文字库的TS128X64(图1)具有4位/8位并行、2线或3线串行多种接口方式,引脚功能见图2。
其内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64,内置8192个16*16点汉字,和128个16*8点ASCII字符集。
图1 TS12864液晶实物图该模块接口方式灵活和操作指令简单、方便,可构成全中文人机交互图形界面。
可以显示8×4行16×16点阵的汉字。
也可完成图形显示,有低电压低功耗的特点。
由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构还是显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。
本设计讲采用STC89C52对TS128X64进行驱动,设计并制作LCD驱动电路,使其可通过按键切换LCD的显示内容,并且实现对数字,汉字,英文以及图片的显示,滚屏,以及动画功能。
1.硬件设备STC89C52是STC公司生产的一种低功耗、高性能CMOS8位微控制器,具有8K 在系统可编程Flash存储器。
STC89C52使用经典的MCS-51内核,但做了很多的改进使得芯片具有传统51单片机不具备的功能。
在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得STC89C52为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。
具有以下标准功能:8k字节Flash,512字节RAM,32 位I/O 口线,看门狗定时器,内置4KB EEPROM,MAX810复位电路,3个16 位定时器/计数器,4个外部中断,一个7向量4级中断结构(兼容传统51的5向量2级中断结构),全双工串行口。