Oh Boy. Where to start. I guess from the beginning.
Since there isn't an OSC definition, I assume you're running at 4Mhz. And, with 4 Mhz, and BRGH (TXSTA.2) set to 0. The error rate for 9600 baud is 7%. That's really high. If you use HSER_TXSTA 24, which sets BRGH to 1, the error rate goes to 0.16%.
But then you manually set SPBRG to 25, which would be 2400 baud at 4mhz, so the 9600 gets discarded.
INTCON = %10010000 Along with turning Global interrups on, also enables the External Interrupt INT. But the rest of the program doesn't use INT.
'PIE1.5 = 1 ' enable interrupt on usart receive
This line is commented out, so the RX interrupt never gets enabled.
PIE1.4 = 1 ' enable interrupt on usart transmit
You cannot use Transmit interrupts with HSEROUT, they are not compatible.
Just like the compiler would do, I'll stop there and report [too many errors]
Bookmarks