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 CCS Technical Support

reduce interrupt handler overhead

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







reduce interrupt handler overhead
PostPosted: Fri Mar 16, 2007 9:55 pm     Reply with quote

Is there any other way to reduce interrupt handler overhead?
The compiler automatically saves lots of SFRs which my program do not require it to do so.
One way i could do is to use #INT_GLOBAL but i need to use priority interrupts but #INT_GLOBAL do not allow me to do so.
Am using PCWH 4.013.
Ttelmah
Guest







PostPosted: Sat Mar 17, 2007 4:12 am     Reply with quote

If you code a _single_high priority interrupt, using the 'fast' option, it gets jumped to directly from the 0008 high priority address, with no registers saved. All you do is code this as a 'high priority int_global', checking what the source actually was, and calling the required routines. This routine will use RETFIE 1, so the W register etc., are saved for you by the hardware, and all you have to do, is ensure that the individual routines save anything else they require, and clear their own interrupt flags.
Generally, if you need just one 'fast' interrupt, then the best way is just to code this as 'fast', and then check the assembler generated for the handler routine, and add any extra register saves/restores needed.
Beware of the 'caveat' that in general, if high priority interrupts are used, INT_EXT, will always be 'high priority', so even if you only 'want' one high priority interrupt, you may well end up with two... :(

Best Wishes
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