Hello everybody,
Just getting started with microcontrollers and serial communication, and looking for some advice to diagnose my problem.
I have a pic 18F4520 connected through a DB9 serial cable, through a keyspan USB/serial adapter.
I'm trying to get "Hello world", or "Finally working" to print to the screen of hyperterminal.
my code:
'TX is connected to pin C6; switch is connected to pin B0
switchVar var byte
input portb.0
Main:
SwitchVar = portb.0
if switchvar=1 then
Serout2 portc.6,16468,["Hello World",10,13]
endif
goto main
I have the settings in hyperterm at 9600,8-N-1.
my lovely output in hyperterm is the following:
€øxøøøøøøø€øxøøø€øøø€øxx€øxøøøøøøø€øxøøø€øøø€øxx€ø xøøøøøøø€øxøøø€øøø€øxx
I've tried many different options, slower baud rates, putting resistors in/out of the transmit line, sending DEC through serout2 .. . .
Everytime I hit the switch, I get the string of garbage above (albeit consistently the same garbage which I guess is good). When I tried the above options, I get different garbage on the hyperterm, but it is always consistent garbage.
From looking around on the net, my best guess is that Hyperterminal is receiving binary through the serial port, as people have said that this results in garbage. Not sure how I'm doing it, or if this is even the case.
Any help appreciated.
eric
Bookmarks