- Labornetzteil AliExpress         
Ergebnis 1 bis 5 von 5

Thema: Ich bringe mein 4*20 LCD nicht zum laufen

  1. #1
    Benutzer Stammmitglied
    Registriert seit
    18.07.2005
    Beiträge
    49

    Ich bringe mein 4*20 LCD nicht zum laufen

    Anzeige

    LiFePo4 Akku selber bauen - Video
    Hallo,

    ich bin neu hier im Forum.
    Seit ein paar Wochen bastle ich mit einem ATMega32 und Bascom.
    Ich habe noch nichts großartiges gemacht, z.B. ein Lauflicht mit einstellbarer Geschwindigkeit.
    Jetzt würde ich gerne mein 4-Zeilen LCD von Pollin ausprobieren (ist nicht mehr lieferbar).
    Leider tut sich nichts. Nach dem Einschalten ist in der ersten und dritten Zeile ein Balken zu sehen, also so, als wäre nur die Versorgungsspannung am LCD.

    Ich habe unter Options/Compiler/LCD folgendes eingestellt:

    LCD type 20 * 4
    Bus mode 4 bit (es sind nur DB4 bis DB7 verbunden, DB0 bis DB3 liegen an Masse)
    Data mode pin
    LCD-adress C000 (woher weiß ich, was ich da einstellen soll?)
    RS-adress 8000 (hier genauso, woher bekomme ich die Adresse?)
    Enable PORTC.3
    RS PORTC.2
    DB7 PORTC.7
    DB6 PORTC.6
    DB5 PORTC.5
    DB4 PORTC.4

    RW ist nicht verbunden

    Ich habe mit dem Oszi mal die einzelnen Pins gemessen und es rührt sich was, das Display reagiert aber nicht drauf.
    Im Simulator funzt das Programm.

    Hier ist das Datenblatt zum LCD:
    http://www.pollin.de/service/LCD/120132.zip

    Das ist mein Programm, es entspricht größtenteils dem LCD.BAS im Samples Verzeichnis, ich habe es nur etwas angepasst:

    Code:
    '--------------------------------------------------------------
    '                 (c) 1999-2000 MCS Electronics
    '--------------------------------------------------------------
    '  file: LCD.BAS
    '  demo: LCD, CLS, LOWERLINE, SHIFTLCD, SHIFTCURSOR, HOME
    '        CURSOR, DISPLAY
    '--------------------------------------------------------------
    $regfile = "m32def.dat"
    $crystal = 1000000
    
    '$sim
    'REMOVE the above command for the real program !!
    '$sim is used fr faster simulation
    
    
    'note : tested in PIN mode with 4-bit
    
    'Config Lcdpin = Pin , Db4 = Portb.1 , Db5 = Portb.2 , Db6 = Portb.3 , Db7 = Portb.4 , E = Portb.5 , Rs = Portb.6
    'Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7 , E = Portc.7 , Rs = Portc.6
    Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2
    'These settings are for the STK200 in PIN mode
    'Connect only DB4 to DB7 of the LCD to the LCD connector of the STK D4-D7
    'Connect the E-line of the LCD to A15 (PORTC.7) and NOT to the E line of the LCD connector
    'Connect the RS, V0, GND and =5V of the LCD to the STK LCD connector
    
    Rem with the config lcdpin statement you can override the compiler settings
    
    
    Dim A As Byte
    Config Lcd = 20 * 4                                         'configure lcd screen
    'other options are 16 * 4 and 20 * 4, 20 * 2 , 16 * 1a
    'When you dont include this option 16 * 2 is assumed
    '16 * 1a is intended for 16 character displays with split addresses over 2 lines
    
    '$LCD = address will turn LCD into 8-bit databus mode
    '       use this with uP with external RAM and/or ROM
    '       because it aint need the port pins !
    
    Do
    Cls                                                         'clear the LCD display
    Lcd "Hello world."                                          'display this at the top line
    Waitms 1000
    Lowerline                                                   'select the lower line
    waitms 1000
    Lcd "Shift this."                                           'display this at the lower line
    waitms 1000
    For A = 1 To 10
       Shiftlcd Right                                           'shift the text to the right
       waitms 1000                                                   'wait a moment
    Next
    
    For A = 1 To 10
       Shiftlcd Left                                            'shift the text to the left
       waitms 1000                                                   'wait a moment
    Next
    
    Locate 2 , 1                                                'set cursor position
    Lcd "*"                                                     'display this
    waitms 1000                                                      'wait a moment
    
    Shiftcursor Right                                           'shift the cursor
    Lcd "@"                                                     'display this
    waitms 1000                                                      'wait a moment
    
    Home Upper                                                  'select line 1 and return home
    Cls
    Lcd "Replaced."                                             'replace the text
    waitms 1000                                                      'wait a moment
    
    Cursor Off Noblink                                          'hide cursor
    waitms 1000                                                      'wait a moment
    Cursor On Blink                                             'show cursor
    waitms 1000                                                      'wait a moment
    Display Off                                                 'turn display off
    waitms 1000                                                      'wait a moment
    Display On                                                  'turn display on
    '-----------------NEW support for 4-line LCD------
    Thirdline
    Lcd "Line 3"
    Fourthline
    Lcd "Line 4"
    Home Third                                                  'goto home on line three
    Home Fourth
    Home F                                                      'first letteer also works
    Locate 4 , 1 : Lcd "Line 4"
    waitms 1000
    Loop
    'Now lets build a special character
    'the first number is the characternumber (0-7)
    'The other numbers are the rowvalues
    'Use the LCD tool to insert this line
    
    'Deflcdchar 1 , 225 , 227 , 226 , 226 , 226 , 242 , 234 , 228       ' replace ? with number (0-7)
    'Deflcdchar 0 , 240 , 224 , 224 , 255 , 254 , 252 , 248 , 240       ' replace ? with number (0-7)
    'Cls                                                         'select data RAM
    Rem it is important that a CLS is following the deflcdchar statements because it will set the controller back in datamode
    'Lcd Chr(0) ; Chr(1)                                         'print the special character
    
    '----------------- Now use an internal routine ------------
    '_temp1 = 1                                                  'value into ACC
    '!rCall _write_lcd                                           'put it on LCD
    End
    Schon mal Danke für die Antworten!

    MfG, Dane

  2. #2
    Benutzer Stammmitglied
    Registriert seit
    18.07.2005
    Beiträge
    49
    JTAG ist übrigens deaktiviert, sonst funktioniert der PortC ja nicht.

  3. #3
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    30.09.2004
    Ort
    In der Nähe von Esslingen am Neckar
    Beiträge
    706
    Hi Dane,
    leg mal R/W auf Masse also GND!
    Gruß Michi

  4. #4
    Benutzer Stammmitglied
    Registriert seit
    18.07.2005
    Beiträge
    49
    Danke für die schnelle Antwort!
    Das Display funzt!
    Manchmal sind es halt doch bloß Kleinigkeiten.

    greetz, Neo

  5. #5
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    30.09.2004
    Ort
    In der Nähe von Esslingen am Neckar
    Beiträge
    706
    Hi Dane,
    Bitte, ist schön wenn man anderen helfen kann!
    Gruß Michi

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

Labornetzteil AliExpress