Quote from the data sheet:
The Alternate Pin Function Control 0 (APFCON0) and
Alternate Pin Function Control 1 (APFCON1) registers
are used to steer specific peripheral input and output
functions between different pins. The APFCON0 and
APFCON1 registers are shown in Register 12-1 and
Register 12-2. For this device family, the following
functions can be moved between different pins.
- SS (Slave Select)
These bits have no effect on the values of any TRIS
register. PORT and TRIS overrides will be routed to the
correct pin. The unselected pin will be unaffected.
And for the APFCON0 register:
RXDTSEL: Pin Selection
- For 14 Pin Devices (PIC16F/LF1824)
- 0 = RX/DT function is on RC5
- 1 = RX/DT function is on RA1
- For 20 Pin Devices (PIC16F/LF1828)
- 0 = RX/DT function is on RB5
- 1 = RX/DT function is on RC5
So setting RXDTSEL to 1 will move the RX to the same pin as RC5
And by setting TRISA to 1 you will be setting all of port A to be output except RA0 which will be input.
Either set it to 2, or set TRISA1 to 1, to set RA1 as an input.
Some other things from the data sheet to note:
If the RX/DT function is on an analog pin, the corresponding ANSEL bit must be cleared for the receiver to function.
... so to use RA1 you have to set ANSEL properly to ensure RA1 is switched to digital input not analog (it defaults to analog IIRC)