I would start by checking the baud rate. this line:
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.Code:DEFINE HSER_SPBRG 25
I would start by checking the baud rate. this line:
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.Code:DEFINE HSER_SPBRG 25
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Place a MAX 232 between your pic and the terminal, in your simulation, and you will receive the carrect characters.
Terminal is expecting an inverted signal (what max 232 will do, along with the level translation) and since it doesn't receive the proper signal isn't able to decode what you send.
Cheers
Al.
All progress began with an idea
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:
Is there another way to send data to serial port...?an example will do...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
simulation results attached.
Look at the SEROUT2 command in the manual.
Dave
Always wear safety glasses while programming.
Bookmarks