BlaueLed
12.02.2006, 16:50
Hallo,
angeregt von diesem Thread :
http://www.mikrocontroller.net/forum/read-4-243641.html#new
bin ich auf der Suche nach jemandem, der mir hilft, eine Library für das S65 Display für Bascom zu schreiben. Für Bascom gibt es bereits einen Code zum ansteuern des Display´s. Nur ist dieser langsam und es ist keine Funktion eingebaut um Text und Bilder darzustellen.
$regfile = "m8def.dat"
$crystal = 16000000
Ddrc = &B11111111 'Port C als Output
Ddrd = &B11111111 'Port D als Output
Dim A As Word , B As Word , R As Byte , F As Word , T As Byte
'##################################
'Start der S65-Ansteuerung
'##################################
Anfang:
Portd.7 = 1
Waitms 10
Portd.7 = 0 'Reset
Portc.2 = 1
Portc.4 = 1
Portc.5 = 1
Portc.0 = 1
Waitms 1
Portd.7 = 1 'Reset Ende
Waitms 10
Portc.2 = 1 'CS select, Start
Waitms 1
Portc.0 = 1 'RS high, Command
' Displayinitialisierung
Restore Init1
For R = 1 To 12
Read A
Gosub 16
Next
Waitms 7 'diese Zeit ist sehr wichtig, sollte keinesfalls unterschritten werden
Restore Init2
For R = 1 To 23
Read A
Gosub 16
Next
'########################
'Farbverläufe erzeugen
'########################
'Blau malen
A = &HEF90
Gosub 16
A = &H0500 ' 00 => Bild wird von oben nach unten gemalt
Gosub 16
A = &H0700 'x1
Gosub 16
A = &H092B 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0 ' RS auf low setzen für Bilddaten
F = 0
For T = 1 To 32 '32 Farbabstufungen schwarz => blau
For R = 1 To 88 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 1
Next T
F = 31
For T = 1 To 32 '32 Farbabstufungen blau => weiss
For R = 1 To 88 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 2112
Next T
Portc.0 = 1
'Grün malen
A = &HEF90
Gosub 16
A = &H0500
Gosub 16
A = &H082C 'x1
Gosub 16
A = &H0957 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 64
Next T
F = 2016
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 2049
Next T
Portc.2 = 1
Portc.0 = 1
'Rot malen
A = &HEF90
Gosub 16
A = &H0500
Gosub 16
A = &H0858 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 2048
Next T
F = 63488
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 65
Next T
Portc.0 = 1
' Schwarz => weiss
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0800 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A80 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32 '32 Farbabstufungen schwarz => weiss
For R = 1 To 192 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 2113
Next T
Portc.0 = 1
' cyan
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A80 'y1
Gosub 16
A = &H0B8F 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 2047
Gosub 16
Next R
Portc.0 = 1
' magenta
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A90 'y1
Gosub 16
A = &H0B9F 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 64241
Gosub 16
Next R
Portc.0 = 1
' gelb
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0AA0 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 65504
Gosub 16
Next R
Portc.0 = 1
Powerdown
End
16:
Portc.2 = 0
Portc.4 = 0
B = A And 32768
If B = 32768 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 16384
If B = 16384 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 8192
If B = 8192 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 4096
If B = 4096 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 2048
If B = 2048 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 1024
If B = 1024 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 512
If B = 512 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 256
If B = 256 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 128
If B = 128 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 64
If B = 64 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 32
If B = 32 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 16
If B = 16 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 8
If B = 8 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 4
If B = 4 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 2
If B = 2 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 1
If B = 1 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
Portc.2 = 1
Return
Init1:
Data &HFDFD% , &HFDFD%,
Data &HEF00%,
Data &HEE04% , &H1B04%,
Data &HFEFE% , &HFEFE%,
Data &HEF90% , &H4A04% , &H7F3F% , &HEE04% , &H4306%
Init2:
Data &HEF90% , &H0983% , &H0800% , &H0BAF% , &H0A00% , &H0500% , &H0600% , &H0700%,
Data &HEF00%,
Data &HEE0C%,
Data &HEF90% , &H0080%,
Data &HEFB0% , &H4902%,
Data &HEF00%,
Data &H7F01% , &HE181%,
Data &HE202%,
Data &HE276%,
Data &HE183%,
Data &H8001%,
Data &HEF90%,
Data &H0000%
Die Frage ist jetzt:
besitzt jemand so ein Display und hat Zeit und Interesse um eine Library ( oder auch Funktionen zum einbinden in Bascom ) zu schreiben ?
mfg Kay[/url]
angeregt von diesem Thread :
http://www.mikrocontroller.net/forum/read-4-243641.html#new
bin ich auf der Suche nach jemandem, der mir hilft, eine Library für das S65 Display für Bascom zu schreiben. Für Bascom gibt es bereits einen Code zum ansteuern des Display´s. Nur ist dieser langsam und es ist keine Funktion eingebaut um Text und Bilder darzustellen.
$regfile = "m8def.dat"
$crystal = 16000000
Ddrc = &B11111111 'Port C als Output
Ddrd = &B11111111 'Port D als Output
Dim A As Word , B As Word , R As Byte , F As Word , T As Byte
'##################################
'Start der S65-Ansteuerung
'##################################
Anfang:
Portd.7 = 1
Waitms 10
Portd.7 = 0 'Reset
Portc.2 = 1
Portc.4 = 1
Portc.5 = 1
Portc.0 = 1
Waitms 1
Portd.7 = 1 'Reset Ende
Waitms 10
Portc.2 = 1 'CS select, Start
Waitms 1
Portc.0 = 1 'RS high, Command
' Displayinitialisierung
Restore Init1
For R = 1 To 12
Read A
Gosub 16
Next
Waitms 7 'diese Zeit ist sehr wichtig, sollte keinesfalls unterschritten werden
Restore Init2
For R = 1 To 23
Read A
Gosub 16
Next
'########################
'Farbverläufe erzeugen
'########################
'Blau malen
A = &HEF90
Gosub 16
A = &H0500 ' 00 => Bild wird von oben nach unten gemalt
Gosub 16
A = &H0700 'x1
Gosub 16
A = &H092B 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0 ' RS auf low setzen für Bilddaten
F = 0
For T = 1 To 32 '32 Farbabstufungen schwarz => blau
For R = 1 To 88 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 1
Next T
F = 31
For T = 1 To 32 '32 Farbabstufungen blau => weiss
For R = 1 To 88 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 2112
Next T
Portc.0 = 1
'Grün malen
A = &HEF90
Gosub 16
A = &H0500
Gosub 16
A = &H082C 'x1
Gosub 16
A = &H0957 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 64
Next T
F = 2016
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 2049
Next T
Portc.2 = 1
Portc.0 = 1
'Rot malen
A = &HEF90
Gosub 16
A = &H0500
Gosub 16
A = &H0858 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A00 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 2048
Next T
F = 63488
For T = 1 To 32
For R = 1 To 88
A = F
Gosub 16
Next R
F = F + 65
Next T
Portc.0 = 1
' Schwarz => weiss
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0800 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A80 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
F = 0
For T = 1 To 32 '32 Farbabstufungen schwarz => weiss
For R = 1 To 192 '2 Zeilen gleiche Farbe
A = F
Gosub 16
Next R
F = F + 2113
Next T
Portc.0 = 1
' cyan
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A80 'y1
Gosub 16
A = &H0B8F 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 2047
Gosub 16
Next R
Portc.0 = 1
' magenta
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0A90 'y1
Gosub 16
A = &H0B9F 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 64241
Gosub 16
Next R
Portc.0 = 1
' gelb
A = &HEF90
Gosub 16
A = &H0504 ' 04 => Bild wird von links nach rechts gemalt
Gosub 16
A = &H0880 'x1
Gosub 16
A = &H0983 'x2
Gosub 16
A = &H0AA0 'y1
Gosub 16
A = &H0BAF 'y2
Gosub 16
Portc.0 = 0
For R = 1 To 64
A = 65504
Gosub 16
Next R
Portc.0 = 1
Powerdown
End
16:
Portc.2 = 0
Portc.4 = 0
B = A And 32768
If B = 32768 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 16384
If B = 16384 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 8192
If B = 8192 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 4096
If B = 4096 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 2048
If B = 2048 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 1024
If B = 1024 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 512
If B = 512 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 256
If B = 256 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 128
If B = 128 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 64
If B = 64 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 32
If B = 32 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 16
If B = 16 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 8
If B = 8 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 4
If B = 4 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 2
If B = 2 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
B = A And 1
If B = 1 Then Portc.5 = 1
If B = 0 Then Portc.5 = 0
Portc.4 = 1
Portc.4 = 0
Portc.2 = 1
Return
Init1:
Data &HFDFD% , &HFDFD%,
Data &HEF00%,
Data &HEE04% , &H1B04%,
Data &HFEFE% , &HFEFE%,
Data &HEF90% , &H4A04% , &H7F3F% , &HEE04% , &H4306%
Init2:
Data &HEF90% , &H0983% , &H0800% , &H0BAF% , &H0A00% , &H0500% , &H0600% , &H0700%,
Data &HEF00%,
Data &HEE0C%,
Data &HEF90% , &H0080%,
Data &HEFB0% , &H4902%,
Data &HEF00%,
Data &H7F01% , &HE181%,
Data &HE202%,
Data &HE276%,
Data &HE183%,
Data &H8001%,
Data &HEF90%,
Data &H0000%
Die Frage ist jetzt:
besitzt jemand so ein Display und hat Zeit und Interesse um eine Library ( oder auch Funktionen zum einbinden in Bascom ) zu schreiben ?
mfg Kay[/url]