SW006015 Microchip Technology, SW006015 Datasheet - Page 53

C COMPILER MPLAB C32

SW006015

Manufacturer Part Number
SW006015
Description
C COMPILER MPLAB C32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheets

Specifications of SW006015

Supported Families
PIC32MX5, MX6, And MX7
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC32 MCUs
Tool Function
Compiler
Supported Devices
PIC32 MCUs
Tool Type
Compiler
Processor Series
PIC32
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
3.5
© 2007 Microchip Technology Inc.
EXCEPTION HANDLERS
3.4.2
The vector pragma creates one or more dispatch functions targeting the indicated
function. For target functions specified with the interrupt pragma, this functions as
if the vector clause had been used. The target function of a vector pragma can be
any function, including external functions implemented in assembly or by other means.
# pragma vector function-name vector vector-number [,
vector-number-list]
The following pragma defines a dispatch function targeting foo at exception vector
address 54.
#pragma vector foo 54
3.4.3
A handler function can be associated with one or more exception vector addresses via
an attribute. The at_vector attribute indicates that the handler function should itself
be placed at the exception vector address. The vector attribute indicates that a
dispatch function should be created at the exception vector address(es).
For example, the following declaration specifies that function foo will be created as an
interrupt handler function of priority four. foo will be located at the address of exception
vector 54.
void __attribute__ ((interrupt(ipl4))) __attribute__ ((at_vector(54)))
foo (void)
The following declaration specifies that function foo will be created as an interrupt
handler function of priority four. Define dispatch functions targeting foo at exception
vector addresses 52 and 53.
void __attribute__ ((interrupt(ipl4))) __attribute__ ((vector(53,
52))) foo (void)
The PIC32MX devices also have two exception vectors for non-interrupt exceptions.
These exceptions are grouped into bootstrap exceptions and general exceptions.
3.5.1
A reset exception is any exception which occurs while bootstrap code is running
(Status
At this location the MPLAB C32 toolchain places a branch instruction targeting a
function named _bootstrap_exception_handler(). In the standard library, a
default weak version of this function is provided which merely goes into an infinite loop.
If the user application provides an implementation of
_bootstrap_exception_handler(), that implementation will be used instead.
3.5.2
A general exception is any non-interrupt exception which occurs during program
execution outside of bootstrap code (Status
to offset 0x180 from EBase.
At this location the MPLAB C32 toolchain places a branch instruction targeting a
function named _general_exception_context(). The provided implementation
of this function saves context, calls an application handler function, restores context
and performs a return from exception instruction. The context saved is the hi and lo
registers and all general purpose registers except s0-s8, which are defined to be
preserved by all called functions and so are not necessary to actively save again here.
BEV
Vector Pragma
Vector Attribute
Bootstrap Exception
General Exception
=1). All reset exceptions are vectored to 0xBFC00380.
BEV
=0). General exceptions are vectored
DS51686A-page 49

Related parts for SW006015