SW500010 Microchip Technology, SW500010 Datasheet - Page 98

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
Interrupt Handling in C
parameters. 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 instruc-
tion that is used), but they may call other functions itself.
3.9.1.1 Midrange Interrupt Functions
An example of an interrupt function for a midrange PIC processor is shown here.
As there is a maximum of one interrupt vector in the midrange PIC series, only one interrupt
function may be defined. The interrupt vector will automatically be set to point to this function.
3.9.1.2 Context Saving on Interrupts
The PIC processor only saves the PC on its stack whenever an interrupt occurs. Other registers
and objects must be saved in software. The HI-TECH C PRO for the PIC10/12/16 MCU Family
compiler determines which registers and objects are used by an interrupt function and saves these
appropriately.
code in the same module, then any registers used by these functions will be saved as well.
in-line within the interrupt function for register usage. Thus, if you include in-line assembly code
into an interrupt function, you may have to add extra assembly code to save and restore any registers
or locations used. The same is true for any assembly routines called by the interrupt code.
3.9.1.3 Midrange Context Saving
The code associated with interrupt functions that do not require registers or objects is placed directly
at the interrupt vector in a psect called intcode.
98
An interrupt function must be declared as type void interrupt and may not have
If the interrupt routine calls other functions and these functions are defined before the interrupt
HI-TECH C PRO for the PIC10/12/16 MCU Family does not scan assembly code which is placed
int tick_count;
void interrupt tc_int(void)
{
}
if (T0IE && T0IF) {
}
T0IF=0;
++tick_count;
C Language Features

Related parts for SW500010