#include
#define uchar unsigned char
#define uint unsigned int
uchar code tab[]="V";
sbit rs=P0^5;
sbit rw=P0^6;
sbit e=P0^7;
//#define LCD_DAT_PORT P1
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
////////////////////////////////////////////////
void delay50us(uint ms) //1ms误差 0us
{
uint j;
for(;ms>0;ms--)
for(j=19;j>0;j--);
}
////////////////////////////////////////////////
void write_com(uchar com)
{
e=0;
rw=0;
rs=0;
P1=com; //0.00039700
e=1; //0.01380700
//delay50us(10); //500us
delay(1);
e=0;
}
void write_date(uchar date)
{
e=0;
rs=1;
rw=0;
P1=date;
e=1;/////
//delay50us(10); //500us
delay(1);
e=0;
}
void inti()
{
//delay50us(300);
//write_com(0x38);
//delay50us(100);
//write_com(0x38);
//delay(100);
//write_com(0x38);
write_com(0x38);
//write_com(0x08);
//write_com(0x01);
write_com(0x0f);
write_com(0x06);
//write_com(0x0c);
}
void main()
{
inti();
write_com(0xc0);
write_date(tab[0]);
while(1);
}