PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Grafik Display mit Bascom



xcool
29.08.2006, 17:24
Moin,

ich habe mir ein wenig übereilt das Grafik Display EA DIP122-5 von der Fa. Electronic Assembley gekauft und ich weiß jetzt nicht wie ich das Grafik Display mit Bascom ansteuern kann.

Laut Datenblatt hat das Display keinen Zeichensatz??

Kann mir jemand sagen wie ich die Zeichen aufs Display bekommen, bzw. wie ich das Teil ansteuere mit einem Mega32 ????

Siehe Datenblatt anbei!

Gruß
xcool

digitali
29.08.2006, 20:47
Also laut EA hat das Modul den SED1520 drauf. Und wenn Du in der Hilfe von Bascom mal nach "SED1520" suchst, dann wirste auch fuendig. Incl. Beispiellisting. Also ich denke das sollte dann kein Problem sein!?

Mit freundlichen Gruessen
Digitali

xcool
04.09.2006, 19:44
Also laut EA hat das Modul den SED1520 drauf. Und wenn Du in der Hilfe von Bascom mal nach "SED1520" suchst, dann wirste auch fuendig. Incl. Beispiellisting. Also ich denke das sollte dann kein Problem sein!?

Mit freundlichen Gruessen
Digitali


Mhmm, habe dort nachgeschaut, ich komme da jedoch nicht ganz mit klar??


Aber wie sieht es mit der Verdrahtung aus??

In der Bascom Anleitung-Demo steht .....


Config Graphlcd = 240 * 128 , Dataport = Porta , Controlport = Portc , Ce = 2 , Cd = 3 , Wr = 0 , Rd = 1 , Reset = 4 , Fs = 5 , Mode = 8

warum Porta und Portc und wie ist da die genaue Zuordnung der Pins (MC zum LCD)

Hats Du einen Schaltplan wo ich die Verdrahtung mit der Pin Zuordnung genau sehen kann??

Gruß
xcool

d.andres
06.09.2006, 07:56
Die Wahl der Ports für den Dataport und den Controlport steht dir grundsätzlich frei, muß nicht PA und PD sein.

Also wenn Du diese config-Zeile nimmst sollte die Verdrahtung so aussehen:

Config Graphlcd = 120 * 64sed , Dataport = Porta , Controlport = Portd , Ce = 5 , Ce2 = 7 , Cd = 3 , Rd = 4

AVRPin LCDPin
PA0 -- 7 (D0)
PA1 -- 8 (D1)
PA2 -- 9 (D2)
PA3 -- 10 (D3)
PA4 -- 11 (D4)
PA5 -- 12 (D5)
PA6 -- 13 (D6)
PA7 -- 14 (D7)

PD3 -- 4 (A0)
PD4 -- 5 (R/W)
PD5 -- 6 (E1)
PD7 -- 15 (E2)

Bei dem Beispielprogramm in der BASCOM Hilfe ist auch das ausgeben von Zeichen schön beschrieben. Die Hilfe geht ausdrücklich auf das nichtvorhandensein von Fonts im LCD ein, und wie man die Softfonts in Bascom einbindet.

Viel Erfolg

Jimmy

Vitis
06.09.2006, 12:23
Doof bei der Geschichte ist, das man immer ganze Ports haben muß für die Konfiguration in Bascom. Möcht man TWI, nen AD-Port, INT0 und evtl. OC2 in einem Projekt mit dem GLCD verwenden wirds schon eng in der Geschichte. Gibts da schon n Workaound in Bascom? ICh hab mir da für ne Anwendung meine eigenen (wenn auch lang nicht perfekte) Ansteuerung, die pinweise läuft zusammengestrickt, aber die ist halt nicht gerade schnell und halt auch nicht so umfangreich.

xcool
06.09.2006, 18:10
Die Wahl der Ports für den Dataport und den Controlport steht dir grundsätzlich frei, muß nicht PA und PD sein.

