LCM字符液晶模块HC1624应用2接上一篇文章三、HC1624液晶模块与8051单片机典型电路 以上电路仅供参考四,HC1624液晶模块与8051单片机示例程序void busy(void){ P1=0xff; RS=0; RW=1; E=1; while((P1&0x80)==0x80); E=0;}
void writecom(unsigned char com){ RS=0; RW=0; P1=com; E=1; _nop_(); E=0;}
void lcdwc(unsigned char com){ busy(); writecom(com);}
void lcdwd(unsigned char dat){ busy(); RS=1; RW=0; P1=dat; E=1; _nop_(); E=0;} 初始化函数****************************************************/void lcdreset(){ delay(150); writecom(0x38); delay(50); writecom(0x38); delay(50); writecom(0x38); lcdwc(0x38); //8位数据 显示2行 5*7字符 lcdwc(0x08); //关显示 光标关 闪烁关 lcdwc(0x01); //** lcdwc(0x06); //光标右移 画面不动 lcdwc(0x0c); //开显示 光标关 闪烁关}