English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (466/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
EXAMPLE 20-7: PMP MODULE INTERRUPT INITIALIZATION
/*
The following code example illustrates a PMP interrupt configuration.
When the PMP interrupt is generated, the CPU will branch to the vector
assigned to PMP interrupt.
*/
// Configure PMP for desired mode of operation
...
// Configure the PMP interrupts
IPC7SET = 0x0014;
// Set priority level=5
IPC7SET = 0x0003;
// Set subpriority level=3
// Could have also done this in single
// operation by assigning IPC7SET = 0x0017
IFS1CLR = 0x0002;
IEC1SET = 0x0002;
PMCONSET = 0x8000;
// Clear the PMP interrupt status flag
// Enable PMP interrupts
// Enable PMP module
EXAMPLE 20-8: PMP ISR
/*
The following code example demonstrates a simple interrupt
service routine for PMP interrupts. The user’s code at this
vector should perform any application specific operations and must
clear the PMP interrupt status flag before exiting.
*/
void __ISR(_PMP_VECTOR, ipl5) PMP_Interrupt_ISR(void)
{
... perform application specific operations in response to the interrupt
IFS1CLR = 0x00002;
}
// Be sure to clear the PMP interrupt status
// flag before exiting the service routine.
Note:
The PMP ISR code example shows
MPLAB® C32 C compiler-specific syntax.
Refer to your computer manual regarding
support for ISRs.
DS61143E-page 464
Preliminary
© 2008 Microchip Technology Inc.