//#include<stdio.h>
#include<reg51.h>
sbit rs=P3^6;
sbit en=P3^7;
void cmdwrt();
void delay();
void datawrt();
unsigned char dis[7]={0x30,0x38,0x01,0x06,0x0f,0x80};
unsigned char a;
main()
{
int i;
for( i=0;i<=7;i++)
{
a=dis;
cmdwrt();
delay();
}
TMOD=0x20;
SCON=0x50;
TH1=0xfa;
TR1=1;
while(1)
{
while(RI==0);
a=SBUF;
RI=0;
datawrt();
delay();
}
}
void cmdwrt()
{
rs=0;
P0=a;
en=1;
delay();
en=0;
}
void datawrt()
{
rs=1;
P0=a;
en=1;
delay();
en=0;
}
void delay()
{
int i;
for(i=0;i<1000;i++);
}
connect lcd pins as shown in the code and use rs232 cable and connect MC and serial port of comp. config hyperterminal as per settings done in the code and you get the output