joseluistajada, you also need to show your initialization code. The pins may not be set to digital by default. You need to set TRIS values and ANSEL and other registers before a PIC will work as expected.