Sending the 0x03 nybble three times without delays between will not work. You must send it once, wait 5mS and then send it twice more, waiting 160uS after each time. That’s what the two extra strobe_e() were for.
I’ve tried the code as you sad before but without any success !
I’m sure that my wiring are right , and sure for 90% that the code is correct too … but this thing is realy driving me crasy !!!
please any other suggestion ???
I see you're not using the busy checking code. If you're not using the R/W line, then you should wire it to ground rather than connect it to P4.29. Connecting it to P4.29 is fine, but you have to be sure to keep it low at all times when writing to the LCD. Easier to just put a wire to ground and not have to worry about it.
I’ve tried the code as you sad before but without any success !
I’m sure that my wiring are right , and sure for 90% that the code is correct too … but this thing is realy driving me crasy !!!
please any other suggestion ???
I see you're not using the busy checking code. If you're not using the R/W line, then you should wire it to ground rather than connect it to P4.29. Connecting it to P4.29 is fine, but you have to be sure to keep it low at all times when writing to the LCD. Easier to just put a wire to ground and not have to worry about it.
I did man ! still not working !!! I’v tested all signals with LEDs and I can control those outputs … but when it comes to the LCD it just don’t want to work !!
I use Codesourcery for compiling the program and I run it on uClinux OS.
zanak:
I did man! Still not working!!! I’ve tested all signals with LEDs and I can control those outputs… but when it comes to the LCD it just don’t want to work !!
I use Codesourcery for compiling the program and I run it on uClinux OS.
I just changed my code over to fast GPIO like yours (not that you need the speed for a slow device like a LCD). Since I'd never looked at that before I thought maybe, possibly there might be something there. No change. Works just fine either way.
What board are you using? Anything else on the lines to your control pins that might be affecting it, like pullups/pulldowns etc?
What clock rate are you running your board at? My delays were written for 60MHz. If yours is clocked faster than that then you may have to adjust. Slower won’t hurt anything.
I don’t think I can be of much help without a LPC2468 to test with though.
zanak:
I did man! Still not working!!! I’ve tested all signals with LEDs and I can control those outputs… but when it comes to the LCD it just don’t want to work !!
I use Codesourcery for compiling the program and I run it on uClinux OS.
I just changed my code over to fast GPIO like yours (not that you need the speed for a slow device like a LCD). Since I'd never looked at that before I thought maybe, possibly there might be something there. No change. Works just fine either way.
What board are you using? Anything else on the lines to your control pins that might be affecting it, like pullups/pulldowns etc?
What clock rate are you running your board at? My delays were written for 60MHz. If yours is clocked faster than that then you may have to adjust. Slower won’t hurt anything.
I don’t think I can be of much help without a LPC2468 to test with though.
Maybe it’s my clock rate ! I’m running at 12 MHz speed … I have to change my PLL config to run at 60 MHz at least I think.
zanak:
Maybe it’s my clock rate ! I’m running at 12 MHz speed … I have to change my PLL config to run at 60 MHz at least I think.
I gonna try this and tell you if it works .
Going too slow won't hurt delay based LCD code a bit. It should work fine. Going too fast would be a problem. The delays would have to be adjusted to suit then.
So your 12MHz clock should work fine. As long as you aren’t clocked at higher than 60MHz it should be fine.
zanak:
Maybe it’s my clock rate ! I’m running at 12 MHz speed … I have to change my PLL config to run at 60 MHz at least I think.
I gonna try this and tell you if it works .
Going too slow won't hurt delay based LCD code a bit. It should work fine. Going too fast would be a problem. The delays would have to be adjusted to suit then.
So your 12MHz clock should work fine. As long as you aren’t clocked at higher than 60MHz it should be fine.
Hi futz ,
It’s not fine at all, it still not working … damn ! I really don’t know how to solve this problem.
zanak:
It’s not fine at all, it still not working … damn ! I really don’t know how to solve this problem.
First thing to try is another LCD just to confirm that there's no problem with that one.
Have you tried stepping through the LCD init function in the debugger? If there’s any problem with your delays, stepping through the init should make it work. If it works stepping but not running then you know your delays are too short.
maybe I should buy a logic analyzer
Shouldn't be necessary (though I love my [[Logic](http://www.saleae.com/logic/)). I got lots of LCDs working without one.](http://www.saleae.com/logic/)
I’m sure you’ve already checked these, but I’ll ask them anyway.
Have you set the contrast correctly. You should see two lines of black bars (1 and 3) - not too black - kind of halfway black. (Or white if it’s a reverse LCD (see below).)
If it’s a reverse LCD, is the backlight on? These LCDs make the characters out of non-displaying LCD blocks and shine the backlight through them like this:
Do you have enough power to run the LCD properly. This one bit me before. The power supply wasn’t good enough and though the LCD was displaying, I couldn’t see it. It was too faint.
zanak:
It’s not fine at all, it still not working … damn ! I really don’t know how to solve this problem.
First thing to try is another LCD just to confirm that there's no problem with that one.
Have you tried stepping through the LCD init function in the debugger? If there’s any problem with your delays, stepping through the init should make it work. If it works stepping but not running then you know your delays are too short.
maybe I should buy a logic analyzer
Shouldn't be necessary (though I love my [[Logic](http://www.saleae.com/logic/)). I got lots of LCDs working without one.[/quote]
it’s my second one, same problem. …
I tried to debug it with the IAR IDE, (in simulation mode) and i fugured out that when I try to clear the data pins P0.4:5:6:7 the values in the FIO0CLR registers remains the same ! so the output is corrupted with earlier operations.
Another thought: How are you powering your LCD? Does it have its own 5V supply? Or are you powering it with 3.3V, same as the ARM board?
The reason I ask is that if you’re powering it with 3.3V I read somewhere that you need to do the contrast with a negative voltage. One guy was doing it with an AAA cell. Here’s a quote:
To find out if my lcd worked at 3.3v all I did was use a single cell alkaline battery to do the offset for the contrast.Connect the positive of the battery to the ground and the negative to the contrast pot leg that would normally go to your ground.
zanak:
I tried to debug it with the IAR IDE, (in simulation mode) and i fugured out that when I try to clear the data pins P0.4:5:6:7 the values in the FIO0CLR registers remains the same ! so the output is corrupted with earlier operations.
Better check that out with some LEDs or a meter. Those bits MUST be cleared first if you're going to OR new bits into them.
futz:
I’m sure you’ve already checked these, but I’ll ask them anyway.
Have you set the contrast correctly. You should see two lines of black bars (1 and 3) - not too black - kind of halfway black. (Or white if it’s a reverse LCD (see below).)
If it’s a reverse LCD, is the backlight on? These LCDs make the characters out of non-displaying LCD blocks and shine the backlight through them like this:
Without a backlight they don’t look like much.
Do you have enough power to run the LCD properly. This one bit me before. The power supply wasn’t good enough and though the LCD was displaying, I couldn’t see it. It was too faint.
I don’t use a poto , my V00 is set to +5V (the highest contrast) but I don’t see any black lines !
it’s not a reverse LCD , but still, the backlight is on .
yeah I have enough power I guess , sine the backlight is really bright !
zanak:
I don’t use a pot , my V00 is set to +5V (the highest contrast) but I don’t see any black lines !
If your contrast is adjusted correctly you should see two rows of blocks like these (lines 1 & 3), but in black rather than white (I don't have a photo of the 20x4 doing blocks). You'll see them when the LCD is powered up, but not initialized.
If contrast is set incorrectly you won’t see anything at all. Get a 10K pot and wire that thing up properly so you can adjust contrast. If you don’t have a pot, try a 1K or 1.2K resistor to ground.
It’s very possible this is all your problem is. If you don’t see blocks when you power up the LCD without running your code, then contrast IS the problem.
zanak:
I don’t use a pot , my V00 is set to +5V (the highest contrast) but I don’t see any black lines !
I'm pretty sure that's backward. Max contrast is a wire direct to ground. You have your contrast set to minimum, meaning you'll never see ANYTHING on the screen, EVER.
Once more, you MUST see two rows of blocks when the LCD is powered up but not initialized. If you don’t see them then you have a contrast problem.
zanak:
I don’t use a pot , my V00 is set to +5V (the highest contrast) but I don’t see any black lines !
I'm pretty sure that's backward. Max contrast is a wire direct to ground. You have your contrast set to minimum, meaning you'll never see ANYTHING on the screen, EVER.
Once more, you MUST see two rows of blocks when the LCD is powered up but not initialized. If you don’t see them then you have a contrast problem.
you are right, now the V0 is grounded , and i can see two lines … but I can’t see the magic words “LPC2468 LCD it Works !”
zanak:
you are right, now the V0 is grounded , and i can see two lines … but I can’t see the magic words “LPC2468 LCD it Works !”
Well at least you're closer than you were before. :D
You see two lines of blocks? After initialization those should disappear and you should see a blinking underscore cursor (and some text of course). If the blocks don’t go away when you run the program then the problem is the init, or the lcd-nybble routines.
Now go and take out all the crazy, grasping-at-straws changes you made to the code while trying to make it work with bad contrast. Then it’ll probably work.
you are right, now the V0 is grounded , and i can see two lines … but I can’t see the magic words “LPC2468 LCD it Works !”
Too much contrast can be as bad as too little. Tune it down a bit with the resistor I mentioned, or get a pot in there.