Background to InterruptsLife 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 soimportant that they should not be ignored.It is better to have a phone interrupt us by ringing rather then, have to pick up thephone 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 withour 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 doorto avoid any interrupt.What does this have to do with microcontrollers?
Interrupts in microcontrollersA micro controller may have many tasks to perform, which all requirecertain 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 offevents, 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 thatwhilst the mundane and non-critical tasks must always completed, whena 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.
has intentionally blurred sections.
Sign up to view the full version.