Alan69
Member level 5
OK lol figured you'd get to here, and it not working.. Here's a simple pseudocode example for how to get it working, it can take forever if you're trying to 'fix' an already built complex routine. Of course set up the DDR and use the commands for this.
Just keep copying the block, and do everything manually, with a wait between every flipping of a bit. Then you can make a decently long wait, and be sure there is plenty of time between any lines changing. May be leaving something out since just from memory, go by the data for clearing display, get to first character, and send a character. Key is delays, enough delay between setting lines and enable, set the bits with separate instructions, and a good separate enable then wait then off, and then to do everything manually until you start getting a response from the LCD. Doing it this way is just less troublesome to get an unknown display up and working the first time, especially when you don't have already known correct working code to start from.. (It works for whoever had the site, but that doesn't mean it'll work on any random other LCD from different timings.)
Also note you really need to divide for the contrast line, some displays you really just won't see anything unless contrast is in a mid 0-5v range..
Power on
wait
Data out (reset/clear of course the first command)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
Data out (usually home or similar)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
Data out (just a character)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
loop goto loop
Cut paste the send section like 30 times once you get to the characters, that way if something else is messed up with where it starts it'll wrap around. Won't hurt to send a ton until you get it working, and something will show on screen then figure out problems later..
Just keep copying the block, and do everything manually, with a wait between every flipping of a bit. Then you can make a decently long wait, and be sure there is plenty of time between any lines changing. May be leaving something out since just from memory, go by the data for clearing display, get to first character, and send a character. Key is delays, enough delay between setting lines and enable, set the bits with separate instructions, and a good separate enable then wait then off, and then to do everything manually until you start getting a response from the LCD. Doing it this way is just less troublesome to get an unknown display up and working the first time, especially when you don't have already known correct working code to start from.. (It works for whoever had the site, but that doesn't mean it'll work on any random other LCD from different timings.)
Also note you really need to divide for the contrast line, some displays you really just won't see anything unless contrast is in a mid 0-5v range..
Power on
wait
Data out (reset/clear of course the first command)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
Data out (usually home or similar)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
Data out (just a character)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait
loop goto loop
Cut paste the send section like 30 times once you get to the characters, that way if something else is messed up with where it starts it'll wrap around. Won't hurt to send a ton until you get it working, and something will show on screen then figure out problems later..