Ok i figured out a way to measure my interrupts.
The interrupt routine simply Toggles a pin of the micro on each interrupt and i measure such pin with my oscilloscope. The frequency of sampling is wrong.
Problems:
1. The TMR2 doesnt just go back to 0 after reaching PR2 value.. i had to set it to 0 otherwise i get unwanted interrupts.
2. I cant believe this to be impossible so i made a small RX int.... when i press "1" PR increases by one.. else it goes down one, so i can sweep controlling by my keyboard. RESULT: No No it doesnt work.... i never get to my 125us interrupt it suddenly jumps back to the lower frequency after a point.
Is 125us to much to ask for 4Mhz.. teorically i would say No.. 125 instructions are a lot of instructions... and i am only sampling at this point of my software so: what could be the problem?
I cant use other OSC since i am using internal OSC and A7 pin for other purpouses... Since i am only sampling would something like pauseuS 125 : sample work?... What should be the timing consideration in this case?
i still need someting like:
Code:
Sample:
pauseus 125
Samples [NumSamples] = CMCON.7
NumSamples = NumSamples + 1
IF NumSamples = 120 THEN return
goto Sample
How many instructions take this sub to work? i guess i have to take them into account for my timing to be correct!!!
Thanks on any help.. Interrupt 125uS 4Mhz still in need!!
Bookmarks