
Originally Posted by
cncmachineguy
I would start by checking the baud rate. this line:
Code:
DEFINE HSER_SPBRG 25
is the same as I use with a 48mHz OSC. Now mind you, I am just starting to get into serial so I may be way off here.
i've not understand you above,but i modified the code and tried to simulate it again,the results on the terminal is not what i sent.....
code:
Code:
define osc 20
char var byte
trisb=1
trisc=0
RCSTA=$90
TXSTA=$24
SPBRG=25
start:
hserin 1000,mainloop,[char]
mainloop:
if portb.3=1 then
hserout ["door is opened",13,10]
hserout [char]
endif
goto start
end
Is there another way to send data to serial port...?an example will do...
simulation results attached.
Bookmarks