Datasheet!!! Page 28, Section 2-2 OSCCON Register... I don't see you setting it for 8MHz...
OSCCON=%01110010
Try adding the above before your TRIS statements...
For frequency critical applications, I'd also follow that with...
WHILE OSCCON.2=0:WEND
This ensures that program continuation is halted until the Oscillator is stable...
Bookmarks