Processor Interrupts with Arduino

Pages
Contributors: JordanDee, Ell C
Favorited Favorite 1

Introduction

Interrupts - what are they? They are people that intermittently prevent you from doing your current work. Ha! Well maybe... but what we really want to know is what they are in the context of embedded electronics and microprocessors.

So let's ask that again - what is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts:

  • Hardware Interrupts - These occur in response to an external event, like a pin going high or low.

  • Software Interrupts - These occur in response to a software instruction.

Generally speaking, most 8-bit AVR microcontrollers (i.e. Arduinos) aren't innately capable of software interrupts, so for the purposes of this tutorial, we will focus on hardware interrupts.

Hardware Interrupt Example with Arduino and Button

Suggested Reading

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

What is an Arduino?

What is this 'Arduino' thing anyway?

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

How to Install FTDI Drivers

How to install drivers for the FTDI Basic on Windows, Mac OS X, and Linux.