51单片机-240128液晶程序与调试

发布者:hzx312895379最新更新时间:2016-09-01 来源: eefocus关键字:51单片机  240128液晶 手机看文章 扫描二维码
随时随地手机看文章
    今天终于把金鹏OCMJ8X15D-2液晶(240128点阵带字库无触屏液晶)调好了。240128液晶程序与调试 - suneleo - 电子世界这块液晶能显示8行15个汉字,还有放大字形,从16*16点放大到32*32点的功能。对于觉得12864的4行8列内容过少,或者觉得0.5*0.5mm的点的大小过于粗糙的情况来说,这款液晶是很适合的,它的点大小为0.33*0.33mm。
 
    可能是习惯了12864这样的液晶,结果在硬件连接上就出来了一个重大错误,结果弄了好久也只显示条形点阵,而且对比度很差。这个错误就是240128液晶的对比度调节电位器,两端一端接地,另一端接VOUT(22脚)!而我习惯性的接到了5V!在曹老师的提醒下才发现了这个问题,在手册的角落里发现了硬件连接图:
 
240128液晶程序与调试 - suneleo - 电子世界
 
调试效果图:
240128液晶程序与调试 - suneleo - 电子世界
 
240128液晶程序与调试 - suneleo - 电子世界
 
最后附上调试好的程序:
//=============================================
//控制器:51单片机
//液晶:  OCMJ8X15D-2(240128)带字库
//模式:  默认8080系列接口
//时间:  2013.2.26
//=============================================
#include
sbit lcd_rs   =P2^0;
sbit lcd_wr   =P2^1;
sbit lcd_rd   =P2^2;
sbit lcd_cs1  =P2^3;
sbit lcd_cs2  =P2^4;
sbit lcd_busy =P2^5;
sbit lcd_int  =P2^6;
sbit lcd_rst  =P2^7;
#define lcd_regname  P1
#define lcd_regdata  P1
#define lcd_regnada  P1
#define lcd_data     P1
#define lcd_control  P2
#define uchar        unsigned char
#define uint         unsigned int
//=============================================
void lcd_regwr(uchar regnada) small;
void delay(int k);
void gotoxy(uchar x,uchar y) small;
//=============================================
uchar code tab1[]={
"    华  中  科  技  大  学    "
"  光  电  国  家  实  验  室  "
"湖北省武汉市洪山区珞瑜路1037号"
"          黄鹤楼-崔颢         "
"昔人已乘黄鹤去,此地空余黄鹤楼"
"黄鹤一去不复返,白云千载空悠悠"
"晴川历历汉阳树,芳草萋萋鹦鹉洲"
"日暮乡关何处是,烟波江上使人愁"};
 
uchar code tab2[]={
"                              "
"                              "
"     欢迎访问我的网易博客     "
" http://suneleo.blog.163.com  "
"  欢迎给我留言或者发邮件交流  "
"     mail:suneleo@163.com     "
"                              "
"                              "};
 
