This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

unable to find mistake in program....if u could help?

Below is the program for moving message on lcd.....ws not working on chip....if u can help me any modifications..it is for philips P89v51rd2fn
lcd is jhd162a

#include<reg51.h>
sfr lcd_data_pin=0x90; // port 1
sbit rs=P3^0; // Register select pin
sbit rw=P3^1; // Read write pin
sbit en=P3^2; // Enable pin

void delay(unsigned int msec) //delay function
{ int i,j;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}

void lcd_cmd(unsigned char comm) // function to send command to LCD
{ lcd_data_pin=comm;
en=1;
rs=0;
rw=0;
delay(25);
en=0;
} void lcd_data(unsigned char disp) // function to send data on LCD
{ lcd_data_pin=disp;
en=1;
rs=1;
rw=0;
delay(25);
en=0;
}

void lcd_puts(unsigned char *s) // function to send string to LCD
{ while(*s!='\0')
{ lcd_data(*s);
s++;
} }

void lcd_ini() //Function to initialize the LCD
{ lcd_cmd(0x38);
lcd_cmd(0x06);
lcd_cmd(0x80);
lcd_cmd(0x01);
lcd_cmd(0x0C);
} void main()
{ lcd_ini();
lcd_cmd(0x81);
lcd_puts("HELLO");
delay(25);
while(1)
{ lcd_cmd(0x1C); //Shift the entire display to right delay(50);
} }

Parents Reply Children
No data