Also wenn Du diese config-Zeile nimmst sollte die Verdrahtung so aussehen:

Config Graphlcd = 120 * 64sed , Dataport = Porta , Controlport = Portd , Ce = 5 , Ce2 = 7 , Cd = 3 , Rd = 4

AVRPin LCDPin
PA0 -- 7 (D0)
PA1 -- 8 (D1)
PA2 -- 9 (D2)
PA3 -- 10 (D3)
PA4 -- 11 (D4)
PA5 -- 12 (D5)
PA6 -- 13 (D6)
PA7 -- 14 (D7)

PD3 -- 4 (A0)
PD4 -- 5 (R/W)
PD5 -- 6 (E1)
PD7 -- 15 (E2)

Bei dem Beispielprogramm in der BASCOM Hilfe ist auch das ausgeben von Zeichen schön beschrieben. Die Hilfe geht ausdrücklich auf das nichtvorhandensein von Fonts im LCD ein, und wie man die Softfonts in Bascom einbindet.

Viel Erfolg

Jimmy

----------------------------------------------------------------------------------
Moin Jimmy,

erstmal vielen Dank für Deine Antwort!!

Aber ich habe da doch noch eine (mehrere??) Frage(n)?

Muss ich da nicht auch noch den Reset anschließen?? Ich komme mit Deiner Zuordung der ConfigLCD nicht ganz zurecht!

In der Bascom Anleitung habe ich folgendes gefunden!!

Config GRAPHLCD = type , DATAPORT = port, CONTROLPORT=port , CE = pin , CD = pin , WR = pin, RD=pin, RESET= pin, FS=pin, MODE = mode

In der Bascom Hilfe steht ......

The following connections were used for the T6963C:


PORTA.0 to PORTA.7 to DB0-DB7 of the LCD

PORTC.5 to FS, font select of LCD

PORTC.2 to CE, chip enable of LCD

PORTC.3 to CD, code/data select of LCD

PORTC.0 to WR of LCD, write

PORTC.1 to RD of LCD, read

PORTC.4 to RESET of LCD, reset LCD

Nur wo finde ich die Zuordnung für den SED????

Wenn ich in der Spezifikation vom LCD-Grafik-Modul EADip122*32 schaue da ist der Reset =Pin 16!

Warum ist das bei Deiner Zuordnung nicht so??

Warum eigentlich CE und CE2 ???

gruß
xcool

xcool
06.09.2006, 18:14
Doof bei der Geschichte ist, das man immer ganze Ports haben muß für die Konfiguration in Bascom. Möcht man TWI, nen AD-Port, INT0 und evtl. OC2 in einem Projekt mit dem GLCD verwenden wirds schon eng in der Geschichte. Gibts da schon n Workaound in Bascom? ICh hab mir da für ne Anwendung meine eigenen (wenn auch lang nicht perfekte) Ansteuerung, die pinweise läuft zusammengestrickt, aber die ist halt nicht gerade schnell und halt auch nicht so umfangreich.

Moin,

zeig doch mal wie Deine Lösung aussieht!!

gruß
xcool

d.andres
06.09.2006, 18:31
Bei SED basierten LCD gibt es keinen FS (Font Select) Pin. Geh mal auf die Hilfe, dann "suchen" und SED eingeben. Da steht alles drin. Es gibt eine spezielle Lib für SED Displays der Reset Pin ist im Config Statement der Beispielprogramme nicht angeschlossen. Ich denke den kannst Du fest mit +5V verbinden. CE1 und CE2 sind getrennte Chip Enable Pins. Jeweils ein Pin pro SED Chip. Schau mal in die Anleitung des Displays, da steht was von "linke Hälfte" und "rechte Hälfte".

