The normal execution of a program step follows a designated sequence of instructions. However,sometimes, this normal sequence of events must be interrupted to respond to high-priority faults and status both inside and outside the microcontroller. When these higher-priority events occur, the microcontroller must temporaily suspend normal operation and execute event specific actions called an interrupt service routine. Once the higher priority event has been serviced, the microcontroller returns and continues processing the normal program.
The ATmega16 is equipped with a complement of 21 interrupt sources. Three of the interrupt are provided for external interrupt sources, whereas the remaining 19 interrupts support the efficient operation of peripheral subsystems aboard the microcontroller. We discuss the operation,programming, and application of the interrupt system in Chapter 4 of the text.