Are you sure the PIC is running 20Mhz? Could be running on the internal 'failure' clock.
Does a one-second blinky LED actually blink at one second intervals?
Also, check up on using the LAT register vs. the PORTx register...
How fast is it actually running thru the loop? 1x per second? 100x per second? 10000000000000000000000x per second?
Can you measure it?





Bookmarks