Vitis
08.09.2006, 07:58
Also hier wie gefordert mein Code für das 64128, den ich zu testzwecken zusammengepfriemelt hab. Es ging bei dem Projekt um ein einfaches "Digitaloszi" mit dem ATMega mit internem ADC und GLCD. Hat also dementsprechend nur den Zweck Linien auf dem Display zu zeichnen. Der Vorteil meiner Ansteuerung war halt, das man beliebige Pins für die Ansteuerung nutzen kann, dafür ists halt etwas langsamer als die Bascominterne Routine.



'----------------------------------------------------------
' Programm initialisieren
'----------------------------------------------------------
'$dbg
'
' ACHTUNG JTAG per Fuse abschalten !!!!
'

$regfile = "m16def.dat"
$crystal = 8000000

$baud = 19200

Declare Sub Glcd_wdata(byval Outbyte As Byte)
Declare Function Glcd_rdata(byval Outbyte As Byte)as Byte
Declare Sub Glcd_busycheck
Declare Sub Glcd_pixpos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byval Modus As Byte)
Declare Sub Glcd_framepos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byval Framedata As Byte)
Declare Sub Glcd_line(byval Sx As Byte , Byval Sy As Byte , Byval Ex As Byte , Byval Ey As Byte)


Glcd_db0 Alias Portd.7
Glcd_pindb0 Alias Pind.7
Glcd_db1 Alias Portd.6
Glcd_pindb1 Alias Pind.6
Glcd_db2 Alias Porta.2
Glcd_pindb2 Alias Pina.2
Glcd_db3 Alias Porta.3
Glcd_pindb3 Alias Pina.3
Glcd_db4 Alias Porta.4
Glcd_pindb4 Alias Pina.4
Glcd_db5 Alias Porta.5
Glcd_pindb5 Alias Pina.5
Glcd_db6 Alias Porta.6
Glcd_pindb6 Alias Pina.6
Glcd_db7 Alias Porta.7
Glcd_pindb7 Alias Pina.7
Glcd_cs0 Alias Portb.0
Glcd_cs1 Alias Portb.1
Glcd_e Alias Portb.2
Glcd_rs Alias Portb.4
Glcd_res Alias Portb.3
Glcd_rw Alias Portd.3

Config Glcd_db0 = Output
Config Glcd_db1 = Output
Config Glcd_db2 = Output
Config Glcd_db3 = Output
Config Glcd_db4 = Output
Config Glcd_db5 = Output
Config Glcd_db6 = Output
Config Glcd_db7 = Output
Config Glcd_cs0 = Output
Config Glcd_cs1 = Output
Config Glcd_e = Output
Config Glcd_rs = Output
Config Glcd_res = Output
Config Glcd_rw = Output

Config Porta.0 = Input
Config Adc = Single , Prescaler = 64 , Reference = Off
Start Adc


Dim A As Byte
Dim B As Word

Dim Senstemp(120) As Word
Dim Tempword As Word ' variablen deklarieren
Dim I As Byte
Dim X As Byte
Dim Tmpsingle As Single
Dim Temp As Word
Dim Tempint As Integer
Dim Tempstr As String * 16
Dim Sx As Byte , Sy As Byte , Ex As Byte , Ey As Byte , Xsingle As Single , Ysingle As Single
Dim Framedata As Byte
Dim Pixpos_x As Byte
Dim Pixpos_y As Byte
Dim Tmp As Byte
Dim Outbyte As Byte
Dim Modus As Byte
Dim Y_alt As Byte
Dim X_alt As Byte
Dim Y_neu As Byte
Dim X_neu As Byte
Dim Y_alt2 As Byte
Dim X_alt2 As Byte
Dim Y_neu2 As Byte
Dim X_neu2 As Byte
Dim Pwm1ab As Word
X_alt = 1
Y_alt = 1
X_neu = 1
Y_neu = 1

Config Pinc.2 = Output
Config Pinc.3 = Input
Config Portc.5 = Output
Config Portc.6 = Output
Config Portc.7 = Output

Enable Interrupts

Gosub Glcd_init
Gosub Glcd_cls

