Try this other way:
The first thing is to remove the WaitMs 50.
Incorporate buffer error control.
'12F1822, v1.1
'Fuses
#define CONFIG1 = 0x0f84
#define CONFIG2 = 0x1cff
'Clock Mhz
#define CLOCK_FREQUENCY = 4
AllDigital
TRISA = %00011000
PORTA = 0
Dim i As Byte
Symbol led = PORTA.5
UART1_Init 19200
WaitMs 100
led = 1
UART1_Write "START", CrLf
loop:
UART1_Get i
If UART1_Data_Ready > 0 Then
UART1_Write "Number: ", #i, CrLf
Toggle led
'WaitMs 50
If RCSTA.OERR = True Then Call _error_usart()
Endif
Goto loop
End
'Manages the blocking of the USART in Rx mode
Proc _error_usart()
Dim _papelera As Byte
'More data entered than was extracted (blocked)
RCSTA.CREN = 0 'Disable, continua recepción
_papelera = RCREG 'Clear buffer usart
_papelera = RCREG
RCSTA.CREN = 1 'Enable, Continuous Receive Enable bit*/
End Proc