EmbeddedRelated.com
Forums

HD44780 LCD operation

Started by ssylee December 7, 2007
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!
On Thu, 6 Dec 2007 22:42:06 -0800 (PST), I said, "Pick a card, any
card" and ssylee <stanigator@gmail.com> instead replied:

>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!
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
ssylee <stanigator@gmail.com> wrote in news:e2b8f174-19dc-4b64-a2d8-
0498417a9d3a@e23g2000prf.googlegroups.com:

> 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! >
Did you check sites like http://www.myke.com/lcd.htm ? Worked fine for me. Sam
ssylee <stanigator@gmail.com> writes:

> 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!
Have you set the lcd contrast voltage? -- John Devereux
On Thu, 6 Dec 2007 22:42:06 -0800 (PST), ssylee <stanigator@gmail.com>
wrote:

>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!
try googling for Mike Pearce and LCD
On 07/12/2007 ssylee wrote:

> 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!
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
On Dec 7, 9:08 am, "John B" <spamj_baraclo...@blockerzetnet.co.uk>
wrote:
> On 07/12/2007 ssylee wrote: > > 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! > > 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
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.
>> >> 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 > > 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.
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.
On Dec 8, 4:15 pm, ssylee <staniga...@gmail.com> wrote:
> On Dec 7, 9:08 am, "John B" <spamj_baraclo...@blockerzetnet.co.uk> > wrote: > > > > > On 07/12/2007 ssylee wrote: > > > 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! > > > 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 > > 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.
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.
"TT_Man" <Someone@ntlworld.com> writes:

> >> 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. > > > > 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.
> 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.
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...]