Lecture_07 - Interrupts

Lecture_07 - Interrupts - SEE215 Lecture 7 Interrupts...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Faculty of Science and Technology Lecture 7 Interrupts SEE215
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background to Interrupts Life often involves interruptions. We are often interrupted by phone calls, someone knocking on the door, a fire alarms, etc. etc. Interruptions can often be a nuisance, but also many times can they can be so important that they should not be ignored. It is better to have a phone interrupt us by ringing rather then, have to pick up the phone every few minutes to check just in case someone has called us. So, in life we manage interrupts which might occur, so that we can get on with our life, but we still allow the opportunity for ourselves to be interrupted by important events that we wish or must attend to. After we are interrupted, we resume the task before we were interrupted. Sometimes we may turn the phone off or put a “do not disturb” sign on our door to avoid any interrupt. What does this have to do with microcontrollers?
Image of page 2
Interrupts in microcontrollers A micro controller may have many tasks to perform, which all require certain amount of time to complete. Some of these might be mundane tasks, which are relatively non-time critical. IE. Flashing a LED, or writing data to a terminal, turning a pump ON or OFF. Some events however may be extremely time critical, which may be one off events, such as a key press, a character received from a terminal or some other time critical task needs to be performed. We need to take this into account when we design our programs, so that whilst the mundane and non-critical tasks must always completed, when a a time critical event occurs, the current task should be suspended temporarily, priority give to the interrupt task and then the suspended task resumed. Interrupts are so important, that all microcontrollers have a structure that allow for interrupts.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon