Section 8.2 External Interrupts on the ATmega328P
Two external interrupts can be enabled to generate an interrupt request upon particular conditions on two different pins (
INT0 and INT1) on the ATmega328P. Each of the two interrupts can be independently enabled in the external interrupt mask register (EIMSK), and the specific trigger conditions are programmed in the external interrupt control register A (EICRA).
The trigger conditions that can be selected for the two external interrupts are on a
-
LOW signal,
-
toggle,
-
falling edge, or
-
rising edge.
The utility of these two interrupts is that each individual interrupt can be uniquely triggered and has its own corresponding ISR. This means that the exact status of the pin is known at the moment the ISR is invoked. However, these interrupts are only available on two of the approximately 20 I/O pins on the ATmega328P.
