If you want answers and not guesse, then it is good practice to post all your code, chip, IDE used.

I can only guess now you may declared wrong chip, or you have something missing in you code listing.

Ioannis