Call Glcd_line(1 , 1 , 126 , 62)
Call Glcd_line(1 , 62 , 126 , 1 )
Call Glcd_line(20 , 20 , 106 , 42)
Call Glcd_line(20 , 42 , 106 , 20)
Wait 1
Gosub Glcd_cls

Do

Loop
End

' --------------------------------------------------------------------

Sub Glcd_pixpos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Modus As Byte)
Local Templocal As Integer
If Pixpos_y < 62 Then
If Pixpos_x < 126 Then
Glcd_rs = 1
Glcd_rw = 0
If Modus = 1 Then
Tmp = Pixpos_y
Shift Tmp , Right , 3 ' pixel im Frame setzen
Shift Tmp , Left , 3
Pixpos_y = Pixpos_y - Tmp
Tmp = 0
Tmp.pixpos_y = 1
Tmp = Framedata Or Tmp
Call Glcd_wdata(tmp) ' pixel schreiben
Else
Call Glcd_wdata(0) ' frame löschen
End If
Glcd_rs = 0
End If
End If
End Sub

'------------------------------------------------------------------

Sub Glcd_framepos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byref Framedata As Byte)
Local Tempbyte As Byte
If Pixpos_y < 62 Then
If Pixpos_x < 126 Then
Glcd_cs0 = 0
Glcd_cs1 = 0
Glcd_rs = 0
Glcd_rw = 0
If Pixpos_x > 61 Then ' chip auswählen
Glcd_cs1 = 1
Pixpos_x = Pixpos_x And &B00111111
Else
Glcd_cs0 = 1
Pixpos_x = Pixpos_x And &B00111111
'Decr Pixpos_x
'Decr Pixpos_x
'Decr Pixpos_x
End If

Tmp = Pixpos_x
Tmp = Tmp And &B00111111
Tmp = Tmp Or &B01000000
Call Glcd_wdata(tmp) ' x-Adresse setzen

Shift Pixpos_y , Right , 3
Tmp = Pixpos_y And &B00011111 '/ 8
Tmp = Tmp Or &B10111000 ' frame setzen für Abfrage
Call Glcd_wdata(tmp)
Glcd_rs = 1
Glcd_rw = 1
Framedata = Glcd_rdata(0) ' Frame auslesen
Glcd_rw = 0
Glcd_rs = 0
Call Glcd_wdata(tmp)
End If
End If
End Sub
End

' --------------------------------------------------------------------

Sub Glcd_wdata(byval Outbyte As Byte)

nop
nop
Glcd_e = 0
Glcd_db0 = Outbyte.0
Glcd_db1 = Outbyte.1
Glcd_db2 = Outbyte.2
Glcd_db3 = Outbyte.3
Glcd_db4 = Outbyte.4
Glcd_db5 = Outbyte.5
Glcd_db6 = Outbyte.6
Glcd_db7 = Outbyte.7
nop
Glcd_e = 1
nop
Glcd_e = 0
End Sub
End

' --------------------------------------------------------------------

Function Glcd_rdata(byval Outbyte As Byte)as Byte
Config Glcd_db0 = Input
Config Glcd_db1 = Input
Config Glcd_db2 = Input
Config Glcd_db3 = Input
Config Glcd_db4 = Input
Config Glcd_db5 = Input
Config Glcd_db6 = Input
Config Glcd_db7 = Input
Glcd_e = 0
nop
Glcd_e = 1
nop
Glcd_e = 0
nop
Glcd_e = 1
nop

Outbyte.0 = Glcd_pindb0
Outbyte.1 = Glcd_pindb1
Outbyte.2 = Glcd_pindb2
Outbyte.3 = Glcd_pindb3
Outbyte.4 = Glcd_pindb4
Outbyte.5 = Glcd_pindb5
Outbyte.6 = Glcd_pindb6
Outbyte.7 = Glcd_pindb7
Glcd_rdata = Outbyte
Framedata = Outbyte
nop
Config Glcd_db0 = Output
Config Glcd_db1 = Output
Config Glcd_db2 = Output
Config Glcd_db3 = Output
Config Glcd_db4 = Output
Config Glcd_db5 = Output
Config Glcd_db6 = Output
Config Glcd_db7 = Output
nop
Glcd_e = 0
nop
nop
End Function
End

