It looks like your transmitter is set to 2400, but your receiver is set for 9600 baud.
check out:
Code:
DEFINE HSER_TXSTA 20h 'Set receive register to TX en
define HSER_SPBRG 25
DEFINE HSER_SPBRGH 1
I like using PicMultiCalc. It can be found here: http://www.picbasic.co.uk/forum/cont....-PICMultiCalc
Then I can just paste it into my code. Here is one for 2400 baud, and one for 9600 baud.
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 25 ' 2400 Baud @ 4MHz, 0.17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 25 ' 9600 Baud @ 4MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Bookmarks