带中文字库的液晶12864的C程序(MD12864C-1)!并口连接液晶!
#include<reg52.h>
#include <math.h>
void lcd_init(void);
void clr_lcd(void);
void send_com(unsigned char cmd);
void send_data(unsigned char dat);
void chek_busy(void);
void set_xy(unsigned char xpos,unsigned char ypos);
void print(unsigned char x,unsigned char y,char* str);
void printstr(unsigned char xpos,unsigned char ypos,unsigned char str[],unsigned char k);
unsigned char code buf[4] ={0xbb,0xb6,0xd3,0xad};//欢迎
#define DATA P2
#define CONTROL P0
#define E 7 //并行的使能信号 sbit E = P0^7
#define RW 6 //并行的读写信号 sbit RW = P0^6
#define RS 5 //并行的指令数据选择信号 sbit RS = P0^5
#define PSB 4 //并/串行接口选择 sbit PSB = P0^4
#define RST 3 //复位 低电平有效 sbit RST = P0^3
#define SETB(x,y) (x|=(1<<y))
#define CLRB(x,y) (x&=(~(1<<y)))
#define CHKB(x,y) (x&(1<<y))
/********************测忙碌**********************/
//测忙碌子程序
//RS=0,RW=1,E=H,D0-D7=状态字
/************************************************/
void chek_busy(void)
{ unsigned char temp1;//状态信息(判断是否忙)
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载