What you're trying to do is read a digital input on RAx. This note from page 33 of the manual points you in the right direction. The RAx pin must be configured as a digital input
first.
"Note: The ANSEL and CMCON0 registers must
be initialized to configure an analog
channel as a digital input. Pins configured
as analog inputs will read ‘0’."
Hope this helps...
Bookmarks