I'm using an 18F8720 and needed to use PORTG.2 as an input for the first time. I quickly found that
even though the pin is permanently tied high (to a solid 5V), occassionally, the pin will return
a "0" value when read - but only after a power cycle.

I looked at the datasheet and saw that the pin is also used as Rx in on USART2. I explicity disabled
the USART with the commands TXSTA2 = 0 and RCSTA2 = 0, but that didn't help. I also explicity set
TRISG.2 = 1 in the main program (which loops every 100mSec). That didn't help either. The pin gets read as "0" for
several loops and then magically starts returning "1" again. The problem only occurs after a power cycle -
that is the pin shows a "1" for several seconds after a power cycle, then it returns "0" for several seconds,
then it returns "1" again - forever - or until another power cycle. It acts like an unitialized variable is the problem,
but I can't find any variable that is remotely connected to this issue. I'm ready to write a debug
routine that does a complete register dump whenever it returns a "0", but I won't be able to get to it
until Monday.

When I choose a different pin (on a different port) as an input, all works as expected. I was initially thinking
that this might be a manifestation of a Read/Modify/Write problem (because I DO write to PORTG.1), but
this pin is only used as an input and shouldn't be affected.

This is driving me crazy. Does anyone have any ideas of what could be going wrong?