' --------------------------------------------------------------------

Glcd_init:
Glcd_res = 1
Waitms 400
Glcd_res = 0
Waitms 400
Glcd_res = 1
Waitms 400
Glcd_rs = 0
Glcd_rw = 0
nop
nop
nop
Glcd_cs0 = 1 ' Instruktionen
Glcd_cs1 = 0
Call Glcd_wdata(&B00111111 )
nop
nop
nop
Call Glcd_wdata(&B11000000 )
nop
nop
nop
Call Glcd_wdata(&B10111000 )
nop
nop
nop
Call Glcd_wdata(&B01000000 )
Glcd_rs = 0
Glcd_rw = 0
nop
nop
nop
Glcd_cs0 = 0 ' Instruktionen
Glcd_cs1 = 1
Call Glcd_wdata(&B00111111)
nop
nop
nop
Call Glcd_wdata(&B11000000 )
nop
nop
nop
Call Glcd_wdata(&B10111000 )
nop
nop
nop
Call Glcd_wdata(&B01000000 )
Return
End

Glcd_cls:
Glcd_rs = 1
Glcd_rw = 0
X = 0
For A = 1 To 128 ' Bildschirm löschen
For I = 1 To 60 Step 8
Call Glcd_framepos(a , I , X)
Call Glcd_pixpos(a , I , X)
Next I
Next A
Return
End


Glcd_mirror:
Glcd_rs = 1
Glcd_rw = 0
For X = 1 To 63
For A = 1 To 128
Call Glcd_framepos(a , X , 1)
Call Glcd_pixpos(a , X , 1)
Next A
Next X
Return
End

Sub Glcd_line(byval Sx As Byte , Byval Sy As Byte , Byval Ex As Byte , Byval Ey As Byte)
Local Dx As Integer
Local Dy As Integer
Local Yb As Byte
Local Xb As Byte
Local Xcount As Byte
Xb = 0
Yb = 0
Dx = Sx - Ex
Dy = Sy - Ey
Ysingle = Dy / Dx
For Xcount = Ex To Sx Step -1
Yb = Ysingle * Xb
Yb = Yb + Sy
Call Glcd_framepos(xcount , Yb , 1)
Call Glcd_pixpos(xcount , Yb , 1)
Incr Xb
Yb = Ysingle * Xb
Yb = Yb + Sy
Call Glcd_framepos(xcount , Yb , 1)
Call Glcd_pixpos(xcount , Yb , 1)
Next A
End Sub

xcool
11.09.2006, 20:23
Also hier wie gefordert mein Code für das 64128, den ich zu testzwecken zusammengepfriemelt hab. Es ging bei dem Projekt um ein einfaches "Digitaloszi" mit dem ATMega mit internem ADC und GLCD. Hat also dementsprechend nur den Zweck Linien auf dem Display zu zeichnen. Der Vorteil meiner Ansteuerung war halt, das man beliebige Pins für die Ansteuerung nutzen kann, dafür ists halt etwas langsamer als die Bascominterne Routine.



'----------------------------------------------------------
' Programm initialisieren
'----------------------------------------------------------
'$dbg
'
' ACHTUNG JTAG per Fuse abschalten !!!!
'

$regfile = "m16def.dat"
$crystal = 8000000

$baud = 19200

Declare Sub Glcd_wdata(byval Outbyte As Byte)
Declare Function Glcd_rdata(byval Outbyte As Byte)as Byte
Declare Sub Glcd_busycheck
Declare Sub Glcd_pixpos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byval Modus As Byte)
Declare Sub Glcd_framepos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byval Framedata As Byte)
Declare Sub Glcd_line(byval Sx As Byte , Byval Sy As Byte , Byval Ex As Byte , Byval Ey As Byte)


