1 Attachment(s)
lcd with Hserout and a max232 connections? help
Hello
I wanted to drive my serial LCD with Hserout (for a test), on a pic16f628a, but I can't seem to shoot understandable data on the tx line.
First I realised it wanted an inverter, so I plugged a Max232, and used only the inverter feature(removed capacitor on the -10 +10 v port... multimeter agreed it does the job).
But i'm still getting trash data on the display...
here is the code
:
' Initialize USART
input portb.1
output portb.2
RCSTA = %10010000 ' Enable serial port and continuous receive
TXSTA = %00100000 ' Enable transmit and asynchronous mode
define HSER_BAUD 9600
define HSER_CLROERR 1
hserout [12,"* LED FADER *"]
see jpeg for circuit layout (may be wrong...)
http://www.picbasic.co.uk/forum/atta...1&d=1204400100
Condition the data line first
I found that I needed to set the RS-232 drive pin high some milliseconds before sending data. Otherwise I just got a string of gibberish on the terminal.
This is to put the RS232 output low which is the defined MARK or IDLE condition for the RS-232 interface.
Try something like...
High portb.2
pause 5
hserout [12,"* LED FADER *"]
HTH
BrianT