hello,
the first thing that I think you should do is try and gain an understanding of how your lcd works... if you give me your email I will email you some usefull pdfs I have found...
portD is your data lines...
what port are you using to control the lcd (rw,rs, and e)?
yes, you have to do trisd=0, you also (if applicable) have to set port d to digital i/o (some ports do analog and digital)
you also have to configure the control lines as o/p
to initialize the lcd you have to do this:
[
rs=0
rw=0
portD=0x38
e=1
small delay (NOP)
e=0
]
delay 5 ms
[
rs=0
rw=0
portD=0x38
e=1
small delay (NOP)
e=0
]
delay 5 ms
[
rs=0
rw=0
portD=0x38
e=1
small delay (NOP)
e=0
]
delay 5 ms
[
rs=0
rw=0
portD=0x0c (lcd on)
e=1
NOP
e=0
[
rs=0
rw=o
portD=0x01 (lcd clr)
e=1
NOP
e=0
]
rs=0
rw=0
portD=0x06 (curser increment mode)
e=1
NOP
e=0
]
to send a character do this:
[
rs=1
rw=0
portD=(0x31 - will display a "1" on the screen)
e=1
NOP
e=0
]
NOTE: the only difference between sending commands (like clearing the lcd) and sending characters (like ascii 0x31) is the rs line... 1 = char, 0 = command