Glcd_db0 Alias Portd.7
Glcd_pindb0 Alias Pind.7
Glcd_db1 Alias Portd.6
Glcd_pindb1 Alias Pind.6
Glcd_db2 Alias Porta.2
Glcd_pindb2 Alias Pina.2
Glcd_db3 Alias Porta.3
Glcd_pindb3 Alias Pina.3
Glcd_db4 Alias Porta.4
Glcd_pindb4 Alias Pina.4
Glcd_db5 Alias Porta.5
Glcd_pindb5 Alias Pina.5
Glcd_db6 Alias Porta.6
Glcd_pindb6 Alias Pina.6
Glcd_db7 Alias Porta.7
Glcd_pindb7 Alias Pina.7
Glcd_cs0 Alias Portb.0
Glcd_cs1 Alias Portb.1
Glcd_e Alias Portb.2
Glcd_rs Alias Portb.4
Glcd_res Alias Portb.3
Glcd_rw Alias Portd.3

Config Glcd_db0 = Output
Config Glcd_db1 = Output
Config Glcd_db2 = Output
Config Glcd_db3 = Output
Config Glcd_db4 = Output
Config Glcd_db5 = Output
Config Glcd_db6 = Output
Config Glcd_db7 = Output
Config Glcd_cs0 = Output
Config Glcd_cs1 = Output
Config Glcd_e = Output
Config Glcd_rs = Output
Config Glcd_res = Output
Config Glcd_rw = Output

Config Porta.0 = Input
Config Adc = Single , Prescaler = 64 , Reference = Off
Start Adc


Dim A As Byte
Dim B As Word

Dim Senstemp(120) As Word
Dim Tempword As Word ' variablen deklarieren
Dim I As Byte
Dim X As Byte
Dim Tmpsingle As Single
Dim Temp As Word
Dim Tempint As Integer
Dim Tempstr As String * 16
Dim Sx As Byte , Sy As Byte , Ex As Byte , Ey As Byte , Xsingle As Single , Ysingle As Single
Dim Framedata As Byte
Dim Pixpos_x As Byte
Dim Pixpos_y As Byte
Dim Tmp As Byte
Dim Outbyte As Byte
Dim Modus As Byte
Dim Y_alt As Byte
Dim X_alt As Byte
Dim Y_neu As Byte
Dim X_neu As Byte
Dim Y_alt2 As Byte
Dim X_alt2 As Byte
Dim Y_neu2 As Byte
Dim X_neu2 As Byte
Dim Pwm1ab As Word
X_alt = 1
Y_alt = 1
X_neu = 1
Y_neu = 1

Config Pinc.2 = Output
Config Pinc.3 = Input
Config Portc.5 = Output
Config Portc.6 = Output
Config Portc.7 = Output

Enable Interrupts

Gosub Glcd_init
Gosub Glcd_cls

Call Glcd_line(1 , 1 , 126 , 62)
Call Glcd_line(1 , 62 , 126 , 1 )
Call Glcd_line(20 , 20 , 106 , 42)
Call Glcd_line(20 , 42 , 106 , 20)
Wait 1
Gosub Glcd_cls

Do

Loop
End

' --------------------------------------------------------------------

Sub Glcd_pixpos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Modus As Byte)
Local Templocal As Integer
If Pixpos_y < 62 Then
If Pixpos_x < 126 Then
Glcd_rs = 1
Glcd_rw = 0
If Modus = 1 Then
Tmp = Pixpos_y
Shift Tmp , Right , 3 ' pixel im Frame setzen
Shift Tmp , Left , 3
Pixpos_y = Pixpos_y - Tmp
Tmp = 0
Tmp.pixpos_y = 1
Tmp = Framedata Or Tmp
Call Glcd_wdata(tmp) ' pixel schreiben
Else
Call Glcd_wdata(0) ' frame löschen
End If
Glcd_rs = 0
End If
End If
End Sub

