HD44780 LCD operation

I'm not sure if this is an appropriate newsgroup to ask the question. I'm having problems with my LCD (both in real life and simulator) on a PIC18F system not showing anything, after ensuring that the hardware is connected properly. I'm beginning to suspect that either my sequence of operations on the LCD during the initialization before writing anything isn't done properly, or the timing of the command functions that I have called (those functions are built-in with mikroC development suite) aren't proper for my LCD (even though their library functions are said to be for HD44780 compatible LCDs). It would fantastic if someone replies on the basic sequence of operations that I should be instructing the LCD in order for it to work. I have basically initialized in the program where the data port, RS, Enable, and R/W pins are connected, turn on the LCD module, clear the display, turn the cursor display/blinking off, and return the cursor to top left corner. Thanks!

Reply to
ssylee
Loading thread data ...

On Thu, 6 Dec 2007 22:42:06 -0800 (PST), I said, "Pick a card, any card" and ssylee instead replied:

Silly question but have you got the order of the I/O pins the same as the program specifies? The library may have been written for a different wiring scheme. Just double check to be sure. It may save you lots of time.

-- Ray

Reply to
Ray Haddad

ssylee wrote in news:e2b8f174-19dc-4b64-a2d8- snipped-for-privacy@e23g2000prf.googlegroups.com:

Did you check sites like

formatting link
? Worked fine for me.

Sam

Reply to
SamSvL

Have you set the lcd contrast voltage?

--

John Devereux
Reply to
John Devereux

try googling for Mike Pearce and LCD

Reply to
Anon

Are you trying to operate it in 8-bit or 4-bit mode and does the wiring correspond to that? The part always starts in 8-bit mode and must be set into 4-bit mode.

--
John B
Reply to
John B

Thanks for all the replies. I'll answer your questions one by one:

Ray Haddad: I have ensured that the pins that the program uses match the hardware connections. SamSvL: Thanks for the link. It provides a lot of conceptual instructions on its operation. John Devereux: I have tried to adjust the contrast voltage by connecting an adjustment potentiometer as instructed in the datasheet and adjusting the potentiometer. John B: I'm trying to operate it in 8-bit mode, and the wiring correspond to that. I'm not sure about the benefits of operating it in the 4-bit mode though.

Reply to
ssylee

when adjusting the contrast voltage, you will know it is correct if and when you see all the pixels go from 'light' to dark. If you cannot make the pixels go dark, the contrast is not correct. Without this step, you will never se anything. In my experience, the delays during set-up are the biggest stumbling block. Make them 10x longer than you think they should be.

Reply to
TT_Man

If you only supply power and the contrast voltage to the LCD module, you should see all the dots on in the top row. If you can't see this don't bother going any further with the setup, fix the contrast.

Reply to
david.industronics

And equally bad is to try to use the (ready/busy/status?) signal for its intended use before initialization is complete. You are forced to use time delays during initialization and make them generous. Otherwise, the display will never work.

I believe whoever mentioned the 4-bit vs. 8-bit thing had it backward. The displays power up in 4-bit mode and must be switched to 8-bit mode. [I'm doing this from memory and it's been a long time...]

Reply to
Everett M. Greene

Everett M. Greene wrote: [snip...snip...]

It comes up in 8-bit mode but the 4/8 command ignores the lower nibble. IIRC, the recommended initialization is to tell it 8-bit several times, with specific delays between each, and then command it to 4-bit.

As mentioned, they're picky about proper initialization and not all otherwise compatible displays have the same minimum delays during initialization.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

I've found out that I have gotten my pin connections all wrong. I am going to reconnect the hardware connections and try the codes again.

Reply to
ssylee

On Mon, 10 Dec 2007 21:38:54 -0800 (PST), I said, "Pick a card, any card" and ssylee instead replied:

I suspected as much. That's why I suggested that you check your wiring. The program control is very simple and a matter of following the step-by-step instructions in the proper sequence.

-- Ray

Reply to
Ray Haddad

Ray,

After fixing the wiring, I have seen the contrast. However, I'm not seeing the text that should appear on the LCD. So my code is also one of the culprit as well.

Stanley

Reply to
ssylee

On Mon, 10 Dec 2007 22:21:42 -0800 (PST), I said, "Pick a card, any card" and ssylee instead replied:

Stanley,

Just backtrack in your code and begin anew. You probably made many tiny errors which accumulate over time. Those errors are based on having the wiring incorrect. Without being able to see your hardware or your code, this is not only a guess but practical advice.

-- Ray

Reply to
Ray Haddad

Thanks for all your help. Just an update that I have gotten the 4-bit interface working.

Reply to
ssylee

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.