您当前的位置:五五电子网电子知识单元电路显示电路-显示屏ACM-12864汉字液晶显示驱动程序 正文
ACM-12864汉字液晶显示驱动程序

ACM-12864汉字液晶显示驱动程序

点击数:7158 次   录入时间:03-04 12:00:35   整理:http://www.55dianzi.com   显示电路-显示屏

sbit p_csa=P2^6;
sbit p_csb=P2^7;
sbit p_gnda=P2^5;
sbit p_gndb=P2^4;
sbit p_di=P2^3;
sbit p_rw=P2^2;
sbit p_e=P2^1;


忙判别

void LCD_busy(void) {
 p_di=0;p_rw=1;P0=0xff;
 while (1) {
  p_e=1;
  if (P0<0x80) break;
  p_e=0;
 }
 p_e=0;
}
/*设置xy*/
void set_xy(unsigned char x,unsigned char y) {
 if (x>=64) {p_csa=0;p_csb=1;} else {p_csb=0;p_csa=1;}
 lcd_busy();
 p_di=p_rw=0;P0=0x40|x;p_e=1;p_e=0;
 lcd_busy();
 p_di=p_rw=0;P0=0xb8|y;p_e=1;p_e=0;
 P0=0xff;
}
void lw(unsigned char x,unsigned char y,unsigned char dd) {
 set_xy(x,y);
 lcd_busy();p_di=1;p_rw=0;P0=dd;p_e=1;p_e=0;
 P0=0xff;
}
/*显示初始化*/
#pragma dISAble
void lcd_init(void) {
 unsigned char x,y;
 p_gnda=p_gndb=0;
 /*开显示*/
 p_e=p_di=p_rw=0;
 p_csa=p_csb=0;
 p_csa=1;P0=0x3f;p_e=1;p_e=0;p_csa=0;
 p_csb=1;P0=0x3f;p_e=1;p_e=0;p_csb=0;
 /*0行开始显示*/
 p_csa=1;lcd_busy();p_di=p_rw=0;P0=0xc0;p_e=1;p_e=0;p_csa=0;
 p_csb=1;lcd_busy();p_di=p_rw=0;P0=0xc0;p_e=1;p_e=0;p_csb=0;
 for (y=0;y<8;y++) {
  for (x=0;x<128;x++) lw(x,y,0);
 }
}


unsigned char code asc[]={
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x38,0xfc,0xfc,0x38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xf,0xf,0x8,0x0,0x0,
0xe0,0xe0,0x60,0xc0,0x60,0xe0,0xc0,0x0,0xf,0xf,0x0,0x7,0x0,0xf,0xf,0x0,
0x20,0xe0,0xc0,0x20,0x20,0xe0,0xc0,0x0,0x0,0xf,0xf,0x0,0x0,0xf,0xf,0x0,
0xc0,0xe0,0x20,0x20,0x20,0xe0,0xc0,0x0,0x7,0xf,0x8,0x8,0x8,0xf,0x7,0x0,
0x20,0xe0,0xc0,0x20,0x20,0xe0,0xc0,0x0,0x40,0x7f,0x7f,0x48,0x8,0xf,0x7,0x0,
0xc0,0xe0,0x20,0x20,0xc0,0xe0,0x20,0x0,0x7,0xf,0x8,0x48,0x7f,0x7f,0x40,0x0,
0x20,0xe0,0xc0,0x60,0x20,0xe0,0xc0,0x0,0x8,0xf,0xf,0x8,0x0,0x0,0x0,0x0,
0x40,0xe0,0xa0,0x20,0x20,0x60,0x40,0x0,0x4,0xc,0x9,0x9,0xb,0xe,0x4,0x0,
0x20,0x20,0xf8,0xfc,0x20,0x20,0x0,0x0,0x0,0x0,0x7,0xf,0x8,0xc,0x4,0x0,
0xe0,0xe0,0x0,0x0,0xe0,0xe0,0x0,0x0,0x7,0xf,0x8,0x8,0x7,0xf,0x8,0x0,
0x0,0xe0,0xe0,0x0,0x0,0xe0,0xe0,0x0,0x0,0x3,0x7,0xc,0xc,0x7,0x3,0x0,
0xe0,0xe0,0x0,0x80,0x0,0xe0,0xe0,0x0,0x7,0xf,0xc,0x7,0xc,0xf,0x7,0x0,
0x20,0x60,0xc0,0x80,0xc0,0x60,0x20,0x0,0x8,0xc,0x7,0x3,0x7,0xc,0x8,0x0,

[1] [2]  下一页


本文关键字:程序  汉字  显示电路-显示屏单元电路 - 显示电路-显示屏

《ACM-12864汉字液晶显示驱动程序》相关文章>>>