uchar code tab3[]={
/*--  调入了一幅图像:C:\Users\Administrator\Desktop\240128 tuzki.bmp  --*/
/*--  宽度x高度=240x128  --*/
0x00,0x38,0x00,0x00,0xFB,0xFC,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,
0x00,0x01,0xFF,0xFE,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0x00,0x01,
0x3F,0xFF,0x60,0x1A,0x00,0x00,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,0xFF,
0xA0,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x8F,0xC0,0x07,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0xF0,0x00,0x00,0x00,0x01,0x10,0x00,0x00,0x0F,0xB3,0xE8,0x07,0xE0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,
0xF0,0x04,0x00,0x00,0x1F,0x3C,0x00,0x00,0x0F,0x03,0xEC,0x00,0x78,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0xFF,0xF8,0x0F,
0x08,0x00,0x08,0x06,0x00,0x00,0x0F,0x01,0xF4,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x1D,0xFF,0xF8,0x07,0x03,0xFF,
0x17,0xF8,0x00,0x00,0x0F,0x80,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xC1,0x00,0x00,0x00,0x00,0x03,0xFC,0xF8,0x00,0x1F,0xFF,0x0F,0xFF,
0x40,0x00,0x0F,0xB0,0xF8,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,
0x1E,0x7E,0xE2,0x00,0x00,0x00,0x0F,0xFA,0xFA,0x05,0x3F,0xFF,0x0F,0xFF,0xDC,0x00,
0x0F,0xB0,0xF8,0x1D,0xC1,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,
0x60,0x00,0x00,0x00,0x1F,0xF6,0xFA,0x07,0xFF,0xFF,0x1F,0xFF,0xFC,0x00,0x07,0xD0,
0x7C,0x0F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFB,0xFF,0xB0,0x00,
0x00,0x00,0x1F,0xEE,0xF8,0x05,0xFF,0xC7,0x1F,0xFF,0xF8,0x00,0x07,0xD1,0x7F,0xFF,
0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x80,0x00,0x00,0x00,
0x1F,0xDD,0xF0,0x0B,0xFC,0x19,0x1F,0x8F,0xF9,0x80,0x07,0xDE,0x7F,0xFF,0xFF,0xFF,
0xFC,0x1E,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0xBF,0xA1,
0xF0,0x77,0xFE,0x19,0x1F,0x1B,0xFE,0xC0,0x0B,0xE1,0xFF,0xFF,0xFF,0xFF,0xFF,0xC6,
0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0xBF,0xE1,0xF4,0x6F,
0xF6,0x19,0x1F,0x3F,0xFF,0x00,0x0B,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x3F,0xC3,0xF4,0x0F,0xF8,0x1B,
0x1F,0x33,0x7F,0x98,0x0D,0xFF,0xFF,0xFF,0x00,0x07,0xFF,0xFE,0x7C,0x00,0x00,0x00,
0x00,0x7F,0xFF,0xFF,0xC0,0x06,0xA0,0x0F,0xFE,0xF7,0xE8,0x9F,0xA1,0x97,0x0F,0xB0,
0x1F,0xD8,0x61,0xFF,0xFE,0x00,0x00,0x00,0x0F,0xFF,0x98,0x00,0x00,0x00,0x00,0x7F,
0xFF,0xFF,0xD0,0x07,0x03,0xFF,0xFC,0x27,0xC0,0xBF,0x00,0xC7,0x0F,0xA0,0x2F,0xE8,
0x8F,0xFF,0xE0,0x00,0x00,0x00,0x11,0xFF,0xEC,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,
0xC0,0x00,0x3F,0xFF,0xFE,0x1F,0xFC,0x7E,0x80,0xCF,0x07,0xC0,0x37,0xF0,0x3F,0xFE,
0x0C,0x00,0x00,0x00,0x0E,0x3F,0xF0,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xA0,0x01,
0xFF,0xFF,0xFE,0x1F,0xFF,0xFD,0x84,0x1F,0x1F,0xE4,0x13,0xFC,0xFF,0xF0,0x80,0x00,
0x00,0x00,0x00,0x0F,0xFB,0xC0,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xA2,0x8F,0xFF,0xFF,
0x04,0x3F,0xFF,0xF9,0x0E,0x3F,0x0B,0xF2,0x04,0xF9,0xFF,0x80,0x00,0x00,0x00,0x00,
0x00,0x03,0xFD,0x80,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xE2,0x3F,0xFF,0x80,0x00,0x21,
0xFF,0xF8,0x0C,0xFF,0x1D,0xFC,0x07,0x7F,0xFE,0x70,0x00,0x00,0x00,0x00,0x00,0x04,
0xFE,0xC0,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x60,0xFF,0xF0,0x30,0x00,0x20,0x0F,0xF0,
0x09,0xFF,0x0C,0xFE,0x67,0x3F,0xF8,0xE0,0x00,0x00,0x00,0x00,0x00,0x06,0x7F,0x58,
0x00,0x00,0x00,0x6F,0xFF,0xFE,0xF3,0xFF,0x80,0x00,0x00,0x01,0x81,0xE8,0x23,0xFE,
0x08,0x7F,0x3F,0x9F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3F,0xB8,0x00,0x00,
0x00,0x67,0xFF,0xFD,0xC7,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFC,0x01,0xBF,
0xCF,0x3F,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0xB8,0x00,0x00,0x00,0x03,
0xFF,0xFB,0x9F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFA,0x01,0xDF,0xF2,0x7F,
0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xC8,0x00,0x00,0x00,0x05,0xFF,0xF7,
0x3F,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xE7,0x01,0xE7,0xFC,0xFE,0x60,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xE8,0x00,0x00,0x00,0x06,0xFF,0xEE,0x7F,0x30,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xCF,0x00,0x01,0xFF,0xFD,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xF8,0x00,0x00,0x00,0x00,0x3F,0x9D,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0xF3,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x09,0xF0,0x00,0x00,0x00,0x00,0xCF,0x2B,0xF8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0x20,0x00,0x03,0x3F,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0xF8,0x00,0x00,0x00,0x00,0xE0,0xC7,0xF6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3F,0x88,0x00,0x01,0x8F,0xCE,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x31,0xE4,0xFB,
0x00,0x00,0x00,0x00,0x19,0x97,0xE4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0xDE,
0x00,0x00,0x2F,0xD0,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x04,0x3C,0x02,0xFD,0x00,0x00,
0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xEE,0x00,0x00,
0x5F,0xB8,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFE,0x2F,0xF0,0x7D,0x80,0x00,0x00,0x00,
0x00,0x1F,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF6,0x00,0x00,0x3F,0x38,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFA,0x2F,0xFF,0xFD,0x80,0x00,0x00,0x00,0x00,0x3F,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0xFA,0x00,0x00,0x3E,0xC0,0x00,0x00,
0x01,0xFF,0xFF,0xFF,0xFA,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0xBE,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xFE,0x00,0x00,0x3E,0xC0,0x00,0x00,0x03,0xFF,
0xFF,0xFF,0xFE,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0C,0xFC,0x00,0x00,0x7C,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,
0x06,0x11,0xFF,0xBE,0x00,0x00,0x00,0x00,0x01,0x7C,0x00,0x00,0x00,0x07,0xFF,0x80,
0x00,0x00,0x1E,0xFE,0x00,0x01,0x7C,0x80,0x00,0x00,0x01,0x00,0x00,0x00,0x0C,0x30,
0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0xFD,0xF8,0x00,0xD8,0xEF,0xFF,0xFF,0x83,0x00,
0x0D,0x7E,0x00,0x02,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x3E,
0x00,0x00,0x00,0x00,0x00,0xF9,0xE7,0xFF,0xF8,0x9F,0xFF,0xFF,0xFD,0x80,0x00,0x3F,
0x00,0x02,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,
0x00,0x00,0x00,0xFB,0xFF,0xFF,0xF0,0xDF,0xFF,0xFF,0xFF,0xC0,0x00,0xBF,0x00,0x02,
0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,
0x00,0xFB,0x7F,0xFF,0xF0,0xDF,0xFF,0xFF,0xFF,0x00,0x01,0x9F,0x00,0x02,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x0D,0xF2,
0x7F,0xFF,0xF0,0x0F,0xFF,0xFF,0xFF,0x80,0x00,0x1F,0x00,0x02,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x05,0xF2,0xFF,0xFF,
0xF8,0x07,0xFF,0xFF,0xFF,0x80,0x00,0x1F,0x00,0x00,0xF4,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x09,0xF2,0x7F,0xFF,0xF8,0x0E,
0x70,0x07,0xFF,0x80,0x00,0x0F,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x01,0xF0,0x7F,0xFC,0x00,0x0D,0x01,0xC2,
0x07,0x00,0x00,0x0F,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x7E,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0F,0x00,0x01,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,
0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,
0x00,0x01,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,
0x00,0x10,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x01,
0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xFE,0x00,0x00,0x00,0x67,
0x1B,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x01,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x1F,0xC9,0xF0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x01,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xFD,0x00,0x00,0x00,0x7F,0xE1,0xF0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x01,0xF4,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x05,0xFB,0x00,0x00,0x00,0x7F,0xF1,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFA,0x00,0x00,0x00,0x7F,0xFD,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x17,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xF0,0x00,0x00,0x00,0xFC,0xFD,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0xF0,
0x00,0x00,0x00,0xFC,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,
0x00,0x02,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0xE8,0x00,0x00,
0x00,0xFD,0x7E,0xF9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x02,
0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xE8,0x00,0x00,0x00,0x7C,
0xBE,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0xD8,0x00,0x00,0x00,0x7D,0x9F,0xFA,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0xB8,0x00,0x00,0x00,0x7D,0xDF,0x78,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x02,0x7D,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xBF,0x38,0x00,0x00,0x00,0x7E,0x0F,0xFD,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x01,0x7E,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x7E,0x00,0x00,0x00,0x00,0x3E,0x0F,0xFD,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0x00,0x03,0x7E,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,
0xFE,0x80,0x00,0x00,0x00,0x3F,0x07,0xBE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0F,0x00,0x01,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xFD,0x80,
0x00,0x00,0x00,0x3F,0x07,0xDE,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0xF8,0x00,0x00,0x00,
0x00,0x5F,0xB7,0xFF,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDF,0x00,0x00,
0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xF4,0x00,0x00,0x00,0x00,0x1F,
0xFB,0xEF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x1F,0xC0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0xEC,0x00,0x00,0x00,0x00,0x6F,0xDB,0xFF,
0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x00,0x00,0x2F,0xE8,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xBF,0xD8,0x00,0x00,0x00,0x00,0x2F,0xE5,0xF7,0xDA,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x37,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x7F,0x80,0x00,0x00,0x00,0x00,0x07,0xFC,0xFB,0xEC,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x3B,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0xFE,0x40,0x00,0x00,0x00,0x00,0x07,0xF4,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFC,0x00,0x00,0x3B,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFD,
0xC0,0x00,0x00,0x00,0x00,0x03,0xFA,0x7D,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0xFC,0x00,0x00,0x05,0xFE,0xE0,0x00,0x00,0x00,0x00,0x00,0x13,0xF8,0x00,0x80,
0x00,0x00,0x00,0x07,0xFF,0x7E,0xFA,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0xFA,
0x00,0x00,0x03,0xFF,0x38,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,
0x00,0x07,0xFD,0xBF,0x7C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF6,0x00,0x00,
0x03,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x07,
0xFE,0xFF,0xBE,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFE,0x00,0x61,0xC2,0x7F,
0xE2,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xC7,0x00,0x00,0x00,0x06,0x7F,0x5F,
0xDF,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0xFC,0x01,0x00,0xC0,0x6F,0xF8,0x78,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xF3,0x80,0x00,0x00,0x00,0xBF,0xAF,0xEF,0xCC,
0x00,0x00,0x00,0x00,0x00,0x01,0x9F,0xE0,0x00,0x7E,0x20,0x77,0xFF,0x00,0x00,0x00,
0x00,0x00,0x10,0x03,0xFF,0xFD,0x80,0x00,0x00,0x00,0xDF,0x97,0xFF,0xE4,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0x60,0x01,0xFF,0x80,0x79,0xFF,0xF0,0x00,0x00,0x00,0x00,
0x07,0x98,0x0F,0xFE,0x00,0x00,0x00,0x00,0x7F,0xDB,0xFF,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0x40,0xF3,0xFF,0xCC,0x34,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0xFF,0x70,0x00,0x00,0x00,0x2F,0xED,0xFF,0xFC,0x78,0x00,0x00,0x00,0x00,0x39,
0xFD,0x00,0xE7,0xFF,0xE4,0x00,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,
0xB0,0x00,0x00,0x00,0x07,0xF3,0x7F,0xFF,0x08,0x00,0x00,0x00,0x00,0xE7,0xFB,0x00,
0xCF,0xFF,0xF0,0x00,0xCF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0xF0,0x00,
0x00,0x00,0x0B,0xF9,0x9F,0xFF,0xE0,0x00,0x00,0x00,0x00,0x0F,0xE6,0x00,0x9F,0xC1,
0xFD,0xC0,0xF1,0xF8,0x00,0x00,0x00,0x00,0x00,0x7F,0x86,0xEF,0xC0,0x00,0x00,0x00,
0x0D,0xFC,0xCF,0xFF,0xFC,0x00,0x00,0x00,0x1E,0x3F,0x8E,0x00,0x7F,0xA2,0x7E,0xC0,
0x0B,0xF0,0x00,0x00,0x00,0x00,0x01,0xFF,0xF3,0x87,0xE0,0x00,0x00,0x00,0x00,0xFF,
0x61,0xFF,0xFF,0x00,0x00,0x00,0x78,0xFF,0x00,0x00,0xFF,0x61,0x3F,0x00,0x03,0xE0,
0x00,0x00,0x00,0x00,0x01,0xFF,0xFD,0x83,0xE0,0x00,0x00,0x00,0x01,0x7F,0x80,0x3F,
0xFF,0x00,0x00,0x00,0x63,0xFF,0x00,0x00,0xFE,0xE3,0x9F,0x80,0x07,0xD0,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFE,0x0B,0xF0,0x00,0x00,0x00,0x01,0x9F,0xC3,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0x00,0x00,0xFD,0xB9,0xCF,0xC8,0x67,0xD0,0x00,0x00,0x00,0x00,
0x01,0xF0,0x7F,0x0B,0xF8,0x00,0x00,0x00,0x00,0xCF,0xF3,0xF8,0x00,0x00,0x00,0x00,
0x1F,0xFF,0x00,0x00,0xFB,0x30,0x67,0xE8,0x6F,0xD0,0x00,0x00,0x00,0x00,0x01,0xFA,
0x0F,0x03,0xF8,0x00,0x00,0x00,0x00,0x07,0xF8,0xC0,0x00,0x00,0x00,0x00,0x7C,0x1F,
0x00,0x00,0xFA,0x2F,0xB3,0xF0,0x0F,0x90,0x00,0x00,0x00,0x00,0x00,0xFC,0x67,0x01,
0xF8,0x00,0x00,0x00,0x00,0x0F,0xFE,0x00,0x00,0x00,0x00,0x00,0x60,0x5F,0x00,0x00,
0xFE,0x9F,0xD9,0xF8,0x1F,0xA0,0x00,0x00,0x00,0x00,0x00,0x7C,0x77,0x81,0xF8,0x00,
0x00,0x00,0x00,0x9F,0xFF,0x80,0x00,0x00,0x00,0x00,0x5F,0xDF,0x80,0x00,0xF8,0x3F,
0xDC,0xFC,0xDF,0x20,0x00,0x00,0x00,0x00,0x03,0xBE,0xA7,0x85,0xF8,0x00,0x00,0x00,
0x00,0xDF,0xFF,0xFF,0x18,0x00,0xCE,0x00,0x07,0xDF,0xA0,0x00,0x7C,0xFF,0xE7,0x7E,
0xBF,0x00,0x00,0x00,0x00,0x00,0x03,0xBF,0x87,0x87,0xF8,0x00,0x00,0x00,0x00,0x9F,
0x3F,0xFF,0xF8,0x00,0x3F,0x00,0x00,0x0F,0x80,0x00,0xBF,0xFD,0xF7,0x3F,0x7E,0x00,
0x00,0x00,0x00,0x00,0x01,0xDF,0x47,0x83,0xF8,0x00,0x00,0x00,0x00,0xBF,0x4F,0xFF,
0xC0,0x00,0xFF,0x00,0x00,0x0F,0xA0,0x00,0xBF,0xF8,0xFB,0xDF,0xFE,0x00,0x00,0x00,
0x00,0x00,0x03,0xCF,0x87,0x03,0xF0,0x00,0x00,0x00,0x00,0x9F,0xA7,0xFF,0xF0,0x07,
0xFE,0x00,0x00,0x0F,0x90,0x00,0x1F,0xF7,0x7D,0xC7,0xFC,0x03,0x60,0x00,0x00,0x00,
0x00,0x2F,0xE7,0x03,0xF0,0x00,0x00,0x00,0x00,0x1F,0xD9,0xFF,0xFF,0xFF,0xFE,0x00,
0x00,0x0F,0x80,0x00,0x07,0xCF,0x3E,0xF3,0xF9,0x01,0xE0,0x00,0x00,0x00,0x00,0x37,
0xCF,0x47,0xF0,0x00,0x00,0x00,0x00,0x1F,0xEE,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x0F,
0xD0,0x00,0x10,0x3F,0x9F,0x79,0xF3,0x03,0xC0,0x00,0x00,0x00,0x00,0x33,0xEE,0x07,
0xC0,0x00,0x00,0x00,0x00,0x0F,0xFB,0x9F,0xFF,0xFF,0xE2,0x00,0x00,0x0F,0xC0,0x00,
0x00,0x0C,0xDF,0xFC,0x0F,0x1B,0xEC,0x00,0x00,0x00,0x00,0x0B,0xFE,0xFF,0xC0,0x00,
0x00,0x00,0x00,0x07,0xFC,0xE3,0xFF,0xFF,0x8F,0x78,0xC0,0x0F,0xD0,0x00,0x00,0x00,
0x6F,0xF8,0x00,0x17,0xFE,0x00,0x00,0x00,0x00,0x01,0xFC,0xFF,0x90,0x00,0x00,0x00,
0x00,0x1B,0xFF,0x40,0x3F,0xF8,0x01,0xEF,0xE0,0x07,0xD0,0x00,0x00,0x00,0x37,0xF8,
0x00,0x17,0xF4,0x00,0x00,0x00,0x00,0x01,0xFD,0xDF,0xA0,0x00,0x00,0x00,0x00,0x1C,
0xFF,0xC7,0xC0,0x03,0x01,0xFF,0x80,0x07,0xD0,0x00,0x00,0x00,0x3B,0xF0,0x00,0x07,
0xF2,0x00,0x00,0x00,0x00,0x02,0xF9,0xBF,0x70,0x00,0x00,0x00,0x00,0x1F,0x7F,0xE3,
0x8E,0x73,0x08,0x7F,0x80,0x07,0xC0,0x00,0x00,0x00,0x05,0xFB,0x81,0xEF,0xFA,0x00,
0x00,0x00,0x00,0x06,0xF8,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xF8,0x39,0x98,
0x83,0xFF,0x80,0x07,0xE0,0x00,0x00,0x00,0x07,0xFC,0x01,0xDF,0xFC,0x00,0x00,0x00,
0x00,0x03,0xFD,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0x80,0x00,0x3F,0xFF,
0xC0,0x07,0xE0,0x00,0x00,0x00,0x07,0x7E,0x00,0x9F,0xFC,0x00,0x00,0x00,0x00,0x03,
0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xFE,0x1F,0xFF,0xFF,0xC0,0x07,
0xE0,0x00,0x00,0x00,0x02,0xBF,0x94,0x3F,0x7E,0xC0,0x00,0x00,0x00,0x03,0x7F,0xF9,
0x00,0x00,0x00,0x00,0x00,0x00,0x09,0xFF,0xFF,0xFF,0xFF,0xFD,0x80,0x07,0xE0,0x00,
0x00,0x00,0x00,0x5F,0xC0,0x7E,0x3F,0x40,0x00,0x00,0x00,0x00,0x3F,0xF8,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xF0,0x00,0x07,0xE0,0x00,0x00,0x00,
0x00,0x6F,0xF1,0xFF,0x1F,0x40,0x00,0x00,0x00,0x00,0x3F,0xD8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x80,0x00,0x03,0xE0,0x00,0x00,0x00,0x00,0x77,
0xFF,0xFC,0x1F,0x80,0x00,0x00,0x00,0x00,0x1F,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x33,0xFF,0xFF,0xF8,0x60,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x6B,0xFF,0xFA,
0x0F,0x98,0x00,0x00,0x00,0x00,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
0x3F,0xFF,0x80,0x20,0x00,0x0B,0xF0,0x00,0x00,0x00,0x00,0x05,0xFF,0xF7,0x0F,0xD8,
0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,
0x00,0x00,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x06,0x7F,0xC0,0x07,0xF8,0x00,0x00,
0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x90,0x00,0x00,
0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x07,0x1F,0x00,0x0F,0xFC,0x00,0x00,0x00,0x00,
0x6F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xD8,0x00,0x00,0x00,0x03,
0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x6F,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x03,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF8,0x00,0x00,0x00,0x00,0x2F,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x03,0xFA,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xF8,0x00,0x00,0x00,0x00,0x2F,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xE0,0x00,0x00,0x00,0x05,0xFA,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x00,0x07,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x07,0xE0,0x00,0x00,0x00,0x05,0xFA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0xFC,0x00,0x00,0x00,0x00,0x07,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xF0,0x00,0x00,0x00,0x05,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFC,
0x00,0x00,0x00,0x00,0x07,0xD0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,
0x00,0x00,0x00,0x01,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x7E,0x00,0x00,
0x00,0x00,0x07,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0xF0,0x00,0x00,
0x00,0x01,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3E,0x80,0x00,0x00,0x00,
0x07,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFB,0x00,0x00,0x00,0x01,
0xFD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x07,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xF9,0x00,0x00,0x00,0x01,0xFE,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x07,0xB0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xF8,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x08,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0D,0xFD,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0xFD,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x04,0xFF,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0xFE,
0x00,0x00,0x00,0x00,0xFE,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xFE,0x00,0x00,
0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,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,0x2F,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
 
//=============================================
void lcd_regwrite(uchar regname,uchar regdata) small
{                                  
lcd_regwr(regname);
delay(1);
lcd_regwr(regdata);
}
 
void lcd_regwr(uchar regnada) small
{
lcd_regnada = regnada;
lcd_cs1 =0; 
lcd_rd = 1; 
lcd_rs = 0;
lcd_wr = 0; 
;
lcd_wr = 1; 
 
lcd_rs = 1; 
lcd_cs1 =1; 
}
 
//---------------------------------------------
void lcd_datawrite(uchar wrdata) small
{
while(lcd_busy == 1);
lcd_data = wrdata;
lcd_cs1 =0; 
lcd_rd = 1; 
lcd_rs = 1; 
lcd_wr = 0; 
;
lcd_wr = 1; 
 
lcd_rs = 1; 
lcd_cs1 =1; 
}
//---------------------------------------------
uchar lcd_regread(uchar regname) small
{                           
uchar reg_rddata;
lcd_regwr(regname);
 
lcd_data = 0xff;
   lcd_cs1 =0; 
   lcd_wr = 1; 
   lcd_rs = 0; 
   lcd_rd = 0; 
;
reg_rddata = lcd_data;
lcd_rd = 1; 
 
lcd_rs = 1; 
lcd_cs1 =1; 
return(reg_rddata);
}
//=============================================
void delay(int k)
{
int i;
for(i=0;i
;
}
void delay1 (int ms)
{
int i,j;
for(i=0;i
for(j=0;j<123;j++)
;
}
 
//=============================================
void lcd_reset(void) small
{              
delay1(120);
lcd_control = 0xff; // lcd_rs/wr/rd/cs1/cs2 normal - skeep high.
}
//---------------------------------------------
void lcd_initial(void) small
{                   
lcd_regwrite(0x00,0xc9); // lcd control register(lcr)
lcd_regwrite(0x01,0xf2); // misc.register(mir)
lcd_regwrite(0x02,0x10); // advance power setup register(apsr)
lcd_regwrite(0x03,0x80); // advance display setup regiser(adsr)
lcd_regwrite(0x10,0x6b); // cursor control register(ccr)
lcd_regwrite(0x11,0x00); // distance of word or lines register(dwlr)
lcd_regwrite(0x12,0x91); // memory access mode register(awrr)
lcd_regwrite(0x21,0x1d); // display window right register(dwrr)
lcd_regwrite(0x31,0x7f); // display window bottom register(dwbr)
lcd_regwrite(0x41,0x00); // display window left register(dwlr)
lcd_regwrite(0x51,0x00); // display window top register(dwtr)
lcd_regwrite(0x20,0x1d); // active window right register(awrr)
lcd_regwrite(0x30,0x7f); // active window bottom register(awbr)
lcd_regwrite(0x40,0x00); // active window left register(awlr)
lcd_regwrite(0x50,0x00); // active window top register(awtr)
lcd_regwrite(0x60,0x00); // cursor position x register(cpxr)
lcd_regwrite(0x61,0x00); // begin segment position register(bgsg)
lcd_regwrite(0x70,0x00); // cursor position y register(cpyr)
lcd_regwrite(0x71,0x00); // shift action range,begin commom register(bgcm)
lcd_regwrite(0x72,0x7f); // shift action range,end commom register(edcm)
lcd_regwrite(0x80,0xaa); // blink time register(btr)
lcd_regwrite(0x81,0x00); // frame rate polarity change at common_fa register(fdca)
lcd_regwrite(0x91,0x00); // frame rate polarity change at common_fb register(fdcb)
lcd_regwrite(0x90,0x0f); // shift clock control register(sccr)
lcd_regwrite(0xa0,0x11); // interrupt setup & status register(frcb)
lcd_regwrite(0xa1,0x00); // key scan control register(kscr)
lcd_regwrite(0xa2,0x00); // key scan data register(ksdr)
lcd_regwrite(0xa3,0x00); // key scan data expand register(kser)
lcd_regwrite(0xb0,0x1d); // interrupt column setup register(intx)
lcd_regwrite(0xb1,0x7f); // interrupt row setup register(inty)
lcd_regwrite(0xc0,0x00); // touch panel control register(tpcr)
lcd_regwrite(0xc1,0x0a); // adc status register(adcs)
lcd_regwrite(0xc8,0x80); // touch panel segment high byte data register(tpxr)
lcd_regwrite(0xc9,0x80); // touch panel common high byte data register(tpyr)
lcd_regwrite(0xca,0x00); // touch panel segment/common low byte data register(tpzr)
lcd_regwrite(0xd0,0x80); // lcd contrast control register (lccr)
lcd_regwrite(0xe0,0x00); // pattern data register(pdr)
lcd_regwrite(0xf0,0xa0); // font control register(fcr)
lcd_regwrite(0xf1,0x0f); // font size control register
}
//---------------------------------------------
void lcd_clear(void) small
{                   
uchar reg_rddata;
lcd_regwrite(0xe0,0x00);
reg_rddata = lcd_regread(0xf0);
reg_rddata |= 0x08;
lcd_regwrite(0xf0,reg_rddata);
}
//---------------------------------------------
void lcd_photo(uchar code *pho) small
{                          
uchar i,j;
uchar code *pp;
gotoxy(0,0);
pp=pho;
for(j=0;j<128;j++)
{
for(i=0;i<30;i++)
{
lcd_datawrite(*pp);
++pp;
}
}
}
 
//---------------------------------------------
void lcd_lattice(uchar data1,uchar data2) small
{                                    
uchar i,j;
gotoxy(0,0);
for(j=0;j<32;j++)
{
for(i=0;i<60;i++)
{
lcd_datawrite(data1);
//delay1(1000);
    }
 
for(i=0;i<60;i++)
     {
lcd_datawrite(data2);
     }
   }
}
//---------------------------------------------
void lcd_character(uchar code *cha,int count) small
{                                   
int i;
for(i=0;i
{
lcd_datawrite(*cha);
++cha;
}
}
//---------------------------------------------
extern void gotoxy(uchar x,uchar y) small
{                                
  lcd_regwrite(0x60,x); // active window top register(awtr)
  lcd_regwrite(0x70,y); // active window top register(awtr)
}
 
 
 
//=============================================
void main (void)
{
lcd_reset();    
lcd_initial(); 
lcd_clear(); 
while(1)
{
lcd_regwrite(0x00,0xcd);
lcd_regwrite(0x10,0x2b);
     gotoxy(0x00,0x00);      
     lcd_character(tab1,240);
     delay1(3000);
    
     lcd_regwrite(0x00,0xc5);
     lcd_lattice(0xcc,0xcc);
     delay1(3000);
lcd_lattice(0x33,0x33);
delay1(3000);
 
lcd_photo(tab3);
delay1(3000);
 
lcd_regwrite(0x00,0xcd);
   lcd_regwrite(0x10,0x3b);
     gotoxy(0x00,0x00);
     lcd_character(tab2,240);
     delay1(3000);
    
     lcd_regwrite(0x00,0xc5); 
     lcd_lattice(0xcc,0x33);
     delay1(3000);
 
  }
}

关键字:51单片机  240128液晶 引用地址:51单片机-240128液晶程序与调试

上一篇:SST39SF040与MCS-51的接口设计
下一篇:51单片机-超声波测距程序

推荐阅读最新更新时间:2024-03-16 15:07

51单片机(十三)—— 看门狗功能测试
一、看门狗介绍 在由单片机构成的系统中,由于单片机的工作有可能受到外界电磁场的干扰,造成程序的跑飞,从而陷入死循环,程序的正常运行被打断,单片机控制的系统便无法继续工作,这样会造成整个系统陷入停滞状态,发生不可预测的后果,所以出于对单片机运行状态进行实时监测的考虑,便产生了一种专门用于监测单片机程序运行状态的芯片,俗称“看门狗(Watch Dog)”。 加入看门狗电路的目的是使单片机可以在无人状态下实现连续工作,其工作过程为:看门狗芯片和单片机的一个I/O引脚相连,该I/O引脚通过单片机的程序控制,使它定时地往看门狗芯片的这个引脚上送入高电平(或低电平),这一程序语句是分散地放在单片机其它控制语句中间的,一旦单
[单片机]
<font color='red'>51单片机</font>(十三)—— 看门狗功能测试
一款简易示波器的设计方案
  随着电子通信以及教学事业的发展,示波器的应用越来越广泛,它在教学中所起到的作用越来越重要,示波器可以测量信号的幅度,频率以及波形等等,但是高精度的示波器非常昂贵,对于非盈利事业的教学组织来说无疑不合适,所以提出了一种以单片机为控制核心的简易示波器设计方案。它由前向控制部分,数据采集和存储部分,51单片机控制部分以及按键和MS12864R显示部分组成。   1 简易数字示波器的工作原理以及总体框架   本设计硬件电路部分由单片机控制系统电路,前向输入调理电路,模数转换和存储电路,以及按键显示电路组成。其工作的基本思路就是以单片机为控制核心,让AD芯片完成数据的离散化,采集数据经过缓冲暂存于存储器里面,当波形显示时,单片机从存
[单片机]
一款简易示波器的设计方案
51单片机外部中断的总结
51单片机的外部中断有两种触发方式可选:电平触发和边沿触发。选择电平触发时,单片机在每个机器周期检查中断源口线,检测到低电平,即置位中断请求标志,向CPU请求中断。选择边沿触发方式时,单片机在上一个机器周期检测到中断源口线为高电平,下一个机器周期检测到低电平,即置位中断标志,请求中断。 这个原理很好理解。但应用时需要特别注意的几点: 1) 电平触发方式时,中断标志寄存器不锁存中断请求信号。也就是说,单片机把每个机器周期的S5P2采样到的外部中断源口线的电平逻辑直接赋值到中断标志寄存器。标志寄存器对于请求信号来说是透明的。这样当中断请求被阻塞而没有得到及时响应时,将被丢失。换句话说,要使电平触发的中断被CPU响应并执行,必须保证
[单片机]
51单片机的启动代码究竟里面写了什么
在我们使用kei c51创建一个51单片机项目时,会有如下图所示的提示: keil创建新项目时,提示是否添加启动文件 一般情况下,需要选择“是”。当然,也可以选择不加。那么,这个启动文件的作用是什么?什么情况下需要加,什么情况下可以不加? 今天我们就来详细了解一下这个启动文件的内容,看明白这个内容后,我们就会有种恍然大悟的感觉:“哦,原来是这样啊!” 启动代码第一段 ▼以下是启动代码原文第一段: strongerHuang • 来源:老马识途单片机 • 作者:老马识途单片机 • 2021-09-22 10:15 • 1508次阅读 0 在我们使用kei c51创建一个51单片机项目时,会有如下图所示的提示: 图
[单片机]
<font color='red'>51单片机</font>的启动代码究竟里面写了什么
利用89C51单片机的P1口控制8个发光二极管LED编程
利用89C51的P1口控制8个发光二极管LED。相邻的4个LED为一组,使2组每隔0。5S 交替发亮一次,周尔复始。试编写程序。 解: ORG 0100H MOV A,#0FH ABC: MOV P1,A ACALL D05 SWAP A SJMP ABC D05:MOV R6,250 DY: MOV R7,250 DAY:NOP NOP DJNZ R6,DAY DJNZ R7,DAY RET END
[单片机]
51单片机I/O口模拟串行通信实现方法
目前普遍采用的MCS51 和PIC 系列单片机通常只有一个(或没有)UART异步串行通信接口,在应用系统中若需要多个串行接口(例如在多机通信系统中,主机既要和从机通信又要和终端通信)的情况下,通常的方法是扩展一片8251 或 8250 通用同步/异步接收发送芯片(USART),需额外占用单片机I/O 资源。本文介绍一种用单片机普通I/O 口实现串行通信的方法,可在单片机的最小应用系统中实现与两个以上串行接口设备的多机通信。 1.串行接口的基本通信方式 串行接口的有异步和同步两种基本通信方式。异步通信采用用异步传送格式,如图1 所示。数据发送和接收均将起始位和停止位作为开始和结束的标志。在异步通信中,起始位占用一位(
[单片机]
<font color='red'>51单片机</font>I/O口模拟串行通信实现方法
51单片机系列连载8—独立键盘与矩阵键盘
在前面我们讲的都是向单片机中向外输出数据,今天我们开始介绍一下如何向单片机里面输入数据,也就是键盘。 键盘有两种,独立式键盘与行列式矩阵键盘。 独立式键盘是指直接用一根I/O口线构成的单个按键电路,每个I/O口的按键不会影响另外一个,具体电路图如下: 接下来看一个程序,这个程序主要是按键二极管亮,同时按一下数码管显示一下,往下加,加到9,具体程序如下: #include #define uint unsigned int; #define uchar unsigned char; sbit d1=P1^2; sbit duan=P
[单片机]
基于51单片机的多点温度控制系统设计
随着生活水平的提高,人们对家居需求由面积需求变为舒适需求。地板采暖采用辐射方式供暖,符合人体生理需求曲线,如果控制系统选取得当,不仅可以提高房间舒适度,更可以使系统运行费用降低许多。如今一般是在典型位置安装一个温控装置,温控装置连接到壁挂炉,温控器根据室温和温度设定直接控制锅炉运行,各房间不同回路由工作人员凭经验手动调节分水器球阀,改变不同回路的流量,从而达到调节各房间的室温的效果。使用这种控制方法,即使是有经验的工作人员,也难以调节得十分准确,何况各家庭成员由于年龄不同,所需舒适温度不同,需要经常对室温进行调节。针对以上问题,利用SST89E564RC单片机及新型测温器件设计了多点温控采暖控制系统,根据室内各点温度设定实时控制
[单片机]
小广播
添点儿料...
无论热点新闻、行业分析、技术干货……
设计资源 培训 开发板 精华推荐

最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

换一换 更多 相关热搜器件
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved