Hello folks,
during the last 2 days I've been bashing my head with an unusual problem: up until now I've played along with a few pic18f13k22's using the old mplab 8.92 & c18 3.47 and programming them with the stand-alone pickit2 programmer (which according to microchip officially supports pic18f13k22). Once you setup the proper config flags and the OSCCON bits, you can get the expected behavior when it comes to delay routines (for example, using Delay<xx>KTCYx() works as expected in c18; in mikropascal delay_ms works also).
But using the latest version of mplab x and xc8, everything goes haywire (using the same Delay<xx>KTCYx() as in c18 produces far faster blink rates). I've double & triple checked my code and all is ok. Also I used MikroPascal Pro to eliminate it out. No matter what I do, if I try to do the simplest led blinking pic setup, it never runs at the expected frequency. In the programmer, the config flags all show up ok, for all 3 compilers. It's just that flashing the xc8 hex with pickit2 seems to screw up something internally. Since I'm on a low budget at the time (unemployed) and I don't have a scope, I'm interested if there's someone that has a pickit2 & pic18f13k22 that can give it a few shots to see if indeed the issue is reproducible. As a mention, I did compile the code with xc8 in both "normal" mode and "trial" mode with all the fancy bells and whistles.