#include<reg51.h>
#define RS P2^0
#define RW P2^1
#define EN P2^2
sfr ldata=0x90;
void lcdcmd(unsigned char value);
void lcddata(unsigned char value);
void MSDelay(unsigned int itime);
void main()
{
lcdcmd(0x38);
MSDelay(250);
lcdcmd(0x0E);
MSDelay(250);
lcdcmd(0x01);
MSDelay(250);
lcdcmd(0x06);
MSDelay(250);
lcdcmd(0x86);
MSDelay(250);
lcddata('M');
MSDelay(25);
lcddata('D');
MSDelay(25);
lcddata('E');
while(1);
}
void lcdcmd(unsigned char value)
{
ldata=value;
RS=0;
RW=0;
EN=1;
MSDelay(1);
EN=0;
}
void lcddata(unsigned char value)
{
ldata=value;
RS=1;
RW=0;
EN=1;
MSDelay(1);
EN=0;
}
void MSDelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}