Is it possible you did not set the TRISx register (where x is the port name) ? Perhaps the pin is an analog one by default and you haven't configured it for digital use?

these are what I can think of just now.