View Single Post
  #8   Spotlight this post!  
Unread 18-01-2004, 13:29
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Re: When would I use an interrupt?

Quote:
Originally Posted by Apollo Clark
So, when does the processor check the interrupt registers?
I think you're missing the point of interrupts. It's not that the function is executed anywhere you're code is running. This is true, but this is just a side-effect of the real purpose of interrupts.

Interrupts provide a way for the harware to be notified of an *event* versus the hardware frequently checking if an event happened sometime in the past. You don't *have* to use interrupts for a simple digital switch, but you might as well. I'm a big fan of not wasting resources, if I have interrupts left over, I'll use them for a trivial task such as this. My logic is, why waste time checking something if I can be told when it happens.

Also, if this controler has "true" interrupts, then the hardware doesn't need to "check the registers." Asserting an interrupt pin on the chip will literally *interrupt* execution and force execution of the interrupt handler. Doesn't need to check anything.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...