Nepersky
Joined: 10 May 2011 Posts: 15
|
Improving the interrupt latency |
Posted: Tue May 31, 2011 10:20 am |
|
|
Hello!
In my program I need to enter and exit the interrupt fast. The problem is. that the compiler produces an assembly code, 60 instruction cycles long, before the interrupt function is actually called.
All in all it shouldn't take more than a couple of instructions to reach the interrupt function.
In the data sheet it is stated:
Quote: | During interrupts, the return PC address is saved on
the stack. Additionally, the WREG, STATUS and BSR
registers are saved on the Fast Return Stack |
This is all I need saving.
It is also stated:
Quote: | When the interrupt flag, enable bit and appropriate
global interrupt enable bit are set, the interrupt will
vector immediately to address 0008h or 0018h |
So if the address of the interrupt function resides there, that function should be entered within a couple of cycles (as far as I remember from the times when I was writing code in assembler, this was the case). How can I get rid of all the code added by the compiler.
After reading the forum I tried the #INT_CCP1 fast (CCP1 is the interrupt which is time critical) directive but it changed the priority to high (I am using PIC18F24J11) and only speeded up the interrupt entry by about 20 cyc.
Is there any way to reduce this time to, say somewhere between 5 and 10 cycles?
Thank you in advance for all your help.
Cheers! |
|