SW006012 Microchip Technology, SW006012 Datasheet - Page 99

C COMPILER FOR DSPIC30F FAMILY

SW006012

Manufacturer Part Number
SW006012
Description
C COMPILER FOR DSPIC30F FAMILY
Manufacturer
Microchip Technology
Type
MPLAB® C30 Compilerr
Series
PIC24 & DsPICr
Datasheets

Specifications of SW006012

Supported Families
PIC24, DsPIC30F And DsPIC33F
Core Architecture
PIC, DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Tool Type
Compiler
Processor Series
PIC24, dsPIC
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
dsPIC30F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
© 2007 Microchip Technology Inc.
When using the interrupt attribute, please specify either auto_psv or
no_auto_psv. If none is specified a warning will be produced and auto_psv will be
assumed.
7.3.3
The following prototype declares function isr0 to be an interrupt handler:
void
As this prototype indicates, interrupt functions must not take parameters nor may they
return a value. The compiler arranges for all working registers to be preserved, as well
as the Status register and the Repeat Count register, if necessary. Other variables may
be saved by naming them as parameters of the interrupt attribute. For example, to
have the compiler automatically save and restore the variables, var1 and var2, use
the following prototype:
void
isr0(void);
To request the compiler to use the fast context save (using the push.s and pop.s
instructions), tag the function with the shadow attribute (see
Section 2.3.2 “Specifying Attributes of Functions”). For example:
void
7.3.4
If an interrupt handler does not require any of the optional parameters of the interrupt
attribute, then a simplified syntax may be used. The following macros are defined in the
device-specific header files:
#define _ISR
#define _ISRFAST
For example, to declare an interrupt handler for the timer0 interrupt:
#include <p30fxxxx.h>
void _ISR _INT0Interrupt(void);
To declare an interrupt handler for the SPI1 interrupt with fast context save:
#include <p30fxxxx.h>
void _ISRFAST _SPI1Interrupt(void);
__
__
__
attribute
attribute
attribute
Coding ISR’s
Using Macros to Declare Simple ISRs
__
attribute
__
__
__
__
((
((
((
attribute
__
__
__
interrupt
interrupt
interrupt
__
((interrupt))
__
((interrupt, shadow))
__
__
__
)) isr0(void);
(
,
__
__
save
shadow
__
(var1,var2))))
__
)) isr0(void);
Interrupts
DS51284F-page 93

Related parts for SW006012