Chapter 6

Interrupts

Abstract

Certain events generate interrupts, which ask the CPU to stop what it is doing, perform another task, and then return to its previous task. Interrupts play an important role in real-time control systems and embedded computing. This chapter describes the PIC32’s handling of interrupts, which can be generated by the CPU, peripherals, or sensor inputs. Concepts such as interrupt requests (IRQs), interrupt vectors, interrupt priorities, interrupt flags, and interrupt service routines (ISRs) are covered. The shadow register set is introduced as a way to eliminate the time needed for “context save and restore” when entering and exiting an interrupt. The chapter also details the steps to set up and enable an interrupt ...

Get Embedded Computing and Mechatronics with the PIC32 Microcontroller now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.