Microcontroller › 8051 › CHECK OUT MY C PROGRAM ON LCD AS THERE IS LITTLE MISTAKE › //rearrange the program like
//rearrange the program like this..
//interfacing using c
#include <reg51.h>
sfr ldata= 0x90;
sbit rs=P2^0;
sbit rw=P2^1;
sbit en=P2^2;
void MSDelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
void lcdcmd(unsigned char value)
{
ldata=value;
rs=0;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void lcddata(unsigned char value)
{
ldata = value;
rs=1;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void main()
{
lcdcmd(0x38);
MSDelay(250);
lcdcmd(0x0E);
MSDelay(250);
lcdcmd(0x01);
MSDelay(250);
lcdcmd(0x06);
MSDelay(250);
lcdcmd(0x86);
MSDelay(250);
lcddata('m');
}