SW500009 Microchip Technology, SW500009 Datasheet - Page 76

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
Interrupt Handling in C
rbit_n These psects are used to store all bit variables except those declared at absolute locations.
rbss_n These psects contain any uninitialized variables.
rdata_n These psects contain any initialised variables.
struct Contains any structure which is returned from a function.
temp Is used to store scratch variables used by the compiler. These include function return values
xtemp Is used to store scratch variables used by the compiler and to pass values to and from the
3.10 Interrupt Handling in C
The compiler incorporates features allowing interrupts to be handled from C code. Interrupt func-
tions are often called interrupt service routines (ISR). Interrupts are also known as exceptions.
3.10.1 Interrupt Functions
The function qualifier interrupt may be applied to any number of C function definitions to allow
them to be called directly from the hardware interrupts. The compiler will process the interrupt
function differently to any other functions, generating code to save and restore any registers used
and exit using the appropriate instruction.
ters. This is the only function prototype that makes sense for an interrupt function. interrupt
functions may not be called directly from C code (due to the different return instruction that is used),
but they may call other functions itself.
3.10.1.1 Midrange Interrupt Functions
An example of an interrupt function for a midrange PIC processor is shown here.
62
If the PICC option --STRICT is used, the interrupt keyword becomes __interrupt.
An interrupt function must be declared as type void interrupt and may not have parame-
larger than a char and values passed to and returned from library routines. If possible, this will
be positioned in the common area of the processor.
library routines.
int tick_count;
void interrupt tc_int(void)
{
if (T0IE && T0IF) {
T0IF=0;
C Language Features

Related parts for SW500009