LCD's vary like the wind, but for the majority, you should insert a small delay time at power-up to allow the LCD to stabilize.
PAUSE 1000 ' in the beginning normally does the trick
Depending on your contrast settings, during this delay period, you'll probably see black squares. That's normal until you initialize the LCD.
You may also want to experiment with command & data delay times by adding the following to your LCD define section.
DEFINE LCD_COMMANDUS 2000 ' Command delay time in uS
DEFINE LCD_DATAUS 50 ' Data delay time in uS
Just tinker with the delay periods until you get the best results with whatever LCD you're using.
As for the hangs, I notice you have all PortA pins set to inputs. Do you have all of these inputs conected to something?
Floating inputs may be causing problems as well.
Bookmarks