'------------------------------------------------------------------

Sub Glcd_framepos(byval Pixpos_x As Byte , Byval Pixpos_y As Byte , Byref Framedata As Byte)
Local Tempbyte As Byte
If Pixpos_y < 62 Then
If Pixpos_x < 126 Then
Glcd_cs0 = 0
Glcd_cs1 = 0
Glcd_rs = 0
Glcd_rw = 0
If Pixpos_x > 61 Then ' chip auswählen
Glcd_cs1 = 1
Pixpos_x = Pixpos_x And &B00111111
Else
Glcd_cs0 = 1
Pixpos_x = Pixpos_x And &B00111111
'Decr Pixpos_x
'Decr Pixpos_x
'Decr Pixpos_x
End If

Tmp = Pixpos_x
Tmp = Tmp And &B00111111
Tmp = Tmp Or &B01000000
Call Glcd_wdata(tmp) ' x-Adresse setzen

Shift Pixpos_y , Right , 3
Tmp = Pixpos_y And &B00011111 '/ 8
Tmp = Tmp Or &B10111000 ' frame setzen für Abfrage
Call Glcd_wdata(tmp)
Glcd_rs = 1
Glcd_rw = 1
Framedata = Glcd_rdata(0) ' Frame auslesen
Glcd_rw = 0
Glcd_rs = 0
Call Glcd_wdata(tmp)
End If
End If
End Sub
End

' --------------------------------------------------------------------

Sub Glcd_wdata(byval Outbyte As Byte)

nop
nop
Glcd_e = 0
Glcd_db0 = Outbyte.0
Glcd_db1 = Outbyte.1
Glcd_db2 = Outbyte.2
Glcd_db3 = Outbyte.3
Glcd_db4 = Outbyte.4
Glcd_db5 = Outbyte.5
Glcd_db6 = Outbyte.6
Glcd_db7 = Outbyte.7
nop
Glcd_e = 1
nop
Glcd_e = 0
End Sub
End

' --------------------------------------------------------------------

Function Glcd_rdata(byval Outbyte As Byte)as Byte
Config Glcd_db0 = Input
Config Glcd_db1 = Input
Config Glcd_db2 = Input
Config Glcd_db3 = Input
Config Glcd_db4 = Input
Config Glcd_db5 = Input
Config Glcd_db6 = Input
Config Glcd_db7 = Input
Glcd_e = 0
nop
Glcd_e = 1
nop
Glcd_e = 0
nop
Glcd_e = 1
nop

Outbyte.0 = Glcd_pindb0
Outbyte.1 = Glcd_pindb1
Outbyte.2 = Glcd_pindb2
Outbyte.3 = Glcd_pindb3
Outbyte.4 = Glcd_pindb4
Outbyte.5 = Glcd_pindb5
Outbyte.6 = Glcd_pindb6
Outbyte.7 = Glcd_pindb7
Glcd_rdata = Outbyte
Framedata = Outbyte
nop
Config Glcd_db0 = Output
Config Glcd_db1 = Output
Config Glcd_db2 = Output
Config Glcd_db3 = Output
Config Glcd_db4 = Output
Config Glcd_db5 = Output
Config Glcd_db6 = Output
Config Glcd_db7 = Output
nop
Glcd_e = 0
nop
nop
End Function
End

' --------------------------------------------------------------------

