AVR® External Interrupts

AVR® devices have external interrupts that can wake a device from sleep based on a rising or falling edge signal at an I/O pin or a change in digital voltage level at an I/O pin. The device can then process an application based on the interrupt source and then go back to sleep. The device has multiple interrupt pins for multiple interrupt sources.

External Interrupts

External interrupts are triggered by the INT pin or any of the PCINT pins. If enabled, the interrupts trigger even if the INT or PCINT pins are configured as outputs. This feature provides a way of generating a software interrupt. The external interrupts can be triggered by a falling or rising edge or a low level. This is set up by the External Interrupt Control Register A EICRA. When the external interrupts are enabled and are configured as level-triggered, the interrupts trigger as long as the pin is held low.

The External Interrupt Control Register EICR controls how the external interrupts operate.

extint.png

A low level interrupt on the INT pin is detected asynchronously. This implies that this interrupt can be used for waking the part also from sleep modes other than Idle mode. The I/O clock is halted in all sleep modes except Idle mode.

Pin Change Interrupt

The Pin Change Interrupt Request triggers if any enabled PCINT pin changes state. There are multiple pin change interrupts, all tied to a set of pins or port.
On an ATmega324PB device, for example, the Pin Change locations are:

  • Pin Change Interrupt Request 4 (PCI4) triggers upon changes to pins PCINT[38:32]
  • Pin Change Interrupt Request 3 (PCI3) triggers upon changes to pins PCINT[31:24]
  • Pin Change Interrupt Request 2 (PCI2) triggers upon changes to pins PCINT[23:16]
  • Pin Change Interrupt Request 1 (PCI1) triggers upon changes to pins PCINT[15:8]
  • Pin Change Interrupt Request 0 (PCI0) triggers upon changes to pins PCINT[7:0]

The PCMSK4, PCMSK3, PCMSK2, PCMSK1and PCMSK0 registers control which pins contribute to the pin change interrupts. Pin change interrupts on PCINT are detected asynchronously. This implies that these interrupts can also be used for waking the part
from sleep modes other than Idle mode.

Additional Information

© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.