Dunno buddy, replace your resistor with LED to Vdd and see what happen, Code seems to be OK.
On your PIC16F877, make sure you have all VDD and VSS pin connected, MCLR to VDD and the right capacitor around the crystal. If you're using an >4MHz one, set the HS_OSC fuse. Always make sure you also disable LVP in the configuration fuse too.
Bookmarks