Yes, just a loopback
I tried the tester as below (cut & paste except the range) but just a a list of ascii garbage. I am monitoring using the microcode studeo serial communicator and have tried receiving at various speeds.
The output is via a 1K resistor.
Regards
Chris
´*********************************
@ device hs_OSC, wdt_on, pwrt_on, protect_off
define osc 20
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 64 ' 2400 Baud @ 4MHz, 0.17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Pause 500
Start:
FOR SPBRG=15 to 100
HSEROUT ["SPBRG=",#SPBRG]
PAUSE 50
NEXT
stop 'put this in to do it only once
GOTO Start
By the way,
I am using PBP version 2.46
Regards
Chris
If you are using HSERIN/HSEROUT, you can't simply use a resistor. The data is inverted compared to what it needs to be in order to communicate with any normal serial device (such as a PC).
A MAX232 (or equivalent), not only changes the voltage swings and levels, it inverts the signals as well.
Charles Linquist
Thanks to both of you,
I have finally had success but I have to admit that the problem was me all the time and I only added the MAX232 at the end but still had problems.
All that was needed was a decoupling cap on the Max232.
I have to eat humble pie today!
Thanks all,
You have kept my sanity
Regards
Chris
Bookmarks