Basic understanding of microcontroller interrupts
Earlier I’ve made a mistake by referring this tutorial to older AVR family microcontrollers like Atmega8/16/32/64/128. But AVR is being changed constantly with various new tweaks and updates like enhanced pin control or different register names. Since now tutorial will be based on Atmega328 microcontroller which is popular in Arduino boards. So you’ll be able to test all code examples on Arduino as it can serve as general purpose AVR test board with no problem.
Understanding Interrupts
Probably you won’t be able to find a microcontroller without interrupt capability. These are essential attributes of any modern microcontroller or processor. They may seem confusing and tricky at first glance, but during the time you will find out that normal MCU operation is impossible without interrupts.
Interrupts can be easily compared to real life events. Look around – all your activities are full of them. For instance you are reading this tutorial and find it interesting so you are all in it. But suddenly you cell phone rings. What you do? You remember last stroke you’ve red and answer the phone. Once phone conversation is over you get back to your reading as nothing happened. Well this is only one example of interrupt to give some visual clue what interrupts are. Read more »




