View previous topic :: View next topic |
Author |
Message |
Amin
Joined: 19 Feb 2004 Posts: 15
|
LCD Issues wit6h 16F877 |
Posted: Mon Mar 21, 2005 9:10 am |
|
|
Hey all
I made a PCB and among other things it is meant to use 4x20 LCD.
It's all connected to port D, as mentioned in the driver header.
It was showing signs of life for a while until it stopped be rational at all.
Now the signal lines( all 7) are not active any more. I could get them to be active with setting the TRIS before hand manually!
and also the moment I plug the LCD in it stops, my heart beat LED doesn't work anymore.
I tried the LCD and 4x20 LCD driver?!
is there a known issue with the driver?! _________________ McMaster Solar Car Project
http://www.solarcar.mcmaster.ca |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Mar 21, 2005 10:09 am |
|
|
So it was working. Well if you didn't change the code, then it is probably not the code. Probably hardware related. There is no problem with the driver to answer your question. |
|
|
Guest
|
|
Posted: Mon Mar 21, 2005 11:30 am |
|
|
it was never fully working,
it was just showing some random characters. It might have been due tg some wiring issues, but now it doesn't do anything.
Does it somehow check for the presence of the LCD before it tries to contact it? I guess not, but without the LCD plugged there is no signal on the LCD lines!!! |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Mar 21, 2005 11:55 am |
|
|
Try this code out:
Code: |
#include <16F876.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <lcd.c>
void main() {
lcd_init();
lcd_putc("\fReady...\n");
while (TRUE) {
}
}
|
Note that you will need to subsitute you clock value if you are not at 20MHz. |
|
|
jbmiller Guest
|
lcd not working |
Posted: Mon Mar 21, 2005 2:48 pm |
|
|
Sounds like a hardware problem. Perhaps the pinout/header for the LCD was reversed(odds vs even pins). If you need local support, I'm over in Dundas and have a PS+ and several F877s lying around.
Jay
[email protected] |
|
|
Guest
|
|
Posted: Fri Mar 25, 2005 12:16 am |
|
|
This ended up being a software issue
I used the lcd420 driver, and I changed the header from LCD =6 to LCD= 8 to change from PORTB to PORTD which my hardware was setup to use.
However down in the code SET_TRIS_B was used three times, which meant the whenever it was reading a byte for INIT or whatever it waited forever.
I am still not sure why the hell it didn't get stuck when the LCD was unplugged and I really dislike the fact that the LCD driver has the potential to bring the software to halt in case of a hardware failure. I am not sure but I think one could get away without ever waiting indefinitely for a condition with these LCDs.
One day I'll grow up be an adult, then I'll sit down and write a driver for LCD and post it here. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Mar 25, 2005 7:41 am |
|
|
Anonymous wrote: | This ended up being a software issue
I used the lcd420 driver, and I changed the header from LCD =6 to LCD= 8 to change from PORTB to PORTD which my hardware was setup to use.
However down in the code SET_TRIS_B was used three times, which meant the whenever it was reading a byte for INIT or whatever it waited forever.
I am still not sure why the hell it didn't get stuck when the LCD was unplugged and I really dislike the fact that the LCD driver has the potential to bring the software to halt in case of a hardware failure. I am not sure but I think one could get away without ever waiting indefinitely for a condition with these LCDs.
One day I'll grow up be an adult, then I'll sit down and write a driver for LCD and post it here. |
Well they give you the code. If you want to add a timeout then feel free to do so. If they would have used a timer or something, someone else would have complained about that! Can't please all the people all the time is how the saying goes. |
|
|
|