Projects › Projects › 4bit lcd program for 2148…..i am getting perfectly output in kiel but in proteus nothing is displaying on lcd..can you tell me
- This topic has 6 replies, 2 voices, and was last updated 11 years, 4 months ago by ANJUSHA.
-
AuthorPosts
-
June 9, 2013 at 6:06 am #2472ANJUSHAParticipant
#include <LPC21xx.H>
void delay(int count ) ;
void lcddata(int c);
void lcdcmd(int t);void delay(int count)
{
int j=0, i=0;
for (j=0;j<count;j++)
for (i=0;i<250;i++);
}void lcdcmd(int t)
{
int s=0;
s=(t>>4) & 0x0f;
s=s << 16;
IO1CLR=0x10000000; // rs =1 p1.28
IO1CLR=0x20000000; // rw =0 p1.29
IO1SET=0x40000000;IO1CLR=0X000F0000;
IO1SET = s;
delay(1000);
IO1CLR=0x40000000; //en=0 p1.30
s = t & 0x0f;
s=s<<16;IO1CLR=0x10000000; // rs =1 p1.28
IO1CLR=0x20000000; // rw =0 p1.29
IO1SET=0x40000000;IO1CLR=0X000F0000;
IO1SET = s;
delay(1000);
IO1CLR=0x40000000; //en=0 p1.30
}void lcddata(int c)
{
int d=0;
d=((c>>4) & 0x0f);
d= d<<16;
IO1SET=0x10000000; // rs =1 p1.28
IO1CLR=0x20000000; // rw =0 p1.29
IO1SET=0x40000000;IO1CLR=0X000F0000;
IO1SET = d;
delay(1000);
IO1CLR=0x40000000; //en=0 p1.30
d= c & 0x0f;
d=d<<16;IO1SET=0x10000000; // rs =1 p1.28
IO1CLR=0x20000000; // rw =0 p1.29
IO1SET=0x40000000;IO1CLR=0X000F0000;
IO1SET = d;
delay(1000);
IO1CLR=0x40000000; //en=0 p1.30
}void msgdisplay(unsigned char k[])
{
int i;
for(i=0; k!=’