Contents
|
OverviewInterrupts are part of every day life. Not just real life, but the daily operations of computers - including embedded systems such as Arduino. I prepared this guide because there seems to be quite a bit of interest in the topic of interrupts, but also a significant amount of mystery which often lead to misinformation. There is a companion video that not only follows along with the examples in this web site, but also looks at some of the background theory and some examples of how interrupts are used within the Arduino HAL software. Following are some attributes of interrupts:
In this guide (and the video) I create a couple of projects that illustrate:
What is an Interrupt?As its name implies, an interrupt is something that happens that breaks the continuity of some activity. Typically the interrupt is dealt with in some way. Once the interruption is dealt with the original activity is resumed - typically from the point where the interruption occured. Whether this is in real life or in a computer, the basic idea of an interrupt is the same. All but the simplest of computers rely on interrupts for smooth operations. This includes several features in the Arduino ecosystem which rely on interrupts to work. The examplesOn this site, and in the companion video, I explore interrupts, how they are used in Arduino, some do's as well as some don'ts by looking at some practical follow along examples. In general, there are two versions of the projects. Specifically:
The projects are:
In that project, you can easily switch between using interrupts or not using them. This allows you to see the benefit/impact of using/not using interrupts for critical operations. The project, Event Countdown Clock - V2.0, is fully documented on Instructables. Parts listTo complete this tutorial you will need:
|