January 2019
Intermediate to advanced
458 pages
10h 35m
English
On a desktop PC or server the entire application binary would be loaded into RAM. On MCUs though it is common to leave as many of the program instructions in the ROM as possible until they are needed. This means that most of our application's instructions cannot be executed immediately, but first have to be fetched from ROM before the CPU of our MCU can fetch them via the instruction bus to be executed.
On the AVR, each possible interrupt is defined in a vector table, which is stored in ROM. This offers either default handlers for each interrupt type, or the user-defined version. To mark an interrupt routine, one either uses the __attribute__((signal)) attribute, or uses the ISR() macro:
#include <avr/interrupt.h> ...