Searching \ for '[PIC] Interfacing PIC16F873A with a LCD display AC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/lcd/pic.htm?key=lcd
Search entire site for: 'Interfacing PIC16F873A with a LCD display AC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Interfacing PIC16F873A with a LCD display AC'
2008\11\15@080928 by Ivan Petrushev

picon face
Hello,
For over a week I have been trying to interface that pic mcu with that
display - Ampire 204 (4 lines x 20 characters). It has KS0066U
controller.
All hardware wiring is correct (I have seen data signals flying over
the lines with an oscilloscope).
RB0-RB7 is data line, RC1 is RS, RC2 is RW and RC5 is E.
I'm doing the initialization routine according to the datasheet
(sending command words, delays according to the time diagrams), but
'it doesn't work'. What happens when I turn on my board:
- lcd backlight is lightened brightly green (btw, is 180 mA current
normal for that backlight?)
- the backlight flickers for a moment (changes its lightness from 100%
to 90%) - note: when I power up the display with no source loaded, it
does not flicker in that manner - is that a part of the initializing
procedure?
- nothing is displayed - not even a black squares - should I see black
squares/lines if the display is correctly initialized? What if I had
not send "clear screen" command?
First I thought that contrast is low - there is a 10K pot for contrast
adjustment. I have tweaked that pot a bit, but nothing did appeared.

I've read a lot about these displays and it seems that they run from
the first try.

Should I see black squares at some time? Is there another debug tool
to see what is happening inside the display?

Regards,
Ivan

2008\11\15@082526 by Picbits Sales

flavicon
face
Try slowing down all the timings significantly ( by a factor of two)

Seems to be  a common issue getting LCD to work properly.

{Original Message removed}

2008\11\15@083647 by Jan-Erik Soderholm

face picon face
Hi.

Ivan Petrushev wrote:
> Hello,
> For over a week I have been trying to interface that pic mcu with that
> display - Ampire 204 (4 lines x 20 characters). It has KS0066U
> controller.
> All hardware wiring is correct (I have seen data signals flying over
> the lines with an oscilloscope).
> RB0-RB7 is data line, RC1 is RS, RC2 is RW and RC5 is E.

Normaly you do not have any need for the RW line.
Just tie it to GND and save a I/O pin...

> I'm doing the initialization routine according to the datasheet
> (sending command words, delays according to the time diagrams), but
> 'it doesn't work'.

Note that the delays in the datasheets are minimum delays.
Try to use much longer delays.

 What happens when I turn on my board:
> - lcd backlight is lightened brightly green (btw, is 180 mA current
> normal for that backlight?)

Yes, probably.

> - the backlight flickers for a moment (changes its lightness from 100%
> to 90%)

Thats weird...

 - note: when I power up the display with no source loaded, it
> does not flicker in that manner - is that a part of the initializing
> procedure?

The backlight has nothing at all to do with the main LCD controller.
The controller doesn't even know if there is an backlight or not !
The backlight has it's own connections which are logicaly separeted
from all connections to the controller (apart from the power supply,
maybe).

> - nothing is displayed - not even a black squares - should I see black
> squares/lines if the display is correctly initialized?

When the controller has gone throught it's power-on selftests,
and if the contrast is correctly adjusted, one can normaly
see some lines with inverted (grey) blocks and some blank
lines. That is, even without any PIC connected...

> What if I had
> not send "clear screen" command?
> First I thought that contrast is low - there is a 10K pot for contrast
> adjustment. I have tweaked that pot a bit, but nothing did appeared.

Is there any change to the display at all when turned
between 0V and 5V ?
>
> I've read a lot about these displays and it seems that they run from
> the first try.

Link to datasheet ?
>
> Should I see black squares at some time?

Yes, after the selftest and if the contrast is correctly
adjusted.

> Is there another debug tool
> to see what is happening inside the display?

No, not realy...

Jan-Erik.
>
> Regards,
> Ivan

2008\11\15@130136 by M. Adam Davis

face picon face
You don't tell us which PIC you're using.

1. Make sure the pins are set correctly, not only for input or output,
but A/D or other peripherals are turned off for those pins.
2. Make sure your delay routines are correct - attach an LED and have
it  blink once a second.  You might be executing instructions too
quickly.
3. Make sure you're using the R/W pin correctly.  For this test,
consider tying it to ground until you are writing to the display
correctly.
4. Make sure you're using the RS pin correctly.  For initialization it
needs to be low (ground).
5. Make sure you're using enable correctly.  Set up the data, bring it
high, wait for at least one instruction cycle (insert a NOP) then
bring it low.  If you don't put a slight pause in there, the LCD may
not register that enable was pulsed at all.
6. The init sequence in the data sheet should work, but if not try
another HD44780 compatible initializtion sequence.  Mine is here:
http://www.ubasics.com/adam/electronics/lcd/ (note that mine is for 4
bits, and uses a different pinout)
7. As others have said, make sure that you've allowed a great deal of
time in between each initialization step (see my example above for
timings I use - they're longer than what the data sheet calls for, but
I've had trouble with following the datasheet exactly)
8. Verify that the pic is running and isn't in a reset state, and that
the watchdog isn't reseting it.
9. Make sure the power supply is adequate - with 180mA for the
backlight (which may be right, but seems a bit high - what does the
data sheet say?) you might not have 5V if your power supply is wimpy.

Good luck!

-Adam

On Sat, Nov 15, 2008 at 8:09 AM, Ivan Petrushev <spam_OUTivanatoraTakeThisOuTspamgmail.com> wrote:
{Quote hidden}

> -

2008\11\15@131313 by Isaac Marino Bavaresco

flavicon
face
Jan-Erik Soderholm escreveu:
> Hi.
>
> Ivan Petrushev wrote:
>  
>> Hello,
>>    
>> Should I see black squares at some time?
>>    
>
> Yes, after the selftest and if the contrast is correctly
> adjusted.
>  

Perhaps this model needs NEGATIVE voltage for the contrast?
Lots of time since I have seen any that needs negative contrast voltage,
but you may have just stomped onto one.


Regards,

Isaac
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2008\11\15@163614 by Jinx

face picon face
> Try slowing down all the timings significantly ( by a factor of two)

And particularly add a power-up delay. Even up to 100ms before
you try to initialise the display. HD44780 is usually OK with 20ms
but I've seen others that require much longer

2008\11\15@182436 by Jinx

face picon face
> - the backlight flickers for a moment (changes its lightness from
> 100% to 90%) - note: when I power up the display with no source
> loaded, it does not flicker in that manner - is that a part of the
> initializing procedure?

You'd expect the LEDs to be quite separate from the logic. IOW you
can turn them on and off (to save power for example) without this having
any effect at all on the display itself. If your LEDs are flickering, perhaps
this suggests a momentary PSU problem. If so, and the LEDs are causing
a glitch that's affecting logic initialisation, try powering up wihout them

You know the old saying ? Make it work, then make it pretty

> - nothing is displayed - not even a black squares - should I see black
> squares/lines if the display is correctly initialized?

The Ampire 16x2 I use have black squares on the top line with just
power applied. An incorrect initialisation will often make those squares
disappear

I notice in the pdf

http://www.ampire.com.tw/Spec-AC/AC-204A.pdf

that initialisation timing and sequence for the AC204A is not the same
as the HD44780, unlike the Ampire 16x2

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...