KS0107 KS0108控制的19264液晶驱动程序C51示例

合集下载

C51单片机模块驱动程序参考

C51单片机模块驱动程序参考
{0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46
};定义在函数外部
unsigned char Key_ASC2(unsigned char key)
{
unsigned char key_asc2;
{
StartI2C();
Write8Bit(0xA2);
ChackAck();
Write8Bit(RomAddress);
ChackAck();
StartI2C();
Write8Bit(0xA3);
ChackAck();
for(;bytes!=1;bytes--)
{
*RamAddress=Read8Bit();
i=*ptr;
i &=பைடு நூலகம்0x80;
if(i==0)
break;
}
}
函数功能描述:向1602指令寄存器写指令;
void WriteW(uint a)
{
ptr=0xAFF0;//RS=0,R/W=0
*ptr=a;
}
函数功能描述:LCD初始化;
void LCD_Init(void)
{
CheckBF();
WriteW(0x38);
函数功能描述:键盘初始化,将标志位置1;
void Key_Init(void)
{
bKeyUp_Flag=1;//标志(全局变量)位置1
}
函数功能描述:键盘扫描函数,得到键的行列位置;
unsigned char GetScanKey(void)
{
unsigned char key, i, temp;

KS0107_KS0108控制器

KS0107_KS0108控制器
* 功能 : 全部清除KS0108显示存储器
* 输入 : 无
* 输出 : 无
***********************************************************************/
void Clr_Screen(void)
{
unsigned char j,k;
{
unsigned char j,k;
CSA=1;
CSB=0;
for(k=hang;k<=hang+1;k++)
{
Write_0108_Reg(Set_Page+k);
Write_0108_Reg(Set_Column);
for(j=0;j<64;j++) Write_0108_Data(0x00);
{
CSA=1;
CSB=0;
}
Write_0108_Reg(0x40+Y);
Write_0108_Reg(0xB8+1+X); //set page address
for(i=0;i<16;i++,p++)
{
if(i==n+1)
{
CSA=0;
* 创建人 : 银剑
* 创建时间: 2011年11月5日
* 版本号 : 2.0
* C51编译器 Keil 7.08
* 最高晶振:22.1184M
***********************************************************************/

北京青云液晶屏LCM19264C

北京青云液晶屏LCM19264C
指令/数据选择 当 RS 是 Low 时,MCU 会存取指令数据,而当 RS 是 High 时,MCU 会存取显示 RAM 的数据。 读取/写入信号(R/W),高电位时表示为读取的动 作,低电位时表示为写入的动作。 E为Enable信号。 R/W 为 L 时,在 E 的下降沿写入数据; R/W为H时,在E为高电平时读出数据;
北京青云创新科技发展有限公司
TEL : 010-62168698
Page 9
北京青云创新
图形点阵模块
LCM19264C
Mar27 ,2006
读操作时序
MPU Read Timing
-------------------------------------------------------------------------------------------------------------------------------------------------
黑白模式(白底黑字,蓝底黑字),6:00 视角,正向显示; 3. LED 背光; 4. 工作电压:5V,工作电流:11mA(典型值); 5. 控制器KS0108,芯片封装COB。
-------------------------------------------------------------------------------------------------------------------------------------------------
北京青云创新科技发展有限公司
TEL : 010-62168698
Page 8
北京青云创新
图形点阵模块
读写操作时序
LCM19264C
Mar27 ,2006

19264显示驱动程序

19264显示驱动程序

19264控制器KS0108#include <at89x52.h>#include <intrins.h>#include "zimo.h"#define RS P2_6 /*"H" is send or read the data;"L" is the instruction*/ #define RW P3_6#define E P2_5 /*Operation enable*/#define CS1 P2_4#define CS2 P2_3#define CS3 P2_2#define DATA P0#define uchar unsigned char#define uint unsigned int/* -------------------------------------------------Delay some time----------- */void delay10ms(unsigned char x){unsigned char i,j,k;for(i=0;i<x;i++)for(j=0;j<10;j++)for(k=0;k<120;k++);}/* -------------------------------------------------Send the instruction to the First KS0108 window--*/void OutFI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS1=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS1=1;E=1;}/* ------------------------------------------------- Send the instruction to the Second KS0108 window.--*/void OutSI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS2=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS2=1;E=1;}/* ------------------------------------------------- Send the instruction to the Third KS0108 window--*/void OutTI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS3=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS3=1;E=1;}/* -------------------------------------------------Send the data to the First ks0108 Window--*/void OutFD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS1=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS1=1;E=1;}/* ------------------------------------------------- Send the data to the Second ks0108 Window--*/void OutSD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS2=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS2=1;E=1;}/* ------------------------------------------------- Send the data to the Third ks0108 Window--*/void OutTD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS3=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS3=1;E=1;}/* ------------------------------------------------- Read the data to the First ks0108 Window--*//*unsigned char RD_data_F(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS1=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;_nop_();E=0;RW=0;CS1=1;E=1;return (data_sta);}/* ------------------------------------------------- Read the data to the Second ks0108 Window--*//*unsigned char RD_data_S(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS2=0;_nop_();data_sta=DATA;_nop_();E=0;CS2=1;E=1;return (data_sta);}/* ------------------------------------------------- Read the data to the Third ks0108 Window--*//*unsigned char RD_data_T(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS3=0;_nop_();E=1;_nop_();data_sta=DATA;_nop_();E=0;CS3=1;E=1;return(data_sta);}/* ------------------------------------------------- Initialize the LCD,The system reset,invoke First time-*/void InitLCD(){OutFI(0x40); /*Set the Y address 0 */OutSI(0x40);OutTI(0x40);OutFI(0xb8); /*Set the Page 0 */OutSI(0xb8);OutTI(0xb8);OutFI(0xc0); /*Set the display start line 0 */OutSI(0xc0);OutTI(0xc0);OutFI(0x3f); /*Display ON */OutSI(0x3f);OutTI(0x3f);}/* -------------------------------------------------Clear the three ks0108's display ram.Clrscr screen-*/void Clrscreen(){unsigned char i,j;for(i=0;i<8;i++){OutFI(0xb8|i);for(j=0;j<64;j++){OutFI(j|0x40);OutFD(0);}}for(i=0;i<8;i++)(OutSI(0xb8|i);for(j=0;j<64;j++)(OutSI(j|0x40);OutSD(0);}}for(i=0;i<8;i++)(OutTI(0xb8|i);for(j=0;j<64;j++)(OutTI(j|0x40);OutTD(0);}}}/* -------------------------------------------------Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width;bmp is the table's name-*/void DrawBmp(uchar x_add,uchar layer,uchar width,uchar *bmp)(unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++)(if (x>127) /*The Third KS0108*/(OutTI((x-128)|0x40); /*Set the x address*/OutTI(layer|0xb8); /*Set the y address*/OutTD(bmp[i]); /*Send thd data to LCD ram*/OutTI((x-128)|0x40); /*Display the down screen*/ OutTI((layer|0xb8)+1); i++; /*Display zimo table address add 1*/ OutTD(bmp[i]);}else if (x>63) /*The Second ks0108*/{OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(bmp[i]);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);i++;OutSD(bmp[i]);}else /*The First ks0108*/{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(bmp[i]);OutFI(x|0x40);OutFI((layer|0xb8)+1);i++;OutFD(bmp[i]);}i++;}}/* -------------------------------------------------Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width;bmp is the table's name.-*/void DrawBmp_f(uchar x_add,uchar layer,uchar width,uchar *bmp) {unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++) (if (x>127)(OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(~bmp[i]);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);i++;OutTD(~bmp[i]);}else if (x>63)(OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(~bmp[i]);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);i++;OutSD(~bmp[i]);}else(OutFI(x|0x40);OutFI(layer|0xb8);OutFD(~bmp[i]);OutFI(x|0x40);OutFI((layer|0xb8)+1);i++;OutFD(~bmp[i]);}i++;}}/*Display indention; x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width-*/void _DrawBmp_(uchar x_add,uchar layer,uchar width){unsigned char x;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(0);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);OutTD(0);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(0);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);OutSD(0);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(0);OutFI(x|0x40);OutFI((layer|0xb8)+1);OutFD(0);/* --------------------------------------------------Display indention; x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width-*/void _DrawBmp_black(uchar x_add,uchar layer,uchar width){unsigned char x;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(0xff);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);OutTD(0xff);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(0xff);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);OutSD(0xff);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(0xff);}}OutFI(x|0x40);OutFI((layer|0xb8)+1);OutFD(0xff);}}}/* --------------------------------------------------Display the line display_data_graph is the display graph data-*/void _DrawBmp_line(uchar x_add,uchar layer,uchar width,uchar display_data_graph) {unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(display_data_graph);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(display_data_graph);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(display_data_graph);}i++;/*Display the column display_data_graph is the display graph data-*/void _DrawBmp_column(uchar x,uchar width) {unsigned int i=0;if (x>127){for(i=0;i<width;i++){OutTI((x-128)|0x40);OutTI(i|0xb8);OutTD(0xff);}}else if (x>63){for(i=0;i<width;i++){OutSI((x-64)|0x40);OutSI(i|0xb8);OutSD(0xff);}}else{for(i=0;i<width;i++){OutFI(x|0x40);OutFI(i|0xb8);OutFD(0xff);}}}}}。

19264液晶模块显示51单片机汇编程序

19264液晶模块显示51单片机汇编程序
mov dptr,#table3
call wordw
mov r3,#0b8h ;页地址暂存
mov r4,#70h ;列地址暂存
mov dptr,#table4
call wordw
call select2
mபைடு நூலகம்v r3,#0b8h ;页地址暂存
mov r4,#40h ;列地址暂存
mov com,r4 ;设置起始列为第0列,总共64列
call rswrite
clear1:
mov dat,#00h ;清除显示(清屏)
call datawrite
djnz r2,clear1 ;列循环64列
mov r2,#64
inc r3
setb cs3
ret
select3:
setb cs1
setb cs2
clr cs3
ret
;********************
DELAY10ms: MOV R4,#20
D1: MOV R5,#248
w1:
movc a,@a+dptr
mov dat ,a
call datawrite
inc dptr
djnz county,w1
djnz r5,w2
sjmp w3
w2:
inc r3 ; 页地址增加1
mov com,r3
call rswrite
mov com,r4 ;列地址为原来的
db 82h, 80h,0FFh, 80h, 80h,0C0h, 80h, 00h
db 00h, 00h, 40h, 20h, 18h, 07h, 00h, 00h

19264 程序

19264 程序

/****************************************************************************** *************--------------------------------------------------------------------------------------**** 文件名:**** Copyright (c) 2010-2010 **xxx(中国)电子有限公司研发部**** 创建人: 酥蒸饼**** 日期: 2010.10.07**** 修改人: 酥蒸饼**** 日期: 2010.10.207**** 描述: LCD19264-1 ES-9116控板驱动头文件****** 版本: NO.1****--------------------------------------------------------------------------------------********************************************************************************* ***********/#ifndef _DIY_LCD19264_#define _DIY_LCD19264_#define uchar unsigned char#define uint unsigned int#define DATA_BUFFER P0sbit E=P2^3; //使能端sbit RS=P2^1; //指令数据选择端sbit RW=P2^2; //读写选择信号sbit RST=P2^6; //复位端sbit CS1=P2^7; //左屏片选sbit CS2=P2^5; //中屏片选sbit CS3=P2^4; //右屏片选/*unsigned char bdata Temp_Buffer; //接收字节sbit D_Buf0=Temp_Buffer^0; //Temp_Buffer第0位sbit D_Buf1=Temp_Buffer^1; //Temp_Buffer第1位sbit D_Buf2=Temp_Buffer^2;sbit D_Buf3=Temp_Buffer^3;sbit D_Buf4=Temp_Buffer^4;sbit D_Buf5=Temp_Buffer^5;sbit D_Buf6=Temp_Buffer^6;sbit D_Buf7=Temp_Buffer^7; //Temp_Buffer第7位0////////////////unsigned char bdata Temp_Buffer_1; //接收字节sbit Buf0=Temp_Buffer_1^0; //Temp_Buffer第0位sbit Buf1=Temp_Buffer_1^1; //Temp_Buffer第1位sbit Buf2=Temp_Buffer_1^2;sbit Buf3=Temp_Buffer_1^3;sbit Buf4=Temp_Buffer_1^4;sbit Buf5=Temp_Buffer_1^5;sbit Buf6=Temp_Buffer_1^6;sbit Buf7=Temp_Buffer_1^7; //Temp_Buffer第7位0 *//****************************************************************************** ****************-------------------------------------------------------------------------------------------** 函数名:lcd_busy()** 输入:** 输出:** 功能描述:忙检测** 全局变量:** 调用模块:** 日期:**-------------------------------------------------------------------------------------------******************************************************************************* **************/void lcd_busy(void) //Read State Data function{P0=0Xff;RS=0;RW=1; //读状态条件E=1;// _nop_();while(DATA_BUFFER&0x80); //busy位// _nop_();E=0;}/****************************************************************************** ****************-------------------------------------------------------------------------------------------** 函数名: uchar rd_lcd_data()** 输入:** 输出: RAM数据** 功能描述: 读操作,读液晶屏RAM数据** 全局变量:** 调用模块:** 日期:**-------------------------------------------------------------------------------------------******************************************************************************* **************/uchar rd_lcd_data() //Read Display Data function{uchar temp_data;lcd_busy();RS=1;RW=1; //读用户数据条件P0=0xff; //51端口想输入时先拉高E=1;//_nop_();//_nop_(); //指该操作有效,即当E=1时,液晶模块数据的数据读到总线上。

19264液晶完整驱动程序 带字库st7920芯片驱动

19264液晶完整驱动程序 带字库st7920芯片驱动
void SendByteTo19264(u8 nbit,u8 bit);
void SendStringTo19264(u8 bit,u8 select,u8 data);
void Init_19264();
void screen_chear();
void display_chinese(u8 hang,u8 lie,u8 *array);
_delay_ms(3);
}
//------------------清屏JM12864---------------------
void screen_chear()
{
SendStringTo19264(upscreen,0,0x01);
SendStringTo19264(downscreen,0,0x01);
SendStringTo19264(upscreen,0,0x30); //使能基本指令 8位数据格式(在XY12864中)
//001DL X RE XX
/* DL=1,8位MPU接口;DL=0,4位MPU接口
RE=1,扩充指令集;RE=0,基本指令集
同一指令的动作不能同时改变DL和RE,需先改变DL再改变RE才能确保设置正确*/
SendStringTo19264(downscreen,0,0x30);
#define pin_19264data PINB&(1<<hf19264_data)
//--------------------------------------------------------
#define upscreen 1
#define downscreen 0

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

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

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

128x64液晶KS0108控制器驱动程序

128x64液晶KS0108控制器驱动程序

#include "absacc.h"#include "intrins.h"//自定义库在"C:\comp51\UserLib\"文件夹中#include ".\inc\ASCII816.h" //标准ASCII库#include ".\inc\HZTable.h" //汉字点阵库(自做)#include ".\inc\Menu.h" //菜单库(自做)// LCD128*64 数据线#define LCD12864DataPort P1// LCD128*64 I/O 信号管脚sbit di =P3^1; // 数据\指令选择sbit rw =P3^3; // 读\写选择sbit en =P3^2; // 读\写使能sbit cs1 =P3^4; // 片选1,低有效(前64列)sbit cs2 =P3^5; // 片选2,低有效(后64列)sbit reset=P0^7; // 复位/*----------------------------------------------------------------------------------------------------*/ /* ****函数列表****//开关显示void SetOnOff(unsigned char onoff)//选择屏幕//screen: 0-全屏,1-左屏,2-右void SelectScreen(unsigned char screen)//清屏//screen: 0-全屏,1-左屏,2-右void ClearScreen(unsigned char screen)//显示8*8点阵//旋转90度:字模被竖着切分//lin:行(0-7), column: 列(0-15)//address : 字模区首地址void Show88(unsigned char lin,unsigned char column,unsigned int address)//显示8*16字符//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//character:字符代码(标准ASCII码)void ShowChar(unsigned char lin,unsigned char column,unsigned char character)//显示8*16字符串//!!!只能显示在一行上即: 串长+column <=15//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//address : 字模区首地址void ShowString(unsigned char lin,unsigned char column, unsigned char *string)//显示一个汉字//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//hzcode: 汉字代码(自定义的)void ShowHZ(unsigned char lin,unsigned char column,unsigned int hzcode)//显示图片//旋转90度:字模被竖着切分//startline :开始行//startcolumn:开始列//linechar :图片行点除8(图片以8*8点阵为单位)//columnchar :图片列点除8(图片以8*8点阵为单位)//address : 字模区首地址void ShowPicture(unsigned char startline,unsigned char startcolumn,unsigned char linechar,unsigned char columnchar,unsigned int address)//!!问题大户//显示一行汉字//lin:行//lineheadaddr: 此行汉字代码区首地址void ShowLine(unsigned char lin,unsigned int lineheadaddr)//显示一屏汉字//pageheadaddr:此屏汉字代码地址区首地址void ShowPage(unsigned int pageheadaddr)//反显一个8*8字块//lin:行(0-3), column: 列(0-7)void ReverseShow88(unsigned char lin,unsigned char column)//反显一个字符//lin:行(0-4), column: 列(0-15)void ReverseShowChar(unsigned char lin,unsigned char column)//反显一个汉字//lin:行(0-3), column: 列(0-7)ReverseShowHZ(unsigned char lin,unsigned char column)//反显一行汉字//lin:行ReverseShow(unsigned char lin)//初始化LCDvoid InitLCD()****函数列表结束**** *//*----------------------------------------------------------------------------------------------------*//*--基本函数源程序------------------------------------------------------------------------------------*/ //延时Lcd12864delay(){unsigned int i=500;while(i--) {;}}/*----------------------------------------------------------------------------------------------------*///状态检查void CheckState(){unsigned char dat;di=0;rw=1;do{LCD12864DataPort=0xff;en=1; dat=LCD12864DataPort; en=0;dat=0x90 & dat; //仅当第4,7位为0时才可操作}while(!(dat==0x00));}/*----------------------------------------------------------------------------------------------------*///写显示数据//dat:显示数据void WriteByte(unsigned char dat){CheckState();di=1; rw=0;LCD12864DataPort=dat;en=1; en=0;}/*-----------------------------------------------------------------------------------------------------*/ //向LCD发送命令//command :命令SendCommandToLCD(unsigned char command){CheckState();rw=0;LCD12864DataPort=command;en=1; en=0;}/*----------------------------------------------------------------------------------------------------*/ //设定行地址(页)--X 0-7void SetLine(unsigned char line){line=line & 0x07; // 0<=line<=7line=line|0xb8; //1011 1xxxSendCommandToLCD(line);}//设定列地址--Y 0-63void SetColumn(unsigned char column){column=column &0x3f; // 0=<column<=63column=column | 0x40; //01xx xxxxSendCommandToLCD(column);}//设定显示开始行--XXvoid SetStartLine(unsigned char startline) //0--63{startline=startline & 0x07;startline=startline|0xc0; //1100 0000SendCommandToLCD(startline);}//开关显示void SetOnOff(unsigned char onoff){onoff=0x3e | onoff; //0011 111xSendCommandToLCD(onoff);}/*---------------------------------------------------------------------------------------------------*///选择屏幕//screen: 0-全屏,1-左屏,2-右屏void SelectScreen(unsigned char screen){ //北京显示器:负有效cs1: 0--右; cs2: 0--左switch(screen){ case 0: cs1=0;//全屏_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();cs2=0;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();_nop_();break;case 1: cs1=1;//左屏_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();cs2=0;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();break;case 2: cs1=0;//右屏_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();cs2=1;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();break;}}/*---------------------------------------------------------------------------------------------------*///清屏//screen: 0-全屏,1-左屏,2-右void ClearScreen(unsigned char screen){ unsigned char i,j;SelectScreen(screen);for(i=0;i<8;i++){ SetLine(i);for(j=0;j<64;j++){WriteByte(0x00);}}}/*--------------------------------------------------------------------------------------------------*/ //显示8*8点阵//旋转90度:字模被竖着切分//lin:行(0-7), column: 列(0-15)//address : 字模区首地址void Show88(unsigned char lin,unsigned char column,unsigned int address) { unsigned char i;if(column>16) {return;}if(column<8) SelectScreen(1); //如果列数<8(0,1,2,3,4,5,6,7)则写在第一屏上else {SelectScreen(2); //否则(8,9,10,11,12,13,14,15)写在第二屏上column=column & 0x07; //防止越界}SetLine(lin);SetColumn(column<<3);for(i=0;i<8;i++) WriteByte( CBYTE[address+i] );}/*------------------------------------------------------------------------------------------------*///显示8*16字符//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//character:字符代码(标准ASCII码)void ShowChar(unsigned char lin,unsigned char column,unsigned char character) { lin=lin<<1;Show88(lin ,column,ASCII816[character-0x20] );Show88(lin+1,column,ASCII816[character-0x20]+8 );}/*-----------------------------------------------------------------------------------------------*//*//显示8*16字符串//!!!只能显示在一行上即: 串长+column <=15//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//address : 字模区首地址void ShowString(unsigned char lin,unsigned char column, unsigned char *string) { unsigned char ch;unsigned char i=0;while(*string!='\0'){ch=*string;if(i+column >15) break; //(只能显示在一行上即: 串长+column <=15) ShowChar(lin,i+column,ch);string++; i++;}}*//*----------------------------------------------------------------------------------------------*///显示一个汉字//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-7)//hzcode: 汉字代码(自定义的)//uchar code HZtablevoid ShowHZ(unsigned char lin,unsigned char column,unsigned int hzcode){lin=lin<<1; //lin*2Show88(lin,column,HZTable[hzcode]);Show88(lin,column+1,HZTable[hzcode]+8);Show88(lin+1,column,HZTable[hzcode]+16);Show88(lin+1,column+1,HZTable[hzcode]+24);}/*----------------------------------------------------------------------------------------------*///显示图片//旋转90度:字模被竖着切分//startline :开始行//startcolumn:开始列//linechar :图片行点除8(图片以8*8点阵为单位)//columnchar :图片列点除8(图片以8*8点阵为单位)//address : 字模区首地址void ShowPicture(unsigned char startline,unsigned char startcolumn,unsigned char linechar,unsigned char columnchar,unsigned int address){ unsigned char i,j;for(i=0;i<columnchar;i++)for(j=0;j<linechar;j++)Show88(startline+i , startcolumn+j , address+(i*linechar+j)*8 );}/*----------------------------------------------------------------------------------------------*///显示一行字符串(汉字,字母混排,一行16字节)//lin:行//lineheadaddr: 此行汉字代码区首地址void ShowLine(unsigned char lin,unsigned char linehead[]) { unsigned char i;unsigned char byte;unsigned int hzcode;for( i=0; i<16; ){ byte=linehead[i];if(byte < 0x80) //字母{if(i>15) return; //!!编译器有问题,须强制退出ShowChar(lin, i , byte);i=i+1;}else // byte >= 0x80(汉字){if(i>15) return; //!!编译器有问题,须强制退出byte=byte & 0x7f; //最高位置0,即:减去0x8000 hzcode=(unsigned int)byte<<8; //?? //高8位hzcode=hzcode+linehead[i+1]; //加低8位,组合成整型数地址ShowHZ( lin,i,hzcode);i=i+2;}}}/*----------------------------------------------------------------------------------------------------*///显示一屏汉字//pageheadaddr:此屏汉字代码地址区首地址void ShowPage(unsigned char pagehead[][16]){ unsigned char i;for(i=0;i<4;i++) ShowLine(i,pagehead[i]); //1行8个汉字,16字节}/*----------------------------------------------------------------------------------------------------*///读显示数据unsigned char ReadByte(){unsigned char dat;CheckState();di=1; rw=1;LCD12864DataPort=0xff;en=1; dat=LCD12864DataPort; en=0;return(dat);}/*----------------------------------------------------------------------------------------------------*/ //反显一个8*8字块//lin:行(0-3), column: 列(0-7)void ReverseShow88(unsigned char lin,unsigned char column){ unsigned char i;unsigned char tab[8];if(column<8) SelectScreen(1); //如果列数<4(0,1,2,3),则写在第一屏上else SelectScreen(2); //否则(4,5,6,7), 写在第二屏上//读上部8列column=column<<3; //每个方块8*8大小SetLine(lin);SetColumn(column);tab[0]=ReadByte(); //空读!!!!! //?for(i=0;i<8;i++) tab[i]=~ReadByte();//写回SetLine(lin);SetColumn(column);for(i=0;i<8;i++) WriteByte(tab[i]);}/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/ //反显一个字符//lin:行(0-4), column: 列(0-15)void ReverseShowChar(unsigned char lin,unsigned char column){ lin=lin<<1;ReverseShow88(lin ,column);ReverseShow88(lin+1,column);}/*----------------------------------------------------------------------------------------------------*///反显一个汉字//lin:行(0-3), column: 列(0-7)ReverseShowHZ(unsigned char lin,unsigned char column){lin=lin<<1;column=column<<1;ReverseShow88(lin ,column );ReverseShow88(lin ,column+1);ReverseShow88(lin+1,column );ReverseShow88(lin+1,column+1);}/*----------------------------------------------------------------------------------------------------*/ //反显一行汉字//lin:行ReverseShow(unsigned char lin){ unsigned char i;for(i=0;i<8;i++) ReverseShowHZ(lin,i);}/*----------------------------------------------------------------------------------------------------*/ void InitLCD() //初始化LCD{ unsigned char i=250; //延时while(i--);//reset=0;//复位//reset=1;SelectScreen(0);SetOnOff(0); //关显示ClearScreen(1);//清屏ClearScreen(2);SelectScreen(0);SetOnOff(1); //开显示SelectScreen(0);SetStartLine(0); //开始行:0}/*----------------------------------------------------------------------------------------------------*/void Reset() //液晶复位{//reset 低复位_|-reset=0;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();reset=1;//全屏cs1=0;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();cs2=0;_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();_nop_(); SendCommandToLCD(0x3F);}</FONT< p>。

KS0108内核液晶驱动程序介绍

KS0108内核液晶驱动程序介绍

直接看指令表:由以上指令可以得到如下初始化液晶的程序:void vLCDInitialize(){CS1=1;CS2=1;vWriteCMD(0x38); //8位形式,两行字符。

vWriteCMD(0x0F); //开显示。

vWriteCMD(0x01); //清屏。

vWriteCMD(0x06); //画面不动,光标右移。

vWriteCMD(LCDSTARTROW); //设置起始行。

}全屏初始化,不忙?写命令,这里注意,控制显示的指令和ST7920相同,这里没有详细列出。

不同的是,起始行,列,和页分别定义如下:#define LCDSTARTROW 0xC0 //设置起始行指令。

#define LCDPAGE 0xB8 //设置页指令。

#define LCDLINE 0x40可以通过上面的指令表查表宏定义。

//在8×128的格子里显示自定义长度的一行void vShowCustomRow(unsigned char ucPage,unsigned char ucLine,unsigned char ucWidth,unsigned char *ucaRow){unsigned char ucCount;if(ucLine<64) {CS1=1;CS2=0;vWriteCMD(LCDPAGE+ucPage);vWriteCMD(LCDLINE+ucLine);if((ucLine+ucWidth)<64){for(ucCount=0;ucCount<ucWidth;ucCount++)vWriteData(*(ucaRow+ucCount));}else{for(ucCount=0;ucCount<64-ucLine;ucCount++)vWriteData(*(ucaRow+ucCount));CS1=0;CS2=1;vWriteCMD(LCDPAGE+ucPage);vWriteCMD(LCDLINE);for(ucCount=64-ucLine;ucCount<ucWidth;ucCount++)vWriteData(*(ucaRow+ucCount));}}else{CS1=0;CS2=1;vWriteCMD(LCDPAGE+ucPage);vWriteCMD(LCDLINE+ucLine-64);for(ucCount=0;ucCount<ucWidth;ucCount++)vWriteData(*(ucaRow+ucCount));}}1、void vShowCustomRow(unsigned char ucPage,unsigned char ucLine,unsigned char ucWidth,unsigned char *ucaRow):四个参数:从那一页开始写,从哪一列开始写,写入多宽数据,写入的数据存放在哪里。

图形液晶显示控制器KS0108

图形液晶显示控制器KS0108

INT:
MOV COM,#0C00H;设置显示起始行为第一行 LCALL WriteLeft_Command LCALL WriteRight_Command MOV COM,#3FH;开显示设置 LCALL WriteLeft_Command LCAL WriteRight_Command RET
/*检查右忙标志位*/ Check_Busy_R: CLR DI;DI=0 SETB RW;RW=1 CLR CSB;CSL=0 SETB EN;EN=1 L2: MOV A,P1 JB ACC.7,L2;判"忙"标志为"0"否H,否再读 CLR EN;EN=0 SETB CSB;CSL=1 RET
TEST: MOV R4,#00H;页面地址暂存器设置 TEST1:MOV A,R4 ORL A,#0B8H;"或"页面地址设置代码 MOV COM,A;页面地址设置WriteLeft_Command LCALL WriteLeft_Command LCALL WriteRight_Command MOVCOMH,#40H;列地址设置为"0" LCALL WriteLeft_Command LCALL WriteRight_Command MOV R3,#40H;一页清64个字节 TEST2:MOV DAT,#00H;显示数据为"0" LCALL WriteLeft_Data LCALL WriteRight_Data DJNZ R3,TEST2;页内字节清零循环 INC R4;页地址暂存器加1 CJNE R4,#08H,TEST1;RAM区清零循环 RET
WRITELEFT: MOV DPTRH,#HANZI1 MOV R4,#00H WRL1: MOV A,R4 ORL A,#0B8H MOV COM,A LCALL WriteLeft_Command MOV COM,#40H LCALL WriteLeft_Command MOV R3,#40H WRL2: CLR A MOVC A,@A+DPTR;置数据 MOV DAT,A LCALL WriteLeft_Data INC DPTR DJNZ R3,WRL2; INC R4; CJNE R4H,#08H,WRL1 RET

KS0108+控制器系列液晶模块使用说明书

KS0108+控制器系列液晶模块使用说明书

9) 12864-18
4-? 2.5PAD 4-? 5.0PTH
75.0± 0.3 70.6± 0.2
70.0 60.0(V.A)
55.01(A.A)
MAX12.5 8.5± 0.3
0.4 A
128x64 DOTS
54.7± 0.3 49.7
44.6± 0.2 32.6(V.A) 27.49(A.A)
2) 12832-3
10.0
@2.54*17=43.18
? 1.0
4-? 2.5
18
1
MAX14.5 10.0± 0.3
0.52
65.0± 0.3 61.0
42.0± 0.2 25.0(V.A)
18.19(A.A)
2.0 9.1 17.6 21.01
72.91(A.A) 76.0(V.A) 97.0± 0.2
DB0
R/W
DB0
DB0
DB3
DB7
8
R/W
CS
DB1
E
DB1
DB1
DB4
DB6
9
CS
DB7
DB2 DB0 DB2
DB2
DB5
DB5
10 /RST
DB6
DB3 DB1 DB3
DB3
DB6
DB4
11 DB0
DB5
DB4 DB2 DB4
DB4
DB7
DB3
12 DB1
DB4
DB5 DB3 DB5
DB5
/CS1
105.0 110.0± 0.3
0.05 1.60
3 深圳汉昇实业有限公司 SHENZHEN HANSHENG INDUSTRIAL CO.,LTD

KS0107 KS0108控制的19264液晶驱动程序C51示例

KS0107 KS0108控制的19264液晶驱动程序C51示例

KS0107 KS0108控制的19264液晶驱动程序C51示例2007年01月29日星期一 11:57// 19264 Demo Program//***************************************************************************//连线表: CPU=89C52*//RS=P3.0 R/W=P3.1 E=P3.2 CS1=P3.3 CS2=P3.4 CS3=P3.5 *//SysClock=12MHz DB0-DB7=P1.0-P1.7 /Reset=InBoar d *//***************************************************************************#include <reg52.h>#include <stdlib.h>#include <intrins.h>#include <stdio.h>/********************引脚定义********************/sbit RS =P3^0; //数据指令sbit RW =P3^1; //读写sbit E =P3^2; //使能sbit CSL =P3^3; //左片选sbit CSM =P3^4; //中片选sbit CSR =P3^5; //右片选unsigned char Page; //页地址unsigned char Col; //列地址unsigned char code BMP1[];unsigned char code BMP2[];void Delay(unsigned int MS);void wtcom(void);/***************************//*检查Busy *//***************************/void BusyL(void){CSL= 0;CSM= 1;CSR= 1;wtcom();}void BusyM(void){CSL= 1;CSM= 0;CSR= 1;wtcom();}void BusyR(void){CSL= 1;CSM= 1;CSR= 0;wtcom();}void wtcom(void){RS = 0; //指令RW = 1;P1 = 0xFF; //输出0xff以便读取正确E = 1;_nop_();while(P1 & 0x80); //Status Read Bit7 = BUSYE = 0;_nop_();}/********************************************************//*根据设定的坐标数据,定位LCM上的下一个操作单元位置*//********************************************************/void Locatexy(void){unsigned char x,y;switch (Col&0xc0) /* col.and.0xC0*/{ /*条件分支执行*/case 0: {BusyL();break;}/*左区*/case 0x40: {BusyM();break;}/*中区*/case 0x80: {BusyR();break;}/*右区*/}x = Col&0x3F|0x40; /* col.and.0x3f.or.Set Y Addres s*/y = Page&0x07|0xB8; /* row.and.0x07.or.set Page */wtcom(); /* waitting for enable */RS = 0; //指令RW = 0; //写P1 = y; //设置页面地址E = 1;_nop_();E = 0;_nop_();wtcom(); /* waitting for enabl e */RS = 0;RW = 0;P1 = x; //设置列地址E = 1;_nop_();E = 0;_nop_();}/***************************//*写指令*//***************************/void WriteCommandL( unsigned char CommandByte ){BusyL();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}void WriteCommandM( unsigned char CommandByte ){BusyM();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}void WriteCommandR( unsigned char CommandByte ){BusyR();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}/***************************//*读数据*//***************************/unsigned char ReadData( void ){unsigned char DataByte;Locatexy(); /*坐标定位,返回时保留分区状态不变*/RS = 1; /*数据输出*/RW = 1; /*读入*/P1 = 0xFF; //输出0xff以便读取正确E = 1; /*读入到LCM*/_nop_();DataByte = P1; /*数据读出到数据口P1 */E = 0;_nop_();return DataByte;}/***************************//*写数据*//***************************/void WriteData( unsigned char DataByte ){Locatexy(); /*坐标定位,返回时保留分区状态不变*/RS = 1; /*数据输出*/RW = 0; /*写输出*/P1 = DataByte; /*数据输出到数据口*/E = 1; /*写入到LCM*/_nop_();E = 0;_nop_();}void LcmClear( void ){Page = 0;Col = 0;for(Page=0;Page<8;Page++)for(Col=0;Col<192;Col++)WriteData(0);}void LcmInit( void ){WriteCommandL(0x3f); //开显示WriteCommandM(0x3f);WriteCommandR(0x3f);WriteCommandL(0xc0); //设置起始地址=0WriteCommandM(0xc0);WriteCommandR(0xc0);WriteCommandL(0x3f); //开显示WriteCommandM(0x3f);WriteCommandR(0x3f);LcmClear();Col = 0;Page= 0;Locatexy();}void LcmPutDots( unsigned char DotByte ){Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){WriteData( DotByte );DotByte = ~DotByte;}}}void LcmPutBMP( unsigned char *puts ){unsigned int X=0;Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){WriteData( puts[X] );X++;}}}void LcmReverseBMP( void ){unsigned char temp;Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){temp = ReadData(); //空读一次temp = ReadData();temp = ~temp;WriteData(temp);}}}void Delay(unsigned int MS){unsigned char us,usn;while(MS!=0){usn = 2; //for 12Mwhile(usn!=0){us=0xf6;while (us!=0){us--;};usn--;}MS--;}}void Main( void ){Delay(200); //等待复位LcmInit();LcmClear();while(1){LcmPutBMP(BMP1);Delay(1500);LcmReverseBMP();Delay(1500);LcmPutBMP(BMP2);Delay(1500);LcmReverseBMP();Delay(1500);}}unsigned char code BMP1[]={/*-- 宽度x高度=192x64 --*/0xFF,0x01,0xFD,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0xFD,0x01,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x08,0x10,0xE0,0x00,0x00,0x70,0x08,0x08, 0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x80,0x60,0x10,0x08,0x08,0x08,0x08,0x30,0x00,0x00,0x00,0x00,0xC0,0x20,0x10, 0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x82,0x42,0x32,0x3E,0x56,0x92,0x52,0x32, 0x12,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x04,0x04,0xFC,0x04,0x04,0x04,0xFC, 0x04,0x84,0xC4,0x20,0x10,0x08,0x86,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x80, 0x80,0x80,0x80,0x7E,0x90,0x90,0x90,0x90,0xD0,0x08,0x00,0x00,0x00,0x00,0x00,0xFC, 0x04,0x44,0xB4,0x0E,0x10,0x10,0xF0,0x1C,0x16,0xD0,0x10,0x10,0x10,0x08,0x00,0x00, 0x00,0x00,0x20,0xE0,0xFE,0xA0,0x18,0x28,0xE8,0x48,0x5E,0x48,0x48,0x5F,0x48,0xE8, 0x04,0x00,0x00,0x00,0x40,0x40,0x40,0xFE,0x40,0x60,0x60,0x20,0x20,0xFE,0x22,0x20, 0x20,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x80,0x80,0x00, 0x00,0x00,0x00,0x61,0x82,0x84,0x84,0x84,0x44,0x32,0x0F,0x00,0x00,0xC0,0xA0,0x90, 0x88,0x84,0x83,0xE0,0x00,0x00,0x00,0x81,0xC3,0xA5,0x18,0x18,0xA5,0xC3,0x81,0x00, 0x00,0x3F,0x42,0x81,0x81,0x81,0x81,0x42,0x3C,0x00,0x00,0x0C,0x0B,0x08,0x88,0x88, 0xFF,0x88,0x88,0x00,0x00,0x00,0x00,0xFF,0x08,0x04,0x02,0x22,0x25,0x24,0x69,0x42, 0x02,0x06,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x80,0x61,0x1F,0x01,0x01,0x01,0xFF, 0x01,0x08,0x08,0x84,0x82,0x41,0x20,0x18,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x1F, 0x10,0xD0,0x10,0x10,0x10,0xD0,0x10,0x10,0x1F,0x40,0x80,0x00,0x00,0x00,0x00,0xFF, 0x10,0x10,0x10,0x1F,0x20,0x23,0x22,0x22,0x22,0xFF,0x22,0x22,0x22,0x11,0x10,0x00, 0x00,0x18,0x06,0x01,0xFF,0x00,0x03,0x20,0x2F,0x25,0xE5,0x3D,0x25,0x65,0xA5,0x27, 0x10,0x10,0x00,0x00,0x40,0x60,0x20,0x3F,0x24,0x14,0x94,0xC4,0x64,0x1F,0x0C,0x14, 0x64,0xC4,0x83,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x00,0x00, 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x03, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01, 0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x90,0xF0,0xB0,0x90,0x90,0x90,0x90, 0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x20,0x20,0xE0,0x20,0x20,0x20,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xF0,0x00,0xC0,0x40,0x40,0x40,0xF0,0x40,0x40,0xF8,0x40,0x40,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x00,0x10, 0x60,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x44,0x22,0x11,0x11,0x2A,0x24,0x4A,0x11,0x10, 0x30,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0x08,0x08,0x08,0xFF,0x08, 0x44,0x46,0x21,0x10,0x08,0x04,0xC4,0x00,0x00,0x00,0x00,0x00,0x20,0xCF,0x09,0x09, 0xF9,0x19,0x09,0x09,0xF9,0x09,0x09,0x8F,0x60,0x00,0x00,0x00,0x00,0x04,0x04,0x04, 0xC4,0x74,0x14,0x04,0x04,0xFC,0x04,0x04,0x14,0x24,0x44,0x84,0x02,0x00,0x00,0x00, 0xC0,0x31,0x0F,0xFF,0x05,0x18,0x01,0x7F,0x2A,0x2A,0xEA,0x2A,0x2A,0x2A,0x3F,0x80, 0x80,0x00,0x00,0x00,0x01,0x11,0x11,0xF1,0x11,0x11,0x09,0x01,0x03,0x7F,0xC1,0x01, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x08,0x08,0x08,0x09,0x09,0x09,0x0B,0x0A,0x08, 0x08,0x08,0x08,0x0F,0x00,0x00,0x00,0x08,0x04,0x03,0x00,0x00,0x00,0x00,0x0F,0x10, 0x10,0x08,0x04,0x04,0x02,0x01,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0B,0x08, 0x0F,0x08,0x08,0x08,0x0F,0x0A,0x09,0x08,0x08,0x0C,0x08,0x00,0x00,0x04,0x02,0x01, 0x00,0x00,0x00,0x08,0x18,0x0F,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0x10,0x10,0x11,0x09,0x09,0x07,0x01,0x01,0x03,0x05,0x09,0x18, 0x08,0x00,0x00,0x04,0x0C,0x04,0x04,0x03,0x02,0x02,0x02,0x02,0x01,0x00,0x01,0x03, 0x04,0x08,0x1E,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x80,0xBF,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xBF,0x80,0xFF,};unsigned char code BMP2[]={/*-- 宽度x高度=192x64 --*/0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0xC0,0xC0,0xA0,0xB0,0x90,0x98,0x98,0x9C,0x9C,0xBC,0xBC,0x38,0x58,0x98,0x18, 0x30,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xFC,0xFC, 0xFC,0xFC,0xFC,0xFC,0xF8,0xF0,0xF8,0xF8,0xFC,0xF8,0xF8,0xF8,0xF0,0xC0,0x80,0x80, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFE,0x06,0x06,0x06,0x0C, 0x0C,0x98,0xF8,0xE0,0xF0,0xF0,0xF0,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8, 0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xF0,0xF8,0x98,0x0C,0x0C,0x06,0x06,0x06,0xFE,0xFC, 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xA0,0xB0,0x90,0x98,0x98,0x9C,0x9C, 0xBC,0xBC,0x38,0x58,0x98,0x18,0x30,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42, 0x81,0xFD,0x83,0xC1,0xFC,0xE2,0xC1,0xFE,0x61,0x40,0xFF,0xE1,0xC1,0xE2,0xC6,0x8D, 0xF0,0xC0,0x01,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0xE0,0xF8,0xF8,0xFC,0xFF,0xFF,0xFF,0xFF,0xF1,0x00,0x00,0x03,0x03, 0x33,0x33,0x03,0x03,0x03,0x33,0x33,0x07,0x03,0x01,0xC1,0xE1,0xF3,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFE,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xCF,0xFC,0xF8,0xFE, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xF8,0xF8,0x9E,0x07,0x01, 0x00,0x00,0x00,0x00,0x7C,0x42,0x81,0xFD,0x83,0xC1,0xFC,0xE2,0xC1,0xFE,0x61,0x40, 0xFF,0xE1,0xC1,0xE2,0xC6,0x8D,0xF0,0xC0,0x01,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x1F,0x3F,0xE5,0xCB,0x8F,0x23,0x40,0x20,0x85,0x8B,0xCF,0xE1,0xF3,0xFF, 0xFF,0xFF,0xC0,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x07,0x03,0x00,0x00,0x00,0x00, 0x00,0x30,0x28,0x28,0x38,0x30,0x00,0x00,0x00,0x00,0x03,0x07,0x0F,0x3F,0xFF,0xFF, 0xFF,0xFF,0xFF,0xF7,0xE3,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x7F,0xFF,0xFF,0xFF, 0xFF,0x83,0x01,0x01,0x01,0x31,0x79,0x31,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xCF,0x23,0x71,0x71,0x21,0x01,0x01,0x03,0x87,0xFF,0xFF,0xFF,0xFF,0x7F,0x40,0x40, 0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x1F,0x3F,0xE5,0xCB,0x8F,0x23,0x40,0x20, 0x85,0x8B,0xCF,0xE1,0xF3,0xFF,0xFF,0xFF,0xC0,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x3C,0x52,0xF9,0x80,0x00,0x03,0x05,0x05,0x03,0x01,0x00,0x40,0xE1,0xA3, 0x57,0x3F,0x1F,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF8,0xF8,0xF8, 0xF8,0xF8,0xF0,0x00,0x00,0x00,0x80,0xE0,0x28,0x27,0xE0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xC1,0x03,0x9F,0x3F,0x7F,0x7F,0x7F,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x80, 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFF,0xFF, 0xFF,0xFF,0xFF,0x3F,0x03,0x00,0x00,0x00,0x00,0x10,0x10,0x18,0x08,0x0D,0x07,0x07, 0x0F,0x1F,0x1F,0x3E,0x3E,0x7E,0x7E,0x7F,0xFF,0x7F,0x7F,0x7D,0x7C,0x7C,0x7D,0x7F, 0x7F,0xFF,0x7E,0x7E,0x7E,0x7E,0x3E,0x3F,0x1F,0x1F,0x0F,0x0F,0x09,0x10,0x10,0x20, 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x52,0xF9,0x80,0x00,0x03,0x05,0x05, 0x03,0x01,0x00,0x40,0xE1,0xA3,0x57,0x3F,0x1F,0x0F,0x07,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x03,0x7E,0x86,0x0E,0x1E,0x8E,0x06,0x02,0xC2,0x7F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03, 0x03,0x03,0x05,0x04,0x04,0x07,0x05,0x02,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x00, 0xAC,0x03,0x00,0x00,0x3F,0x00,0x00,0x00,0x01,0x03,0x87,0xAF,0x0F,0xFF,0x0F,0x07, 0x1F,0x1F,0xBF,0x3F,0x3F,0x3F,0xDF,0x0F,0x0F,0x1F,0x1F,0xFF,0x0F,0x0F,0x07,0x01, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x70,0xE0,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF6,0xC6,0x3E,0x7E,0x7E,0x7E,0x32, 0x86,0xFF,0xFE,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x7E,0x86,0x0E,0x1E, 0x8E,0x06,0x02,0xC2,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x53,0x4E,0x40,0x7F,0x80,0x80,0x9F,0xA0,0xC0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x08,0x08,0x08,0x08, 0x0B,0x00,0x06,0x00,0x03,0x04,0x04,0x0C,0x04,0x0C,0x1D,0x05,0x00,0x57,0xE0,0xC0, 0xC0,0x54,0x7B,0x00,0x1C,0x24,0x27,0x40,0x20,0x40,0x40,0x63,0x24,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x03,0x06,0x06,0x06,0x06,0x06,0x06,0x03,0x01,0x03,0x3F,0x7F,0x7F,0x7E,0x7E,0x7F, 0x63,0x03,0x03,0x03,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x53,0x4E,0x40, 0x7F,0x80,0x80,0x9F,0xA0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF, };。

c51驱动19264液晶软件

c51驱动19264液晶软件
sbit BL = P0^7; //背光控制BL=0:背光点亮否则暗
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;

ks0107_ks0108_液晶12864控制命令

ks0107_ks0108_液晶12864控制命令

128×64点阵型LCD屏幕显示与DD RAM地址映射关系 Y1 Y2 Y3 Y4 Y61 Y62 Y63 Y64 …… 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 … DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7
P12
图11-4 总线方式
+5V
AT89S51
P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 39 38 37 36 35 34 33 32 21 22 23 24 25 26

LCD19264的驱动程序

LCD19264的驱动程序

#include "Public.h"#define Fisrt 01#define Second 02#define Third 03/*定义LCD控制端口*/sbit L CD_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 DA TA_BUS P2/******************************************************************* 函数功能说明:判断LCD忙函数1、2、3、*******************************************************************/ void Read_busy(unsigned char Area){unsigned char temp = 0;do{LCD_CE = 0;LCD_RW = 1;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 = DA TA_BUS;LCD_CE = 0;LCD_RW = 0;switch(Area){case Fisrt:LCD_CSA = 1;break;case Second:LCD_CSB = 1;break;case Third:LCD_CSC = 1;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_();DA TA_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_();DA TA_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); }。

液晶(LCD)显示程序

液晶(LCD)显示程序

************************************************************* 功能:液晶(LCD)显示程序;LCD: TRULY M19264-5A1 192*64点阵驱动器: S6B0108/S6B0107或HD61202及相兼容驱动器MPU: AT89S51开发环境: KEIL C51作者:纪长城日期: 2005年10月************************************************************/ #include <AT89X51.H>#include <ZKDot.h>#define DISP_OFF 0X3E //关闭显示#define DISP_ON 0X3F //打开显示#define START_ROW 0xC0 //设置起始行#define FIRST_PAGE 0xB8 //设置页#define START_YADD 0x40 //设置列/*----------------------------------------MPU端口定义----------------------------------------*/#define LCD_PORT P0#define LCD_RESET P2_2#define LCD_CSA P2_3#define LCD_CSB P2_4#define LCD_RS P2_5#define LCD_RW P2_6#define LCD_E P2_7/*------------------------------------------LCD的区选择程序:F为要选通的区,取值为0,1,2,对应选中三个区,取其它值选中第三个区--------------------------------------------*/void LCD_CSAB_SET(unsigned char block){if(0==block) //0 选择第一区{LCD_CSA=0;LCD_CSB=0;}else if(1==block) //1 选择第二区{LCD_CSA=0;LCD_CSB=1;}else //2 选择第三区{LCD_CSA=1;LCD_CSB=0;}}/*---------------------------------------//延时子程序----------------------------------------*/void Delay_xMs(unsigned int xMs){unsigned int i,j;for(i=0;i<xMs;i++)for(j=0;j<500;j++);}/*---------------------------------------向LCD中写入指令或指令,F=0 是指令,F=1是数据,bkock是选择写入哪个区 ---------------------------------------*/void LCD_Write( unsigned char Com,bit F){LCD_PORT = Com; //把数据输出LCD_RS = F; //确定是数据还是指令LCD_RW = 0;LCD_E = 1;LCD_E = 0; //电平下降沿数据写入控制器}/*----------------------------------------------坐标定位程序参数XPage 定位页取值0--7 共8页Y 横向定位取值0-191 共192列-----------------------------------------------*/ void LCD_XY_SET(unsigned char X,unsigned char YPage) {if(X<64) //在第一个区中{LCD_CSAB_SET(0);LCD_Write(FIRST_PAGE|YPage,0);LCD_Write(START_YADD|X,0);}else if(X<128) //在第二个区中{LCD_CSAB_SET(1);LCD_Write(FIRST_PAGE|YPage,0);LCD_Write(START_YADD|X-64,0);}else if(X<192) //在第三个区中{LCD_CSAB_SET(2);LCD_Write(FIRST_PAGE|YPage,0);LCD_Write(START_YADD|X-128,0);}}/*--------------------------------------------清除一行的子程序 H是要清的页,取值0-3--------------------------------------------*/void LCD_Clear_H(unsigned char H){unsigned char i,j,k;for (k=0;k<2;k++)for (i=0;i<3;i++){LCD_XY_SET(i*64,H*2+k);for(j=0;j<64;j++) LCD_Write(0x00,1);}}/*----------------------------------------LCD初始化程序----------------------------------------*/void LCD_Init(void){unsigned char i;LCD_E = 0;LCD_RW = 1;LCD_RS = 0;LCD_RESET= 0; //液晶模块复位Delay_xMs(10); //等待10mSLCD_RESET= 1; //液晶结束复位电平LCD_CSAB_SET(0);LCD_Write(DISP_ON,0); //模块1显示开LCD_CSAB_SET(1);LCD_Write(DISP_ON,0); //模块2显示开LCD_CSAB_SET(2);LCD_Write(DISP_ON,0); //模块3显示开for (i=0;i<4;i++) LCD_Clear_H(i); //清屏}/*----------------------------------------读display RAM---------------------------------------*/unsigned char LCD_READ_RAM(unsigned char x,unsigned char y) {unsigned char temp;LCD_XY_SET(x,y);LCD_RW = 1; //设置为读数据LCD_RS = 1;LCD_PORT =0XFF; //设置总线为高电平(空)LCD_E = 0;LCD_E = 1;temp =LCD_PORT;LCD_E =0;return temp;}/*------------------------------------------设制起始行,参数line为要起始的行,取值范围0--63,block 为要设置的块-----------------------------------------*/void LCD_LINE_SET(unsigned char line){unsigned char i;for (i=0;i<3;i++){LCD_CSAB_SET(i);LCD_Write(START_ROW|line,0);}}/*----------------------------------------------显示一个16*8的ASCII的程序 ,参数是ascii码值,x取值0-191,y取值0-3 只能显示四行------------------------------------------------*/bit LCD_PRINT_ASCII_1608(unsigned char ascii,unsigned char x,unsigned char y) {unsigned char i,j;if((x+8)>191)return 1;for(j=0;j<2;j++)for(i=j;i<16;i+=2){LCD_XY_SET(x+(i>>1),y*2+j);LCD_Write(AsciiDotBig[(ascii-0x20)*16+i],1);}return 0;}/*-------------------------------------------------查找汉字程序参数是内码的高8位与低8位---------------------------------------------------*/unsigned char LCD_SEARCH_HZ16(unsigned char h,unsigned char l){unsigned char i;for(i=0;i<17;i++)if(HZ[i].Index[0]==h&&HZ[i].Index[1]==l) return i;}/*----------------------------------------------------16点阵的汉字显示程序----------------------------------------------------*/bit LCD_PRINT_HZ16(unsigned char wz,unsigned char x,unsigned char y) {unsigned char i,j;if((x+16)>192) return 1;for(j=0;j<2;j++)for(i=0;i<16;i++){LCD_XY_SET(x+i,y*2+j);LCD_Write(HZ[wz].Msk[i+(16*j)],1);}return 0;}/*--------------------------------------------点操作函数,参数,X/Y,取值为192/64 F 0-1,0是画点,1是取消点---------------------------------------*/void LCD_POINT(unsigned char X,unsigned char Y,bit F){unsigned char i,j,k;i=Y&&0xF8;//i是X/8的余数Y>>=3; //x是X/8的商j=LCD_READ_RAM(X,Y);//空读操作j=LCD_READ_RAM(X,Y);//读出8位数据LCD_XY_SET(X,Y);k=1<<i;if(F){k=~k;LCD_Write(j&k,1);}elseLCD_Write(j|k,1);}/*----------------------------------------------- 显示图像的一个例子---------------------------------------------*/ void LCD_TU(void){unsigned char i,j;for(i=0;i<6;i++)for(j=0;j<100;j++){LCD_XY_SET(j,i);LCD_Write(TP[i*100+j],1);}}/*---------------------------------------------测试主函数-------------------------------------------------*/ main(){unsigned char i,j,k,m;unsigned char code c[]="我老婆最可爱最漂亮的";LCD_Init();LCD_TU();for(i=0;i<18;i+=2){m=LCD_SEARCH_HZ16(c[i],c[i+1]); LCD_PRINT_HZ16(m,i*8,3);}while(1){for(i=0;i<64;i++){LCD_LINE_SET(i);if(i==0)Delay_xMs(500); //等待elseDelay_xMs(20); //等待}}}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

KS0107 KS0108控制的19264液晶驱动程序C51示例2007年01月29日星期一 11:57// 19264 Demo Program//***************************************************************************//连线表: CPU=89C52*//RS=P3.0 R/W=P3.1 E=P3.2 CS1=P3.3 CS2=P3.4 CS3=P3.5 *//SysClock=12MHz DB0-DB7=P1.0-P1.7 /Reset=InBoar d *//***************************************************************************#include <reg52.h>#include <stdlib.h>#include <intrins.h>#include <stdio.h>/********************引脚定义********************/sbit RS =P3^0; //数据指令sbit RW =P3^1; //读写sbit E =P3^2; //使能sbit CSL =P3^3; //左片选sbit CSM =P3^4; //中片选sbit CSR =P3^5; //右片选unsigned char Page; //页地址unsigned char Col; //列地址unsigned char code BMP1[];unsigned char code BMP2[];void Delay(unsigned int MS);void wtcom(void);/***************************//*检查Busy *//***************************/void BusyL(void){CSL= 0;CSM= 1;CSR= 1;wtcom();}void BusyM(void){CSL= 1;CSM= 0;CSR= 1;wtcom();}void BusyR(void){CSL= 1;CSM= 1;CSR= 0;wtcom();}void wtcom(void){RS = 0; //指令RW = 1;P1 = 0xFF; //输出0xff以便读取正确E = 1;_nop_();while(P1 & 0x80); //Status Read Bit7 = BUSYE = 0;_nop_();}/********************************************************//*根据设定的坐标数据,定位LCM上的下一个操作单元位置*//********************************************************/void Locatexy(void){unsigned char x,y;switch (Col&0xc0) /* col.and.0xC0*/{ /*条件分支执行*/case 0: {BusyL();break;}/*左区*/case 0x40: {BusyM();break;}/*中区*/case 0x80: {BusyR();break;}/*右区*/}x = Col&0x3F|0x40; /* col.and.0x3f.or.Set Y Addres s*/y = Page&0x07|0xB8; /* row.and.0x07.or.set Page */wtcom(); /* waitting for enable */RS = 0; //指令RW = 0; //写P1 = y; //设置页面地址E = 1;_nop_();E = 0;_nop_();wtcom(); /* waitting for enabl e */RS = 0;RW = 0;P1 = x; //设置列地址E = 1;_nop_();E = 0;_nop_();}/***************************//*写指令*//***************************/void WriteCommandL( unsigned char CommandByte ){BusyL();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}void WriteCommandM( unsigned char CommandByte ){BusyM();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}void WriteCommandR( unsigned char CommandByte ){BusyR();P1 = CommandByte;RS = 0; //指令RW = 0;E = 1;_nop_();E = 0;_nop_();}/***************************//*读数据*//***************************/unsigned char ReadData( void ){unsigned char DataByte;Locatexy(); /*坐标定位,返回时保留分区状态不变*/RS = 1; /*数据输出*/RW = 1; /*读入*/P1 = 0xFF; //输出0xff以便读取正确E = 1; /*读入到LCM*/_nop_();DataByte = P1; /*数据读出到数据口P1 */E = 0;_nop_();return DataByte;}/***************************//*写数据*//***************************/void WriteData( unsigned char DataByte ){Locatexy(); /*坐标定位,返回时保留分区状态不变*/RS = 1; /*数据输出*/RW = 0; /*写输出*/P1 = DataByte; /*数据输出到数据口*/E = 1; /*写入到LCM*/_nop_();E = 0;_nop_();}void LcmClear( void ){Page = 0;Col = 0;for(Page=0;Page<8;Page++)for(Col=0;Col<192;Col++)WriteData(0);}void LcmInit( void ){WriteCommandL(0x3f); //开显示WriteCommandM(0x3f);WriteCommandR(0x3f);WriteCommandL(0xc0); //设置起始地址=0WriteCommandM(0xc0);WriteCommandR(0xc0);WriteCommandL(0x3f); //开显示WriteCommandM(0x3f);WriteCommandR(0x3f);LcmClear();Col = 0;Page= 0;Locatexy();}void LcmPutDots( unsigned char DotByte ){Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){WriteData( DotByte );DotByte = ~DotByte;}}}void LcmPutBMP( unsigned char *puts ){unsigned int X=0;Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){WriteData( puts[X] );X++;}}}void LcmReverseBMP( void ){unsigned char temp;Page = 0;Col = 0;for(Page=0;Page<8;Page++){for(Col=0;Col<192;Col++){temp = ReadData(); //空读一次temp = ReadData();temp = ~temp;WriteData(temp);}}}void Delay(unsigned int MS){unsigned char us,usn;while(MS!=0){usn = 2; //for 12Mwhile(usn!=0){us=0xf6;while (us!=0){us--;};usn--;}MS--;}}void Main( void ){Delay(200); //等待复位LcmInit();LcmClear();while(1){LcmPutBMP(BMP1);Delay(1500);LcmReverseBMP();Delay(1500);LcmPutBMP(BMP2);Delay(1500);LcmReverseBMP();Delay(1500);}}unsigned char code BMP1[]={/*-- 宽度x高度=192x64 --*/0xFF,0x01,0xFD,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0xFD,0x01,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x08,0x10,0xE0,0x00,0x00,0x70,0x08,0x08, 0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x80,0x60,0x10,0x08,0x08,0x08,0x08,0x30,0x00,0x00,0x00,0x00,0xC0,0x20,0x10, 0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x82,0x42,0x32,0x3E,0x56,0x92,0x52,0x32, 0x12,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x04,0x04,0xFC,0x04,0x04,0x04,0xFC, 0x04,0x84,0xC4,0x20,0x10,0x08,0x86,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x80, 0x80,0x80,0x80,0x7E,0x90,0x90,0x90,0x90,0xD0,0x08,0x00,0x00,0x00,0x00,0x00,0xFC, 0x04,0x44,0xB4,0x0E,0x10,0x10,0xF0,0x1C,0x16,0xD0,0x10,0x10,0x10,0x08,0x00,0x00, 0x00,0x00,0x20,0xE0,0xFE,0xA0,0x18,0x28,0xE8,0x48,0x5E,0x48,0x48,0x5F,0x48,0xE8, 0x04,0x00,0x00,0x00,0x40,0x40,0x40,0xFE,0x40,0x60,0x60,0x20,0x20,0xFE,0x22,0x20, 0x20,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x80,0x80,0x00, 0x00,0x00,0x00,0x61,0x82,0x84,0x84,0x84,0x44,0x32,0x0F,0x00,0x00,0xC0,0xA0,0x90, 0x88,0x84,0x83,0xE0,0x00,0x00,0x00,0x81,0xC3,0xA5,0x18,0x18,0xA5,0xC3,0x81,0x00, 0x00,0x3F,0x42,0x81,0x81,0x81,0x81,0x42,0x3C,0x00,0x00,0x0C,0x0B,0x08,0x88,0x88, 0xFF,0x88,0x88,0x00,0x00,0x00,0x00,0xFF,0x08,0x04,0x02,0x22,0x25,0x24,0x69,0x42, 0x02,0x06,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x80,0x61,0x1F,0x01,0x01,0x01,0xFF, 0x01,0x08,0x08,0x84,0x82,0x41,0x20,0x18,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x1F, 0x10,0xD0,0x10,0x10,0x10,0xD0,0x10,0x10,0x1F,0x40,0x80,0x00,0x00,0x00,0x00,0xFF, 0x10,0x10,0x10,0x1F,0x20,0x23,0x22,0x22,0x22,0xFF,0x22,0x22,0x22,0x11,0x10,0x00, 0x00,0x18,0x06,0x01,0xFF,0x00,0x03,0x20,0x2F,0x25,0xE5,0x3D,0x25,0x65,0xA5,0x27, 0x10,0x10,0x00,0x00,0x40,0x60,0x20,0x3F,0x24,0x14,0x94,0xC4,0x64,0x1F,0x0C,0x14, 0x64,0xC4,0x83,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x00,0x00, 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x03, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01, 0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x90,0xF0,0xB0,0x90,0x90,0x90,0x90, 0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x20,0x20,0xE0,0x20,0x20,0x20,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xF0,0x00,0xC0,0x40,0x40,0x40,0xF0,0x40,0x40,0xF8,0x40,0x40,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x00,0x10, 0x60,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x44,0x22,0x11,0x11,0x2A,0x24,0x4A,0x11,0x10, 0x30,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0x08,0x08,0x08,0xFF,0x08, 0x44,0x46,0x21,0x10,0x08,0x04,0xC4,0x00,0x00,0x00,0x00,0x00,0x20,0xCF,0x09,0x09, 0xF9,0x19,0x09,0x09,0xF9,0x09,0x09,0x8F,0x60,0x00,0x00,0x00,0x00,0x04,0x04,0x04, 0xC4,0x74,0x14,0x04,0x04,0xFC,0x04,0x04,0x14,0x24,0x44,0x84,0x02,0x00,0x00,0x00, 0xC0,0x31,0x0F,0xFF,0x05,0x18,0x01,0x7F,0x2A,0x2A,0xEA,0x2A,0x2A,0x2A,0x3F,0x80, 0x80,0x00,0x00,0x00,0x01,0x11,0x11,0xF1,0x11,0x11,0x09,0x01,0x03,0x7F,0xC1,0x01, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x08,0x08,0x08,0x09,0x09,0x09,0x0B,0x0A,0x08, 0x08,0x08,0x08,0x0F,0x00,0x00,0x00,0x08,0x04,0x03,0x00,0x00,0x00,0x00,0x0F,0x10, 0x10,0x08,0x04,0x04,0x02,0x01,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0B,0x08, 0x0F,0x08,0x08,0x08,0x0F,0x0A,0x09,0x08,0x08,0x0C,0x08,0x00,0x00,0x04,0x02,0x01, 0x00,0x00,0x00,0x08,0x18,0x0F,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0x10,0x10,0x11,0x09,0x09,0x07,0x01,0x01,0x03,0x05,0x09,0x18, 0x08,0x00,0x00,0x04,0x0C,0x04,0x04,0x03,0x02,0x02,0x02,0x02,0x01,0x00,0x01,0x03, 0x04,0x08,0x1E,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, 0xFF,0x80,0xBF,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xBF,0x80,0xFF,};unsigned char code BMP2[]={/*-- 宽度x高度=192x64 --*/0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0xC0,0xC0,0xA0,0xB0,0x90,0x98,0x98,0x9C,0x9C,0xBC,0xBC,0x38,0x58,0x98,0x18, 0x30,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xFC,0xFC, 0xFC,0xFC,0xFC,0xFC,0xF8,0xF0,0xF8,0xF8,0xFC,0xF8,0xF8,0xF8,0xF0,0xC0,0x80,0x80, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFE,0x06,0x06,0x06,0x0C, 0x0C,0x98,0xF8,0xE0,0xF0,0xF0,0xF0,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8, 0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xF0,0xF8,0x98,0x0C,0x0C,0x06,0x06,0x06,0xFE,0xFC, 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xA0,0xB0,0x90,0x98,0x98,0x9C,0x9C, 0xBC,0xBC,0x38,0x58,0x98,0x18,0x30,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42, 0x81,0xFD,0x83,0xC1,0xFC,0xE2,0xC1,0xFE,0x61,0x40,0xFF,0xE1,0xC1,0xE2,0xC6,0x8D, 0xF0,0xC0,0x01,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0xE0,0xF8,0xF8,0xFC,0xFF,0xFF,0xFF,0xFF,0xF1,0x00,0x00,0x03,0x03, 0x33,0x33,0x03,0x03,0x03,0x33,0x33,0x07,0x03,0x01,0xC1,0xE1,0xF3,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFE,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xCF,0xFC,0xF8,0xFE, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xF8,0xF8,0x9E,0x07,0x01, 0x00,0x00,0x00,0x00,0x7C,0x42,0x81,0xFD,0x83,0xC1,0xFC,0xE2,0xC1,0xFE,0x61,0x40, 0xFF,0xE1,0xC1,0xE2,0xC6,0x8D,0xF0,0xC0,0x01,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x1F,0x3F,0xE5,0xCB,0x8F,0x23,0x40,0x20,0x85,0x8B,0xCF,0xE1,0xF3,0xFF, 0xFF,0xFF,0xC0,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x07,0x03,0x00,0x00,0x00,0x00, 0x00,0x30,0x28,0x28,0x38,0x30,0x00,0x00,0x00,0x00,0x03,0x07,0x0F,0x3F,0xFF,0xFF, 0xFF,0xFF,0xFF,0xF7,0xE3,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x7F,0xFF,0xFF,0xFF, 0xFF,0x83,0x01,0x01,0x01,0x31,0x79,0x31,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xCF,0x23,0x71,0x71,0x21,0x01,0x01,0x03,0x87,0xFF,0xFF,0xFF,0xFF,0x7F,0x40,0x40, 0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x1F,0x3F,0xE5,0xCB,0x8F,0x23,0x40,0x20, 0x85,0x8B,0xCF,0xE1,0xF3,0xFF,0xFF,0xFF,0xC0,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x3C,0x52,0xF9,0x80,0x00,0x03,0x05,0x05,0x03,0x01,0x00,0x40,0xE1,0xA3, 0x57,0x3F,0x1F,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF8,0xF8,0xF8, 0xF8,0xF8,0xF0,0x00,0x00,0x00,0x80,0xE0,0x28,0x27,0xE0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xC1,0x03,0x9F,0x3F,0x7F,0x7F,0x7F,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x80, 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFF,0xFF, 0xFF,0xFF,0xFF,0x3F,0x03,0x00,0x00,0x00,0x00,0x10,0x10,0x18,0x08,0x0D,0x07,0x07, 0x0F,0x1F,0x1F,0x3E,0x3E,0x7E,0x7E,0x7F,0xFF,0x7F,0x7F,0x7D,0x7C,0x7C,0x7D,0x7F, 0x7F,0xFF,0x7E,0x7E,0x7E,0x7E,0x3E,0x3F,0x1F,0x1F,0x0F,0x0F,0x09,0x10,0x10,0x20, 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x52,0xF9,0x80,0x00,0x03,0x05,0x05, 0x03,0x01,0x00,0x40,0xE1,0xA3,0x57,0x3F,0x1F,0x0F,0x07,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x03,0x7E,0x86,0x0E,0x1E,0x8E,0x06,0x02,0xC2,0x7F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03, 0x03,0x03,0x05,0x04,0x04,0x07,0x05,0x02,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x00, 0xAC,0x03,0x00,0x00,0x3F,0x00,0x00,0x00,0x01,0x03,0x87,0xAF,0x0F,0xFF,0x0F,0x07, 0x1F,0x1F,0xBF,0x3F,0x3F,0x3F,0xDF,0x0F,0x0F,0x1F,0x1F,0xFF,0x0F,0x0F,0x07,0x01, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x70,0xE0,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF6,0xC6,0x3E,0x7E,0x7E,0x7E,0x32, 0x86,0xFF,0xFE,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x7E,0x86,0x0E,0x1E, 0x8E,0x06,0x02,0xC2,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x53,0x4E,0x40,0x7F,0x80,0x80,0x9F,0xA0,0xC0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x08,0x08,0x08,0x08, 0x0B,0x00,0x06,0x00,0x03,0x04,0x04,0x0C,0x04,0x0C,0x1D,0x05,0x00,0x57,0xE0,0xC0, 0xC0,0x54,0x7B,0x00,0x1C,0x24,0x27,0x40,0x20,0x40,0x40,0x63,0x24,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x03,0x06,0x06,0x06,0x06,0x06,0x06,0x03,0x01,0x03,0x3F,0x7F,0x7F,0x7E,0x7E,0x7F, 0x63,0x03,0x03,0x03,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x53,0x4E,0x40, 0x7F,0x80,0x80,0x9F,0xA0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF, };。

相关文档
最新文档