Glcd_init:
Glcd_res = 1
Waitms 400
Glcd_res = 0
Waitms 400
Glcd_res = 1
Waitms 400
Glcd_rs = 0
Glcd_rw = 0
nop
nop
nop
Glcd_cs0 = 1 ' Instruktionen
Glcd_cs1 = 0
Call Glcd_wdata(&B00111111 )
nop
nop
nop
Call Glcd_wdata(&B11000000 )
nop
nop
nop
Call Glcd_wdata(&B10111000 )
nop
nop
nop
Call Glcd_wdata(&B01000000 )
Glcd_rs = 0
Glcd_rw = 0
nop
nop
nop
Glcd_cs0 = 0 ' Instruktionen
Glcd_cs1 = 1
Call Glcd_wdata(&B00111111)
nop
nop
nop
Call Glcd_wdata(&B11000000 )
nop
nop
nop
Call Glcd_wdata(&B10111000 )
nop
nop
nop
Call Glcd_wdata(&B01000000 )
Return
End

Glcd_cls:
Glcd_rs = 1
Glcd_rw = 0
X = 0
For A = 1 To 128 ' Bildschirm löschen
For I = 1 To 60 Step 8
Call Glcd_framepos(a , I , X)
Call Glcd_pixpos(a , I , X)
Next I
Next A
Return
End


Glcd_mirror:
Glcd_rs = 1
Glcd_rw = 0
For X = 1 To 63
For A = 1 To 128
Call Glcd_framepos(a , X , 1)
Call Glcd_pixpos(a , X , 1)
Next A
Next X
Return
End

Sub Glcd_line(byval Sx As Byte , Byval Sy As Byte , Byval Ex As Byte , Byval Ey As Byte)
Local Dx As Integer
Local Dy As Integer
Local Yb As Byte
Local Xb As Byte
Local Xcount As Byte
Xb = 0
Yb = 0
Dx = Sx - Ex
Dy = Sy - Ey
Ysingle = Dy / Dx
For Xcount = Ex To Sx Step -1
Yb = Ysingle * Xb
Yb = Yb + Sy
Call Glcd_framepos(xcount , Yb , 1)
Call Glcd_pixpos(xcount , Yb , 1)
Incr Xb
Yb = Ysingle * Xb
Yb = Yb + Sy
Call Glcd_framepos(xcount , Yb , 1)
Call Glcd_pixpos(xcount , Yb , 1)
Next A
End Sub


Ohhh .... werde ich mal ausprobieren, wenn ich nächste Woche wieder Zeit habe!!

Gruß
xcool

Vitis
12.09.2006, 12:34
Ach so, ein paar Fehlerchen hat das Listing noch,
wer sie findet kann sie behalten ;)
Ich hab die Routine nur zusammengefummelt um mir selbst
das Prinzip der Ansteuerung zu erarbeiten und das Display zu testen.
Hab nix anderes gemacht als nen Servo über PWM, auf dem Servo nen GPD-IR-Sensor und dann die Werte per ADC rein in den ATMega und per Linie Dann die Messwerte auf dem Diplay angezeigt, das wars auch schon.
Hat soweit funktioniert, n paar kleine Bildfehler waren schonmal dabei, hat mich aber wegen prinzipiellem Testzweck nicht weiter gejuckt, ging mir dabei ja nur ums prinzipielle Verständnis und Spaß an der Freude.

xcool
26.09.2006, 20:26
Bei SED basierten LCD gibt es keinen FS (Font Select) Pin. Geh mal auf die Hilfe, dann "suchen" und SED eingeben. Da steht alles drin. Es gibt eine spezielle Lib für SED Displays der Reset Pin ist im Config Statement der Beispielprogramme nicht angeschlossen. Ich denke den kannst Du fest mit +5V verbinden. CE1 und CE2 sind getrennte Chip Enable Pins. Jeweils ein Pin pro SED Chip. Schau mal in die Anleitung des Displays, da steht was von "linke Hälfte" und "rechte Hälfte".

Vielen Dank für Deine Antworten!!!!
Gruß
xcool

Marten83
28.10.2007, 14:13
Hallo!

Mich würde mal interessieren ob das mit dem Display EA DIP122-5 geklappt hat.
Will meines auch mittels Mega8 ansteuern und irgendwie kommen nur n paar Punkte am Rand.
Kann man irgendwie einstellen, dass das Display nur 122x32 Punkte hat?

Marten83