PDA

View Full Version : SEROUT LCD help!



chip15
- 11th December 2006, 23:08
Hi all,
how to write code,whit SEROUT command, for LCD seial 4x20 ?
A example please..
This code not work. Only X on display..
--------------------------------------------
pause 1000
start:
serout portb.1, 2, [254,1]
pause 40
serout portb.1, 2, ["Hello World"]
pause 400
goto start
end
--------------------------------------------

pic 16f84a
trasmit on port1
9600

THX
chip

mister_e
- 11th December 2006, 23:15
Make sure you're using a higher crystal speed than 4 MHZ or use DEBUG instead

If you're using >4MHZ, make sure you set HS_OSC mode in your config fuses (see the FAQ)

Some serial LCD may need to receive CR AND LF before writing to the LCD. So change

serout portb.1, 2, ["Hello World"]

to

serout portb.1, 2, ["Hello World",13,10]

try this too


TRISB.1=0
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 1
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 0

Start:
debug $FE,1
pause 40
debug "HELLO",13,10
pause 1000
goto start


if it doesn't work, tell us more about your hardware : crystal speed, LCD model... etc etc etc

<img src="http://www.mister-e.org/Pics/CrystalBall_Informations.gif">