Thanks for clearing things up, Mr. RB. I really forgot to take into account the time spent on the ISR itself. So, Its impossible to interrupt every 3 instruction because for this you need to be interrupting from the ISR itself. And also the the extra-instruction generated for context saving and similar thing by C complier is an issue here.
I don't really need very fast frequency at the moment, just curious how much you can get.
@colin55; what ? How do I get a frequency of 500 khz? Why the glitch?
@atferrari Thanks. I am really loving it now. An accurarcy tool.
How do you convert your C code to Assembly code and do the MPLAB sim there. I want do see why a single C statment eats so much time?
And, after using the stopwatch, I am confused at this. With the PIC running from internal 4Mhz oscillator, how much time it takes for each Instruction? I thought (because of pipelining) its just 1/4Mhz = 0.25 us. Or I need to divide it by 4?
I thougt its only for TMR0 that we need to divide the clock by 4.
Thanks everybody.