Hier mal mein QBASIC Code. Eigentlich steuert der Code einen uC über den
COM Port an, an dem das LCD angeschlossen ist, aber ich denke es ist
trotzdem zu verstehen:
Das Programm initialisiert den SED1305 auf reinen Grafikmodus mit einem
3 Graustufen Bild. Dazu werden 19200Bytes aus einer Datei gelesen und
gesendet. Den Befehl setDPTR muss man durch eine OUT &H37A, xx
ersetzen. Bei Adr+1 wird A0 des LCD auf High ansonsten auf Low
gesetzt.
SendByte besteht aus:
OUT &H378, Wert
OUT &H37A, xxx (CE\ auf Low)
OUT &H37A, xxx (WR\ auf Low)
OUT &H37A, xxx (WR\ auf High)
OUT &H37A, xxx (CE\ auf high)
Hier der Code:
InitSED
setDPTR ((Adr + 1) * 256#)
SendByte &H46
setDPTR ((Adr) * 256#)
SendByte &H0
SendByte &H0
setDPTR ((Adr + 1) * 256#)
SendByte &H42
setDPTR ((Adr) * 256#)
FOR J = 1 TO 19200
A$ = INPUT$(1, 2)
IF LEN(A$) = 0 THEN A = 0 ELSE A = ASC(A$)
SendByte A
NEXT
END
SUB InitSED
setDPTR ((Adr + 1) * 256#)
SendByte &H40
setDPTR (Adr * 256#)
SendByte &H30
SendByte &H87
SendByte &H7
SendByte &H27
SendByte &H2B
SendByte &HEF
SendByte &H28
SendByte &H0
setDPTR ((Adr + 1) * 256#)
SendByte &H44
setDPTR (Adr * 256#)
SendByte 0
SendByte 0
SendByte &HEF
SendByte &H80
SendByte &H25
SendByte &HEF
SendByte 0
SendByte &H4B
SendByte &H0
SendByte &H0
setDPTR ((Adr + 1) * 256#)
SendByte &H5D
setDPTR (Adr * 256#)
SendByte &H4
SendByte &H86
setDPTR ((Adr + 1) * 256#)
SendByte &H4C
SendByte &H5A
setDPTR (Adr * 256#)
SendByte 0
setDPTR ((Adr + 1) * 256#)
SendByte &H5B
setDPTR (Adr * 256#)
SendByte 12
setDPTR ((Adr + 1) * 256#)
SendByte &H59
setDPTR (Adr * 256#)
SendByte 116
END SUB