Firat, In the past I have had problems with the usart in an 16F628 and found that before using the internal usart if I sent the commands:
IF RCSTA.1 = 1 THEN 'if overrun error bit is set
RCSTA.4 = 0 'clear CREN continous receive enable bit
RCSTA.4 = 1 'set CREN continous enable receive bit
ENDIF
What this does is to reset the internal overrun error latch that when set inhibits any received data bytes, effectively disabling the usart. Adding these lines of code just before the usart use will make sure the usart will receive the data. This had to be used before the PBP compiler was updated with the added command of: DEFINE HSER_CLROERR 1 which does this function in the background.
Dave Purola,
Bookmarks