|
|
View previous topic :: View next topic |
Author |
Message |
Oli Guest
|
maximum interrupt length? |
Posted: Mon Jun 09, 2008 4:38 am |
|
|
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
|
Re: maximum interrupt length? |
Posted: Mon Jun 09, 2008 6:13 am |
|
|
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
|
|
Posted: Mon Jun 09, 2008 6:51 am |
|
|
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 |
|
|
|
|
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
|