As requested by others, post your complete code and a schematic of your circuit.

Have you disabled analog features on any pins you use as digital?

Robert