SW500007 Microchip Technology, SW500007 Datasheet - Page 81

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
will save further context if it is necessary and then jump to code directly related to the interrupt
function. The interrupt function code is also placed in a text psect.
for the BSR register. If fast interrupts are not used, BSR is saved to a location symbol called
saved_bsrh.
in a psect called intcodelo, which is directly linked to the low-priority interrupt vector. Operation
is then similar to the high-priority interrupt case, only with objects being saved offset to the symbol
saved_regsl and the BSR register saved to a location symbol called saved_bsrl.
3.10.3 Context Retrieval
Any objects saved by the compiler are automatically restored before the interrupt function returns.
The restoration code is placed into a text psect. The retfie instruction placed at the end of the
interrupt code will reload the program counter and the program will return to the location at which
it was when the interrupt occurred.
3.10.4 Interrupt Levels
Normally it is assumed by the compiler that any interrupt may occur at any time, and an error will
be issued by the linker if a function appears to be called by an interrupt function and by main-line
code, or another interrupt. Since it is often possible for the user to guarantee this will not happen for
a specific routine, the compiler supports an interrupt level feature to suppress the errors generated.
available, and any interrupt functions at the same level will be assumed by the compiler to be
mutually exclusive. This exclusion must be guaranteed by the user, i.e. the compiler is not able to
control interrupt priorities. Each interrupt function may be assigned a single level, either 0 or 1.
from main-line code may also use the #pragma interrupt_level directive to specify that they
will never be called by interrupts of one or more levels. This will prevent the linker from issuing an
error message because the function was included in more than one call graph. Note that it is entirely
up to the user to ensure that the function is not called by both main-line and interrupt code at the
same time. This will normally be ensured by disabling interrupts before calling the function. It is
not sufficient to disable interrupts inside the function after it has been called.
to only the immediately following function. Multiple #pragma interrupt_level directives may
precede a non-interrupt function to specify that it will be protected from multiple interrupt levels.
All objects saved are done so to locations at an offset to a symbol called saved_regsh, except
The low-priority interrupt function places the code to save the STATUS and PCLATH registers
This is achieved with the #pragma interrupt_level directive. There are two interrupt levels
In addition, any non-interrupt functions that are called from an interrupt function and also
An example of using the interrupt levels is given below. Note that the #pragma directive applies
/* non-interrupt function called by interrupt and main-line code */
Interrupt Handling in C
67

Related parts for SW500007