//#include#include#define uchar unsigned char#define rs RC0#define rw RC1#define en RC2#define data PORTDconst uchar tab[]="Welcometo Earth!";void delay(uchar y){ uchar x; for(;y>0;y--) for(x=110;x>0;x--);}void check_busy(){ uchar temp; do { data=0xff; rs=0; rw=1; en=1; NOP(); temp=data; temp=temp>>7; en=0; }while(temp);}void write_com(uchar com){ check_busy(); rs=0; rw=0; en=1; data=com; delay(1); en=0;}void write_dat(uchar dat){ check_busy(); rs=1; rw=0; en=1; data=dat; delay(1); en=0;}void lcd_init(){ write_com(0x38); delay(1); write_com(0x0f); delay(1); write_com(0x06); delay(1); write_com(0x01); delay(1); write_com(0x80);}void main(){ uchar i; TRISC=0x00; TRISD=0x00; en=0; delay(15); lcd_init(); for(i=0;i<16;i++) { write_dat(tab[i]); delay(1); } while(1);}