- Labornetzteil AliExpress         
Seite 1 von 2 12 LetzteLetzte
Ergebnis 1 bis 10 von 15

Thema: Anschluss eines Displays am atmega

  1. #1

    Anschluss eines Displays am atmega

    Anzeige

    LiFePo4 Akku selber bauen - Video
    Hallo Leute ich hab hier ein Display von Pollin LCD-Modul TG12864B-03
    Datenblatt: http://www.pollin.de/shop/downloads/D120424D.PDF

    Dies wollte ich mit dem Beispielcode aus dem Bascom Studio ansteuern
    Code:
    '-----------------------------------------------------------------------------------------
    'name                     : ks108.bas
    'copyright                : (c) 1995-2005, MCS Electronics
    'purpose                  : demonstrates the KS108 based graphical display support
    'micro                    : Mega323
    'suited for demo          : no
    'commercial addon needed  : no
    '-----------------------------------------------------------------------------------------
    
    $regfile = "m323def.dat"                                    ' specify the used micro
    $crystal = 8000000                                          ' used crystal frequency
    $baud = 60000                                               ' use baud rate
    $hwstack = 32                                               ' default use 32 for the hardware stack
    $swstack = 10                                               ' default use 10 for the SW stack
    $framesize = 40                                             ' default use 40 for the frame space
    
    
    'some routines to control the display are in the glcdKS108.lib file
    $lib "glcdKS108.lbX"
    
    
    Wait 2
    
    Print "Config"                                              ' printing will still work as only the receiver pin is disabled
    
    
    'First we define that we use a graphic LCD
    Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 4 , Rd = 3 , Reset = 2 , Enable = 5
    
    'The dataport is the portname that is connected to the data lines of the LCD
    'The controlport is the portname which pins are used to control the lcd
    'CE =CS1  Chip select
    'CE2=CS2  Chip select second chip
    'CD=Data/instruction
    'RD=Read
    'RESET = reset
    'ENABLE= Chip Enable
    
    
    
    'Dim variables (y not used)
    Dim X As Byte , Y As Byte
    
    
    
    Print "Cls"
    Cls
    
    Wait 1
    
    'specify the font we want to use
    Setfont Font8x8
    
    
    'You can use locate but the columns have a range from 1-128
    'When you want to show somthing on the LCD, use the LDAT command
    'LCDAT Y , COL, value
    Lcdat 1 , 1 , "123"
    
    'lcdat accepts an additional param for inversing the text
    Lcdat 2 , 1 , "123" , 1                                     ' will inverse the text
    
    'Now use a different font
    'Setfont Font8x8
    'since the 16*16 font uses 2 rows, show on row 3
    'Lcdat 1 , 1 , "2345"
    'Lcdat 2 , 56 , "2345656"
    Wait 1
    Line(0 , 0) -(127 , 64) , 1                                 'make line
    Wait 2
    Line(0 , 0) -(127 , 64) , 0                                 'remove line
    
    For Y = 1 To 20
       Circle(30 , 30) , Y , 1
       Waitms 100
    Next
    
    Wait 1
    Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2                         ' both displays off
    Wait 1
    Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2                         'both on
    'GLCDCMD accepts an additional param to select the chip
    'With multiple, GLCDCMD statements, it is best to specify the chip only the first time
    
    
    Showpic 0 , 0 , Plaatje                                     'show a comnpressed picture
    End                                                         'end program
    
    
    'we need to include the font files
    'Notice that this is a testfont with only numbers defined !
    '$include "smallfont8x8.font"
    $include "font8x8.font"
    '$include "font16x16.font"
    
    
    Plaatje:
    'include the picture data
    $bgf "ks108.bgf"
    Nun meine FRage, wie muss ich das Display anschließen?

    Mit Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 4 , Rd = 3 , Reset = 2 , Enable = 5

    Komm ich nicht so richtig zurecht mit. Wo wird welcher Pin angeschlossen und brauch das Display nun 9V und/oder 5V und an welchen Pin. Hab das Diagramm nicht richtig verstanden und mit der Suche bin ich auch noch nicht zum Ziel gekommen.

    Ich hab wie es in der Demo steht einen Atmega 32

    Bitte helft mir.

  2. #2
    Erfahrener Benutzer Robotik Einstein
    Registriert seit
    22.05.2005
    Ort
    12°29´ O, 48°38´ N
    Beiträge
    2.731
    Moin,

    Suche anwerfen, und zB. das hier finden:
    https://www.roboternetz.de/phpBB2/ze...light=tg12864b

  3. #3
    Da kommt gleich die nächste Frage auf.
    Wo bitte ist Pin 0 und was ist RET ?
    Code:
    'KS0108 TG12864B
    ' Pin - LCD      - Bascom
    ' 0   - CS1      - Ce
    ' 1   - nc
    ' 2   - D/I (A0) - Cd
    ' 3   - CS2      - Ce2
    ' 4   - Enable   - Enable
    ' 5   - R/W      - Rd
    ' 6   - RET      - Reset
    E wird enable sein
    und welche Leitungen sind Dataports und welche Controlport?

    Und bekommt das Display nun auf Vss 9V oder 5V?

  4. #4
    Erfahrener Benutzer Robotik Einstein Avatar von Dirk
    Registriert seit
    30.04.2004
    Ort
    NRW
    Beiträge
    3.803
    Hallo daywalker008,

    also, ich kenne das Display nicht. Vorschlag zum Anschluß:
    VSS -> GND (Minuspol, Pin 1)
    VDD -> +5V
    V0 -> Abgriff eines Potis zur Helligkeitsregelung (Datenblatt!)
    D/I -> Cd
    R/W -> Rd
    E -> Enable
    DB0..DB7 -> Datenport
    CS1 -> Ce
    CS2 -> Ce2
    /RST -> Reset
    VEE -> Poti zur Helligkeitsregelung (s.o. V0)
    K -> Kathode der Hintergrundbeleuchtungs-LED (-)
    A -> Anode der Hintergrundbeleuchtungs-LED (+)

    Achtung: Hintergrundbeleuchtung nur über Vorwiderstand anschließen!

    Gruß Dirk

  5. #5
    also bis hier hin bin ich gekommen:
    Code:
    'KS0108 TG12864B
    ' Pin LCD - Pin Atmega
    ' 1  Vss          9V oder 5V
    ' 2  VDD          5V?
    ' 3  V0           GND
    ' 4  D/I
    ' 5  R/W          Port C0
    ' 6  E            Enable also 5V?
    ' 7  DB0          Port A0
    ' 8  DB1          Port A1
    ' 9  DB2          Port A2
    '10  DB3          Port A3
    '11  DB4          Port A4
    '12  DB5          Port A5
    '13  DB6          Port A6
    '14  DB7          Port A7
    '15  CS1
    '16  CS2
    '17  RST          Reset?
    '18  VEE          Kontrast?
    '19  K            LED - also GND
    '20  A            LED + also 5V
    Abgeschaut von hier : https://www.roboternetz.de/wissen/in...D-Modul_am_AVR

    Aber es gibt noch ein paar Lücken , wo ich nicht weiß wie ich die verbleibenden Pins anschließen soll.

  6. #6
    irgendwie steht im DB das Vss an GNd kommt?

  7. #7
    Dirk war schneller

  8. #8
    hm Also hab das Display jetzt so angeschlossen wie Dirk es gesagt hat, jetzt seh ich auch die Pixel im Display und die Beleuchtung funktioniert, es wird aber nichts gemacht, also es sollten ja eigentlich Linien gemacht werden und ein Bild gezeichnet aber das Display bleibt leer.
    Ist da was am Code falsch?

    Liegt es vielleicht an der Libfile "glcdKS108.lbX", da ich ja ne LBX draus gemacht hab, da ich keine lib habe

  9. #9
    also bei Pollin steht, dass das Display 9V Kontrastspannung hat muss ich da nun an VDD 9V anlegen ???
    Ich will das Display nicht kaputt machen.
    Bis jetzt seh ich nur einen blauen Rand mit weißen Pixeln.

  10. #10
    In nem anderen Thrad steht das das Display die 9V selbst erzeugt.
    hm, vielleicht ist ja der Fehler am Poti???
    Ist folgendermaßen angeschlossen: am linken Anschluss V0 am mittelanschluss VEE und noch ein 8,5 K Widerstand da ich nur ein 5K Poti habe
    Stimmt das so?

Seite 1 von 2 12 LetzteLetzte

Berechtigungen

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

Solar Speicher und Akkus Tests