Showing posts with label Pin Interrupt Library. Show all posts
Showing posts with label Pin Interrupt Library. Show all posts

Monday, October 23, 2023

Pin interrupt library for AVR microcontrollers

This library can help to easily configure a pin interrupt on AVR microcontrollers without the need to check the datasheet every time. At the moment only PCINT pins are supported.

Pin interrupt library for AVR devices

In this blog post, I will explain how to use interrupts on AVR microcontrollers. Interrupts are a powerful feature that allow the microcontroller to respond to external or internal events without constantly polling for them. Interrupts can improve the performance and efficiency of your code, as well as enable new functionalities.

What are interrupts?

An interrupt is a signal that causes the microcontroller to temporarily stop its current execution and jump to a special function called an interrupt service routine (ISR). The ISR performs the necessary actions to handle the interrupt, and then returns to the original program flow. The ISR can be triggered by various sources, such as:

  • External pins (EXTINT)
  • Pin changes (PCINT)
  • Timers/Counters (TIMER)
  • Serial communication (USART, SPI, TWI)
  • Analog-to-digital conversion (ADC)
  • Analog comparator (AC)
  • Watchdog timer (WDT)
  • EEPROM ready (EE READY)
  • Store program memory ready (SPM READY)