PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Mein LCD spricht nicht mit mir!!



nietzsche
19.12.2008, 17:38
Moin,

Ich habe ein LCD, Standartcontrollerkompatibel...

Es ist folgendermasen angeschlossen (an einem AtMega8):

Pin 1 - GND
Pin 2 - +5V
Pin 3 - mit Poti an neg. Spannung (erw. Tempbereich)
Pin 4 - (RS) PC0
Pin 5 - (R/W) PC1 (wird dann auf GND geschalten)
Pin 6 - (En) PB2
Pin 7-10- GND
Pin 11 - PC5
Pin 12 - PC4
Pin 13 - PC3
Pin 14 - PC2

Als erstes kommt mit komisch vor: Wenn ich am Kontrast Poti dreh, wierd erstmal nur eine Zeile dunkel, und erst wenn ich weiter dreh, auch die zweite...

Ich habe folgenden Beispielcode zur Ansteuerung benutzt:



$regfile = "m8def.dat"
$crystal = 1000000



' Im I/O Mode wird jeder Prozessor Pin einzeln angegeben
Config Lcdpin = Pin , Db4 = Portc.5 , Db5 = Portc.4 , Db6 = Portc.3 , Db7 = Portc.2 , E = Portb.2 , Rs = Portc.0
Config Lcd = 16 * 2 'wir verwenden ein 2 x 16 Zeichen Display
Config Portc.1 = Output 'R/W to GND
Portc.1 = 0
Dim A As Byte

Do
Cls 'clear the LCD display
Lcd "Hello world." 'display this at the top line
Wait 1
Lowerline 'select the lower line
Wait 1
Lcd "Shift this." 'display this at the lower line
Wait 1
For A = 1 To 10
Shiftlcd Right 'shift the text to the right
Wait 1 'wait a moment
Next

For A = 1 To 10
Shiftlcd Left 'shift the text to the left
Wait 1 'wait a moment
Next

Locate 2 , 1 'set cursor position
Lcd "*" 'display this
Wait 1 'wait a moment

Shiftcursor Right 'shift the cursor
Lcd "@" 'display this
Wait 1 'wait a moment

Home Upper 'select line 1 and return home
Lcd "Replaced." 'replace the text
Wait 1 'wait a moment

Cursor Off Noblink 'hide cursor
Wait 1 'wait a moment
Cursor On Blink 'show cursor
Wait 1 'wait a moment
Display Off 'turn display off
Wait 1 'wait a moment
Display On
Loop

End


Und es passier absolut nichts... Habe ich irgendwo einen Fehler??

QM33
19.12.2008, 18:27
Für mal vor deiner Schleife ein

INITLCD
Wait 1

ein. Manche LCDs benötigen das INITLCD. Ob die Pause nötig ist, weiß ich nicht.
Wenn nur eine LCS Zeile "dunkel" wird, ist das LCD nicht initialisiert.

nietzsche
19.12.2008, 19:27
Inzwischen funktioniert alles... Mein LCD spricht inzwischen mit mir ;)

QM33
19.12.2008, 19:31
und, woran lags?

nietzsche
19.12.2008, 21:23
Ich traue es mich kaum zu sagen... Ich hatte einen Lötfehler in der Schaltung... Hab mich irgendwie verzählt... Ist mir furchtbar peinlich... Trotz mehrmaliger Überprüfung habe ich den Fehler erst jetzt gefunden...