M12864汉字液晶显示驱动程序

时间:2015-04-13 14:16:15
【文件属性】:

文件名称:M12864汉字液晶显示驱动程序

文件大小:9KB

文件格式:TXT

更新时间:2015-04-13 14:16:15

M12864汉字液晶显示驱动程序

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;


网友评论