2.1.13. Interrupts

An interrupt is an external or internal event that requires the CPU to stop normal program execution and then execute a program code related to the event causing the interrupt. Interrupts can be generated internally (by some event inside the chip) or externally (by some external event). An example of an internal interrupt is a timer overflowing or the A/D completing a conversion. An example of an external interrupt is an I/O pin changing state.

Interrupts can be useful in many applications and some are as follows:

  • Time critical applications: Applications that require immediate attention of the CPU can use interrupts. For example, emergency events, such as power failure or fire in a plant, may require the CPU to shut down ...

Get SD Card Projects Using the PIC Microcontroller now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.