Skip to content

Instantly share code, notes, and snippets.

View dotchetter's full-sized avatar
🎯
Focusing

Simon Olofsson dotchetter

🎯
Focusing
  • Sweden
View GitHub Profile
@dotchetter
dotchetter / interrupts.md
Created October 27, 2020 15:08 — forked from fpigerre/interrupts.md
Timer/Counter and Interrupt cheat-sheets for the Atmel ATMega324A microcontroller

AVR Interrupts

Each of the pins on the AVR may have multiple functions. For example, pin D0 and D1 are able to serve as receive and transmit pins for serial port one, respectively. Similarly, a number of pins on the AVR are able to transmit interrupt requests to the CPU when they receive a particular signal. How to implement this functionality is shown below.

Register Summary

Register Name Purpose of Register
PCICR Pin Change Interrupt Control Register (Enable interrupts for a particular set of PCINT ports)
PCIFR Pin Change Interrupt Flag Register (When a logic change triggers an interrupt on a particular PCINT pin, the corresponding flag will be set)
PCMSK0 Pin Change Mask Register (Select whether interrupts are enabled on a particular PCINT pin)