unable to find mistake in program....if u could help?
jd s
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
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);
} }
Read-Only
Author Erik Malund
Posted 26-Apr-2012 22:29 GMT
Toolset C51
RE: unable to find mistake in program....if u could help?
Erik Malund
if u could help
when you save characters by using 'u' instead of 'you' is save one
typing 'no' instead of 'yes'
BTW evidently you are unable to read the instructions over the
message entry field, did you not notice that the preview was
incomprehensible.
Erik
Read-Only
Author Neil Kurzman
Posted 28-Apr-2012 02:45 GMT
Toolset C51
RE: unable to find mistake in program....if u could help?
Neil Kurzman
You have the Hardware and can not find the error. You expect other
to just read it an find the Issue.
What does "ws not working on chip" Mean?
No Display? Check the contrast
Boxes in row 1? The Init timing is wrong.
Read-Only
Author Phil Zealand
Posted 30-Apr-2012 11:35 GMT
Toolset C51
RE: unable to find mistake in program....if u could help?
Phil Zealand
Without knowing the LCD controller comands, one could possibly
think that maybe it is working... just too fast for you to see (or
the slow LCD segments to have time to change state)
so looking at the last few lines:
- display hello,
- call delay routine for 25ms,
- then the final loop shifts the display to right as fast as possible
- read as very fast because the delay(50) is in the comments and not
in code.
so to analyse: display hello, then after 25mS, shift it very
rapidly off the screen. even if the LCD could display the 'HELLO' in
25mS (LCD's are pretty slow), your' eyes are not that fast.
As a seperate subject, it is bad form to create delays using
software loops - use a hardware timer. Software loop timers will one
day sooner or later come back to bite you in so many ways!
- Phil.
Read-Only
Author jd s
Posted 30-Apr-2012 12:42 GMT
Toolset C51
RE: unable to find mistake in program....if u could help?
jd s
owk..but is rest program right? i have a doubt regarding the
header file..can u tell me header file for phiilips p89v51rd2fn?
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.