$$ \newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\dx}{\text{ dx}}
\newcommand{\rang}{\text{rang}}
\newcommand{\s}{\ \ \ \ \ \ }
\newcommand{\arrows}{\s \Leftrightarrow \s}
\newcommand{\Arrows}{\s \Longleftrightarrow \s}
\newcommand{\arrow}{\s \Rightarrow \s}
\newcommand{\c}{\bcancel}
\newcommand{\v}[2]{
\begin{pmatrix}
#1 \\
#2 \\
\end{pmatrix}
}
\newcommand{\vt}[3]{
\begin{pmatrix}
#1 \\
#2 \\
#3 \\
\end{pmatrix}
}
\newcommand{\stack}[2]{
\substack{
#1 \\
#2
}
}
\newcommand{\atom}[3]{
\substack{
#1 \\
#2
}
\ce{#3}
}
$$
Interupts
An alternative to pooling. Allows the CPU to run a routine when an external device sends an interrupt request. The CPU will return to the normal program after the interrupt is executed.
Microcontrolers usually have designated interrupt pins.
When an interrupt is triggered, the interrupt handler adds the interrupt to a cue for execution.
All interrupts can be enabled/disabled by the global interrupt (for atmega32A).
AtMega32A Interrupts
![ATMEGA32A-interrupts.png](../../images/atmega32a-interrupts.png)
Interrupt Priority
The lower the vector number, the higher the interrupt priority. If interrupts are triggerend at the same time, higher priority interrupts are handled first.
Backlinks