Configuring Interrupts; Installing Isrs; Assigning Interrupt Priority Levels - Freescale Semiconductor DSP56800E User Manual

Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

2.5.2

Configuring Interrupts

This section describes the configuration of interrupts using the DSP56800E_Quick_Start tool.
Interrupt configuration consists of installing the interrupt service routine (ISR) at the specified
interrupt vector, enabling the interrupt and setting the interrupt priority level.
2.5.2.1

Installing ISRs

The DSP56800E_Quick_Start tool supports static (compile-time) installation of the ISRs,
dynamic installation (run-time) is not supported. In general, static installation of ISRs requires
less program memory and has a lower (or even no) time overhead.
The static installation of ISRs consists of writing the address of the ISR to the interrupt vector
table for given interrupt source at compilation time. The interrupt vector table is located in the
vectors.c file. By default all interrupt vectors are initialized with the address of the
unhandled_interrupt() function in the vectors.c file, which contains the debughlt instruction and
provides an alarm to the user, that this interrupt was not installed but has occurred, which is very
useful when debugging. One exception to this is the Hardware Reset vector, which contains the
address of the startup code - Start() routine in the startup.c file.
To install a user's ISR at the xx
#define INT_VECTOR_ADDR_xx userISRname
The conditional compilation then forces the compiler to use the userISRname() ISR instead of the
default unhandled_interrupt() at the position of the xx
table. The userISRname is the placeholder for the name of interrupt service routine with prototype
of
void userISRroutine (void)
In your source code, you then put the following code:
#pragma interrupt
void userISRname(void)
{
/* ISR code */
}
The range of interrupt vectors which can be installed (xx) is 1 to 80. Vector 0 is the Hardware
Reset vector and always refers to the Start() code.
2.5.2.2

Assigning Interrupt Priority Levels

As described in Section 2.5.1.4 on page 2-26, each enabled interrupt can be assigned to one
interrupt priority level in range from 0 to 3.
There are some exceptions from this rule for the particular interrupt sources which has assigned a
fixed priority levels. Also, as there are only two bits (four combinations) to encode five different
states of the interrupt source (disabled, level 0,..., level 3) there is always one priority level, which
cannot be set for any interrupt.
The DSP56800E_Quick_Start tool hides these difficulties and implementation details described
above and simplifies the configuration of the interrupt priority levels to the maximal extent (while
keeping the generated code optimal).
FREESCALE SEMICONDUCTOR
th
interrupt vector add the following #define in appconfig.h:
Targeting 56F8xxx Platform
th
interrupt vector in the interrupt vector
Boot Sequence
2-27

Advertisement

Table of Contents
loading

Table of Contents