Hi,
I tried to make my one program but it doesn't work
I use the IO.dll file...
(
http://www.geekhideout.com/iodll.shtml)
Code:
Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Declare Function PortWordIn Lib "IO.DLL" (ByVal Port As Integer) As Integer
Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
this is my test code now:
(I press command button 2 then 4 after that 3, normally something would come on the screen...)
Code:
Private Sub Command2_Click() 'data x as
Call PortOut(&H37A, &HC) '0111 C/D low
Call PortOut(&H37A, &H8) '0011 WR low
Call PortOut(&H378, &H1) 'x = 1 (just a random guess)
Call PortOut(&H37A, &H9) '0010 CE low
Call PortOut(&H37A, &H8) '0011 CE high
Call PortOut(&H37A, &HC) '0111 WR high
End Sub
Private Sub Command3_Click() 'command char
Call PortOut(&H37A, &H4) '1111 C/D high
Call PortOut(&H37A, &H0) '1011 WR low
Call PortOut(&H378, &H55) 'char = u
Call PortOut(&H37A, &H1) '1010 CE low
Call PortOut(&H37A, &H0) '1011 CE high
Call PortOut(&H37A, &HC) '0111 C/D low
End Sub
Private Sub Command4_Click() 'data y as
Call PortOut(&H37A, &HC)
Call PortOut(&H37A, &H8) 'Y = 8 (just a random guess)
Call PortOut(&H378, &H1)
Call PortOut(&H37A, &H9)
Call PortOut(&H37A, &H8)
Call PortOut(&H37A, &HC)
End Sub
'wiring: CE = 1
' RD = 14
' wr = 16
' c/d = 17
it's pretty easy written cuz its still a test program.
Now a bit information:
To let something pop up on the screen you need to send first a few control signals.
.1 Write data - The data to be written should be set on D0 - 7 and
C/\D taken low,
/WR taken low (/RD should be high)
/CE pulsed low for greater than 80ns
2.2 Read data - C/\D take low,
/RD take low (/WR should be high)
/CE take low
After 150ns read the data on D0-7
/CE take high
2.3 Write Command - To Write a Command - The command should be set on D0 - 7 and
C/\D taken high,
/WR taken low (/RD should be high)
/CE pulsed low for greater than 80ns
2.4 Read Status - To check the Status of the T6963C controller -
C/\D take high,
/RD take low (/WR should be high)
/CE take low
After 150ns read the data on D0-7
/CE take high
Note that there is no such thing as reading an command instruction
To send something on the screen you need to follow this course:
status check
1st data Xadrs 24h
status check
2nd data Yadrs 03h
status check
Command 21h
Source:
http://www.nbb.cornell.edu/neurobio/land/STUDENTPROJ/1999to2000/gurnee/T6963rr.pdf
I think I did exactly what the wrote on the data sheet...
what could be wrong cuz it isn't working?
My lcd works fine, I tested it with lcd studio.
some important things:
rw, ce ,rd are inverted
c/d is right
(tested it with parallel port monitor.)
thx, Fré
If you don't understand something just ask!
(sorry for my bad english)