It will be easier for members to help if you post all your code. You don't have any CONFIGs, no oscillator setting, LED is not defined as a beginning.

Are the proper pins digital by default on this device?

Robert