不带字库的12864液晶汉字显示程序

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

不带字库的128*64液晶汉字显示程序

下面是线路连接图,我自己已经搞了整整一个测试成功了绝对可用

由于篇幅有限完整的c51代码下载:

/f/12864wu.rar

源代码:

#include;

#define LCD P0

unsigned char i,j,k;

sbit EN=P2^0;

sbit RW=P2^1;

sbit RS=P2^2;

sbit CS1=P2^3;

sbit CS2=P2^4;

sbit BUSY=P0^0;

void delay(unsigned char a);

unsigned char code ban[16][16]={

{0x00,0x00,0x00,0xf0,0x90,0x90,0x90,0xfe,0x90,0x9 0,0x90,0xf0,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x07,0x04,0x04,0x04,0x3f,0x24,0x2 4,0x24,0x27,0x20,0x38,0x00,0x00},//电

{0x00,0x00,0x00,0x00,0x8c,0x88,0x88,0x88,0x88,0xc 8,0xa8,0x98,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x7f,0x0 0,0x00,0x00,0x00,0x00,0x00,0x00},//子

{0x00,0x00,0x00,0x00,0x10,0x10,0x30,0x54,0x9c,0x9 0,0x50,0x00,0x30,0x10,0x00,0x00},

{0x00,0x40,0x30,0x0c,0x03,0x01,0x01,0x01,0x01,0x0 1,0x01,0x01,0x01,0x00,0x00,0x00},//产

{0x00,0x00,0x00,0x00,0x7c,0x44,0x44,0x44,0x44,0x4 4,0x44,0x7c,0x00,0x00,0x00,0x00},

{0x00,0x00,0x3f,0x21,0x21,0x21,0x3f,0x00,0x00,0x3

{0x00,0x00,0x00,0x00,0x0c,0x08,0x08,0x08,0xf8,0x0 8,0x08,0x08,0x08,0x00,0x00,0x00},

{0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x3f,0x2 0,0x20,0x20,0x20,0x30,0x00,0x00},//工

{0x00,0x90,0x90,0x88,0xf8,0x84,0x86,0x00,0x7c,0x4 4,0x44,0x44,0x44,0x7c,0x00,0x00},

{0x40,0x30,0x0c,0x02,0x7f,0x02,0x0c,0x10,0x49,0x4 9,0x49,0x7f,0x49,0x49,0x00,0x00},//程

{0x00,0x10,0x10,0x10,0xfc,0x90,0x10,0x00,0xd0,0x5 0,0x50,0x7e,0x50,0xd0,0x50,0x00},

{0x04,0x08,0x04,0x22,0x7f,0x00,0x40,0x20,0x10,0x0 9,0x06,0x06,0x09,0x10,0x20,0x40},//技

{0x00,0x00,0x10,0x10,0x10,0xd0,0x10,0xfe,0x10,0x5 0,0x94,0x1c,0x10,0x00,0x00,0x00},

{0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x7f,0x00,0x0 0,0x00,0x03,0x04,0x18,0x60,0x00},//术

};

unsigned char code qrs[6][16]={

{0x00,0x00,0xbc,0xe0,0xa0,0xa0,0xe0,0xa0,0x3f,0xa 0,0x60,0x20,0x20,0x3c,0x00,0x00},

{0x00,0x00,0x00,0x3f,0x24,0x24,0x3f,0x22,0x11,0x0

{0x00,0x00,0x00,0x00,0x02,0x04,0xc8,0x30,0x20,0x4 0,0x80,0x00,0x00,0x00,0x00,0x00},

{0x00,0x40,0x20,0x18,0x06,0x01,0x00,0x00,0x00,0x0 0,0x00,0x03,0x06,0x0c,0x30,0x00},//入

--{0x00,0x00,0x00,0x20,0xa0,0xa0,0xa0,0xa0,0xa2,0 xa4,0x38,0xe0,0x24,0x2c,0x00,0x00},

{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x0f,0x09,0x0 4,0x04,0x00,0x07,0x18,0x20,0x00},//式

};

checkbusy()

{ EN=1;

RW=1;

RS=0;

LCD=0XFF;

if(BUSY);

}

writecode(unsigned char dat) //写命令

{ checkbusy();

EN=1;

RW=0;

RS=0;

LCD=dat;

EN=1;

EN=0;

}

writedata(unsigned char dat) //写数据

{ checkbusy();

EN=1;

RW=0;

RS=1;

LCD=dat;

EN=1;

EN=0;

}

void displayhanzi(unsigned char page,unsigned char lineaddress,int n, unsigned char table[][16]) {

unsigned char temp[32];

if(lineaddress;=0X80)

{

CS1=0;//right

CS2=1;

lineaddress=lineaddress-0X40;

相关文档
最新文档