CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Improving the interrupt latency

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Nepersky



Joined: 10 May 2011
Posts: 15

View user's profile Send private message

Improving the interrupt latency
PostPosted: Tue May 31, 2011 10:20 am     Reply with quote

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!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 31, 2011 11:05 am     Reply with quote

See these threads with information on using #int_global by Ttelmah:
http://www.ccsinfo.com/forum/viewtopic.php?t=44031
http://www.ccsinfo.com/forum/viewtopic.php?t=44491
http://www.ccsinfo.com/forum/viewtopic.php?t=44307
http://www.ccsinfo.com/forum/viewtopic.php?t=43399
http://www.ccsinfo.com/forum/viewtopic.php?t=42691
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group