what's your expected baudrate? I feel 2400 bauds right?
so you should use...
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
OR
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 103 ' 2400 Baud @ 4MHz, 0.17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Unless your current USART setting show 600 baud.. and i'm not sure how god/bad it may works with your current hardware.
I would tent to use Usart interrupt for that.. but you can still remove the TimeOut to see what happen. Your code work as design so far.
Still looking...
Bookmarks