Embedded Computing and Mechatronics with the PIC32 Microcontroller
by Kevin Lynch, Nicholas Marchuk, Matthew Elwin
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access