#include <reg52.h>
#include <math.h>
void lcdcmd (unsigned char);
void lcddata (unsigned char);
void msdelay (unsigned int);
void LCD_sendstring(unsigned char * );
//////////////////////////////////////
sfr ldata =0x90;
sbit rs=P3^7;
sbit rw=P3^6;
sbit en=P3^5;
sbit g=P2^7;
/////////////////////////////
void main(void)
{
lcdcmd (0x3;
msdelay (100);
lcdcmd (0x0C);
msdelay (100);
LCD_sendstring("16x2 LCD");
msdelay(1000)
lcdcmd (0x01);
msdelay(5);
}
void lcdcmd (unsigned char value)
{
ldata=value;
rs=0;
rw=0;
en=1;
msdelay (10);
en=0;
}
void lcddata (unsigned char value)
{
ldata=value;
rs=1;
rw=0;
en=1;
msdelay (10);
en=0;
}
void msdelay (unsigned int itime)
{
unsigned int i,j;
for (i=0;i<itime;i++)
for (j=0;j<1275;j++);
}
void LCD_sendstring(unsigned char *value)
{
while(*value)
lcddata(*value++);
}
when compiling on keil i have got the following error messages..what will i do??
This error is because you copied the code to an asm file( i.e. *.a51). Make a new file with extension *.C then copy the code there. Then it would work perfectly.
to which pin of 8052 should i connect db0.db1........db7 pins of lcd
not to any port.......... it is port1...
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?