SW500007 Microchip Technology, SW500007 Datasheet - Page 79

PICC-18 PRO

SW500007

Manufacturer Part Number
SW500007
Description
PICC-18 PRO
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500007

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015P
778-1002
778-1002
C Language Features
rbit This psect is used to store all bit variables. All bit objects are near by default and are placed
struct Contains any structure larger than 4 bytes in size which is returned from a function.
intsave_regs Holds the registers (including temporary locations) saved by the interrupt service rou-
temp Is used to store scratch variables used by the compiler. These include function return values
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. PIC18
devices have two separate interrupt vectors and a priority scheme to dictate how the interrupt code
is called.
3.10.1 Interrupt Functions
The function qualifier interrupt may be applied to at most two functions 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
retfie instruction instead of a retlw or return instructions at the end of the function.
ever this manual refers to the interrupt keyword, assume __interrupt if you are using --STRICT.)
priorities and are known as low-priority and high-priority interrupts. If the PIC18 is placed in com-
patibility mode, only one interrupt is available and this defaults to being the high-priority interrupt.
An interrupt function must be declared as type interrupt void and may not have parameters.
In addition, the keyword low_priority may be used to indicate that the interrupt function is to
be linked with the low-priority vector when not in compatibility mode. Interrupt functions may
not be called directly from C code, but they may call other functions themselves, subject to certain
limitations. Once defined, the interrupt function is linked to the corresponding interrupt vector.
(If the PICC18 option --STRICT is used, the interrupt keyword becomes __interrupt. Wher-
The PIC18 devices have two interrupts, each with their own vector location. These have different
An example of a high-priority (default) interrupt function is shown here.
in the access bank.
tine.
larger than a byte and values passed to and returned from library routines. This psect will be
positioned in the access bank.
volatile long tick_count;
void interrupt tc_int(void){
++tick_count;
Interrupt Handling in C
65

Related parts for SW500007