Reset problem with LCD display

May 14, 2005 10 Replies

Hey



I've got this weird problem with a HD44780 compatible display. It's a



40x4 display from Batron. The displays is based on 2 HD44780 controllers.

When I power up the uC and display I get the 2 black bars on the display. I then reset the display and it works fine. BUT I got problems, when I download a new code in the uC and resets it afterwards. Now the display writes a's instead of my text. The problem is on both HD44780 controllers, so i figured that the controllers shares the problem. The display works fine, if a reset the uC a few times?!??



I tried with an older 40x2 HD44780 compatible display, but same result.



The uC is a Philips LPC 2124. I've tried changing the delays in my code, I had to use 1 us delay to get a satisfying length on the Enable signal.



The contrast voltage is supplied thru a var. resistor, so the Vcontrast is contemporart with the Vcc. Is this a problem?



I'm confused.... ANY SUGGESTIONS???



Regards



Jesper Kristensen Denmark


it

problem

Enable

Have you tried to power cycle the controllers after the microprocessor reset?

Clearly the problem is with your code and not the controller. These chips have a reset sequence that you must follow to get reliable operation. Another thing to watchout for is writing too fast, these are very slow chips by todays standards, you must also check the busy flag before writing data.

Are you using the 4 bit interface? If you are initialising the display twice will get the upper/lower nibbles out of line between sender and reciever. Two solutions, make use of the read/status instructions to establish whether the display is correctly responding, if not issue the init commands to go into 4 bit mode and then try again.

Richard

twice

whether

There is a EPE magazine article online re using these modules. IIRC the article they recommend initialising 2 or three times in succession for reliable start up. Have a look at the Everyday Popular Electronics website for the 2 part article "How to use intelligent LCDs" rob

It is a long time since I used these beasts, but as I recall the problem revolves around the fact that the busy signal is not valid after the reset. You have to impose a delay of something like 40 millisecs after reset before trusting anything.

Some informative links: news:news.announce.newusers http://www.geocities.com/nnqweb/ http://www.catb.org/~esr/faqs/smart-questions.html http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html

Hey

This could solve my problem..

How can I run a power cycle on the controllers. The datasheet describes a power cycle on Vdd > 4.5 Volt. But I cant find a "manual" power cycle??!??!

Jesper

Hey

Thanks for all your replies. I've tried to add delays and do the initialize the LCD multible times. But none if it helped.

Please notice that the error is on both controllers.

Jesper Denmark

If you float (or bring low) the pins connected to the display, then interrupt the power (eg. by using a port pin and a PNP transistor or p-channel MOSFET to control the display Vdd) for a suitable lenth of time (maybe a couple hundred msec), then you can start up as from a power-on.

The micro is probably putting the display into some undesirable state as a side effect of the downloading process and you do not have a power off/on cycle to reset it. Those parts do not have a reset pin.

You may also be able to recover by repeating the power-on sequence, but it sounds like you've tried it. It might be worth double checking that you have the sequence exactly right by the book.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

In article , Jesper writes

Check that the enable pin is the correct sense (active high)

I once made a unit which drove the display with active low enable and it worked very bizarrely, sometimes OK, sometimes not.

Tim Mitchell

That means the problem is in your code and/or hardware. My guess - CODE. Or maybe the logic level incompatibility between LPC2xxx and 5V LCD? How do you handle the level translation? Do you read the statur from LCD?

Yes. Forget and delete all the sample code you got from any source and write your own init routine, strictly following the HD44780 data sheet. It always works for me!

If you use 4 bit interface, remember to read two nibbles while querying the busy flag! (discard the second nibble but toggle Enable for it).

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required