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

maximum interrupt length?

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







maximum interrupt length?
PostPosted: Mon Jun 09, 2008 4:38 am     Reply with quote

Hi there

I am aware of the many issues surrounding interrupts and that they should be kept as brief / quick / simple as possible. Assuming that no other interrupts are operating and no others will occur within the interrupt execution, is there an upper limit on the number of cycles consumed by an interrupt?

Many thanks
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: maximum interrupt length?
PostPosted: Mon Jun 09, 2008 6:13 am     Reply with quote

No, there is no limit. Just keep in mind that however long you stay in your interrupt routine, the main program that was interrupted will not be running all that time. So if that is not a problem for you, then you can stay in the interrupt routine forever if you like.

Robert Scott
Real-Time Specialties
Ttelmah
Guest







PostPosted: Mon Jun 09, 2008 6:51 am     Reply with quote

And (of course), if dealing with a repetitive event, the total time should be below the repeat 'interval', unless the handler is written to deal with this...

There is an important 'requirement' to understand the distinctions between the interrupt hardware (so a hardware flag is set when some particular event occurs), and the need for a 'handler'. The 'point' about having an interrupt handler, is normally that when the event occurs, another program sequence (the 'main' code), can be automatically stopped for a moment to handle _just_ this event. Effectively allowing computers to appear to do more than one thing at a time (since if the handler is quick, you can then return to the 'main', and carry on where you left off). If instead you want a major sequence of code to happen when the hardware flag is set (without this 'multi layer' approach to the code), then instead it may make more sense, to handle this _in_ the main (since you don't then have the overheads associated with calling the interrupt handler). In this case, you use the interrupt _hardware_, without the association of a 'handler'.

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