Your A.1 in-port is not set as input. You use PortA.1 right?? Look at this:
TRISA=%00000 'This is all A-pins to output == Decimal 0
TRISA=%00001 This makes A.0 an INPUT == Decimal 1
TRISA=%00010' This will make A.1 an INPUT == Decimal 2
TRISA=%11111 'All input== Decimal 31
Get the point?
Sometimes it is better to use Binary when setting the registers because then you "see" the number better when you compare with the datasheet.
M
Bookmarks