Page 1 of 1

16 x 4 LCD lässt sich nicht initialisieren

Posted: Thu Dec 06, 2012 11:08 am
by Merlin1303
Hi Leute,

ich nutze V5 für AVR und habe ein Problem ein 16x4 LCD mit HD44780 Kontroller zu initialisieren.
Das Display ist von Reichelt, ein LCD 164A BL .

Ich habe ein Projekt mit einem Atmega32 mit einem 16x4 LCD angelegt.
Die Simulation funktioniert super, aber in der Schaltung sind die Zeile 1 und 3 komplett ausgefüllt und die Zeilen 2 und 4 bleiben komplett leer.
In der originalen Schaltung verwende ich einen Atmega32 TQFP 44Pin bei 16 MHz.
Aber mit der 40 Pin DIP Variante auf einem Steckbrett mit einem 2. Display funktionierts genauso (nicht) - die gleichen Sympthome.
Laut google ist das Display wohl nicht korrekt initialisiert.

Wie kann ich das ändern?
Habe leider nur begrenzt Ahnung vom programmieren :-( (deshalb nutze ich ja Flowcode).

Meine Vermutung ist, dass der Abschnitt in der FC5_AVC_LCDDisplay.c falsch ist.
Da steht

...
void Start()
{
/*Macro_Start_Start*/

FC_CAL_Bit_Low_DDR(%a_PORT0, %a_TRIS0, %a_BIT0);
FC_CAL_Bit_Low_DDR(%a_PORT1, %a_TRIS1, %a_BIT1);
FC_CAL_Bit_Low_DDR(%a_PORT2, %a_TRIS2, %a_BIT2);
FC_CAL_Bit_Low_DDR(%a_PORT3, %a_TRIS3, %a_BIT3);
FC_CAL_Bit_Low_DDR(%a_PORT4, %a_TRIS4, %a_RS);
FC_CAL_Bit_Low_DDR(%a_PORT5, %a_TRIS5, %a_E);

Wdt_Delay_Ms(12);

RawSend(0x33, 0);
Wdt_Delay_Ms(2);
RawSend(0x33, 0);
Wdt_Delay_Ms(2);
RawSend(0x32, 0);
Wdt_Delay_Ms(2);
RawSend(0x2c, 0);
Wdt_Delay_Ms(2);
RawSend(0x06, 0);
Wdt_Delay_Ms(2);
RawSend(0x0c, 0);
Wdt_Delay_Ms(2);

//clear the display
RawSend(0x01, 0);
Wdt_Delay_Ms(2);
RawSend(0x02, 0);
Wdt_Delay_Ms(2);

/*Macro_Start_End*/
}
...


Ich denke, dass die Werte nicht für mein Display passen.

Merlin1303

Re: 16 x 4 LCD lässt sich nicht initialisieren

Posted: Thu Dec 06, 2012 5:46 pm
by Benj
Hallo,

Bitte können Sie fügen Sie Ihren Flowcode-Programm, so dass wir sehen können, was Ihr tut. Auch haben Sie testeten die Hardware läuft mit einem 1 Sekunden flasher Ansatz?



Hello,

Please can you attach your Flowcode program so we can see what your doing. Also have you tested the hardware is running using a 1 second flasher approach?

Re: 16 x 4 LCD lässt sich nicht initialisieren

Posted: Fri Dec 07, 2012 10:56 am
by Merlin1303
Danke für die Antwort,

im Anhang ist mein Projekt und die Datenblätter von 2 LCDs.
Das 16x4 initialisiert sich nicht - das 16x2 funktioniert ganz normal.
Ich lasse beim Start das Backlight im 1 Hz Takt blinken um zu kontrollieren, ob der Takt stimmt - er stimmt !
Ich habe auch schon den externen Quarz und den internen Oszillator ausprobiert, aber es verhält sich immer gleich.

Auch ein Testaufbau mit einem identischem 16x4 LCD auf einem Steckbrett verhält sich gleich.

Wenn ich statt dessen ein 16x2 LCD verwende funktioniert alles ganz normal.

Thank you for the promt reply,

in the attachment you can find my project file and the two datasheets of the LCDs I'm using.
The 16x4 does not initialize properly, but a 16x2 does.
At the beginning of the program the backlight flashes at 1 Hz to check the timimg - it flashes at 1 Hz!
I also changed over from the external crystal to the internal oscillator, but it always behaves the same.

Also a test with an identical 16x4 LCD on a breadboard behaves the same ( see the attached pics ).

When I use a 16x2 LCD it works fine.

Can anybody help me please? :cry:

Re: 16 x 4 LCD lässt sich nicht initialisieren

Posted: Sun Jan 13, 2013 7:11 pm
by Merlin1303
Gott bin ich dämlich - Asche auf mein Haupt.
Es hat jetzt fast 6 Wochen gedauert, bis ich bemerkt habe, dass ich die Pins für Register Select "RS" und Enable "E" in der Software vertauscht habe.
Flowcode ist unschuldig - ich gehe mich jetzt schämen :oops: