Interrupt Pin


In system programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by suspending its’ current activities, saving its’ state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities. evive has 6 external interrupt pin:

  • 2 (interrupt 0)
  • 3 (interrupt 1)
  • 18 (interrupt 5)
  • 19 (interrupt 4)
  • 20 (interrupt 3)
  • 21 (interrupt 2)

These pins can be configured to trigger an interrupt on a low level, a rising or falling edge, or a change in level.


In Arduino IDE environment you can attach interrupts using attachInterrupt() function. There are two different ways you can initialize an interrupt pin:

attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
attachInterrupt(interrupt, ISR, mode);

where, interrupt is the number of the interrupt pin (from 0-5), pin is the pin number, ISR is the function that you call when interrupt occurs (these functions do not take parameters and returns nothing. This function is also referred to as an interrupt service routine), and mode defines how the interrupt occurs. There are several types of mode listed in the table below:

Trigger TypeTrigger Action
LOWTrigger the interrupt whenever the pin is low
CHANGETrigger the interrupt whenever the pin value changes
RISINGTrigger when the pin goes from low to high
FALLINGTrigger when the pin goes from high to low



To detach an interrupt, you have to u the e detachInterrupt() function in Arduino IDE platform. There are two different ways to do it: