Quote Originally Posted by francolok View Post
DEFINE HSER_BAUD 31250
Not sure if PBP/HSERIN/HSEROUT calculate baud rate or use a lookup table, but I'm sure that 31250 isn't a 'standard' baud rate. You may have to set the baud rate (SPBRG) manually, by hand, by doing a few calculations, looking it up in the 16F877 datasheet, etc.

POKE TRISA, %11011111
What's up with the POKEs and PEEKs when you can just access the registers directly like:
RCSTA = $90