I know this is years too late, but I just spent 2 hours banging my head against the wall with what I believe may be the same issue (or at least, this is the only forum post I found regarding it, so I leave this for people of the future to find).
The ADC is enabled by default, and the PORTE pins RE0/AN5, RE1/AN6, and RE2/AN7 are set to analog mode. If you try to read from them, you always get 0.
To get it working for normal input IO,
// Disable the ADC
ADON = 0;
// Set the pins back to digital mode
ANS5 = 0;
ANS6 = 0;
ANS7 = 0;
Bookmarks