SW006012 Microchip Technology, SW006012 Datasheet - Page 109

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.
To field an interrupt, a function’s address must be placed at the appropriate address in
one of the vector tables, and the function must preserve any system resources that it
uses. It must return to the foreground task using a RETFIE processor instruction.
Interrupt functions may be written in C. When a C function is designated as an interrupt
handler, the compiler arranges to preserve all the system resources which the compiler
uses, and to return from the function using the appropriate instruction. The compiler
can optionally arrange for the interrupt vector table to be populated with the interrupt
function’s address.
To arrange for the compiler to fill in the interrupt vector to point to the interrupt function,
name the function as denoted in the preceding table. For example, the stack error
vector will automatically be filled if the following function is defined:
void
Note the use of the leading underscore. Similarly, the alternate stack error vector will
automatically be filled if the following function is defined:
void
Again, note the use of the leading underscore.
For all interrupt vectors without specific handlers, a default interrupt handler will be
installed. The default interrupt handler is supplied by the linker and simply resets the
device. An application may also provide a default interrupt handler by declaring an
interrupt function with the name _DefaultInterrupt.
The last nine interrupt vectors in each table do not have predefined hardware functions.
The vectors for these interrupts may be filled by using the names indicated in the
preceding table, or, names more appropriate to the application may be used, while still
filling the appropriate vector entry by using the irq or altirq parameter of the
interrupt attribute. For example, to specify that a function should use primary interrupt
vector fifty-two, use the following:
void
Similarly, to specify that a function should use alternate interrupt vector fifty-two, use
the following:
void
The irq/altirq number can be one of the interrupt request numbers 45 to 53. If the
irq parameter of the interrupt attribute is used, the compiler creates the external
symbol name __Interruptn, where n is the vector number. Therefore, the C
identifiers _Interrupt45 through _Interrupt53 are reserved by the compiler. In
the same way, if the altirq parameter of the interrupt attribute is used, the compiler
creates the external symbol name __AltInterruptn, where n is the vector number.
Therefore, the C identifiers _AltInterrupt45 through _AltInterrupt53 are
reserved by the compiler.
__
__
__
__
attribute
attribute
attribute
attribute
__
__
__
__
((
((
((
((
__
__
__
__
interrupt
interrupt
interrupt
interrupt
__
__
__
__
)) _StackError(void);
)) _AltStackError(void);
(
(
__
__
irq
altirq
__
(52)))) MyIRQ(void);
__
(52)))) MyAltIRQ(void);
Interrupts
DS51284F-page 103

Related parts for SW006012