Техническая Спецификация для Microchip Technology SW006023-2N

Скачать
Страница из 238
MPLAB
®
 XC32 C/C++ COMPILER
USER’S GUIDE
 2012 Microchip Technology Inc.
DS51686E-page 133
Chapter 11.  Interrupts
11.1
INTRODUCTION
Interrupt processing is an important aspect of most microcontroller applications. 
Interrupts may be used to synchronize software operations with events that occur in 
real time. When interrupts occur, the normal flow of software execution is suspended, 
and special functions are invoked to process the event. At the completion of interrupt 
processing, previous context information is restored and normal execution resumes.
PIC32MX devices support multiple interrupts, from both internal and external sources. 
The devices allow high-priority interrupts to override any lower priority interrupts that 
may be in progress.
The compiler provides full support for interrupt processing in C/C++ or inline assembly 
code. This chapter presents an overview of interrupt processing.
• Latency
11.2
INTERRUPT OPERATION
The compiler incorporates features allowing interrupts to be fully handled from C/C++ 
code. Interrupt functions are often called interrupt handlers or Interrupt Service Rou-
tines
 (ISRs). 
Each interrupt source typically has a control bit in an SFR which can disable that inter-
rupt source. Check your device data sheet for full information how your device handles 
interrupts.
Interrupt code is the name given to any code that executes as a result of an interrupt 
occurring. Interrupt code completes at the point where the corresponding return from 
interrupt instruction is executed. This contrasts with main-line code, which, for a free-
standing application, is usually the main part of the program that executes after reset.