Enabling Interrupts; Code Example - Freescale Semiconductor DSP56800E User Manual

Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

2.5.2.4

Enabling Interrupts

In addition to the interrupt controller peripheral described above, the 56800E core has its own
method how to enable and disable the interrupts of certain priority levels. So, regardless the
interrupt setting defined by macros in appconfig.h and initialization done by the INTC_INIT
command, there is another step to do to enable interrupt servicing in the application.
At the core level, the interrupts can be in four states:
All interrupts disabled (default state) - use archDisableInt() macro
All interrupts enabled - use archEnableInt() macro
Priority levels 1, 2 and 3 enabled, level 0 disabled - use archEnableIntLvl123() macro
Priority levels 2 and 3 enabled, levels 0 and 1 disabled - use archEnableIntLvl23() macro
2.5.3

Code Example

The following example shows the installation of the ISR into the interrupt vector table and shows
how to enable interrupts using the DSP56800E_Quick_Start tool.
The following example shows the installation of the external interrupt IRQA, the timer/counter
D2 interrupt and the PWM A reload interrupt. The example shows a part of the code, which must
be included in appconfig.h, all three ISRs and the initialization code. ISRs are declared as
#pragma interrupt to instruct the compiler to save/restore all used registers and to terminate the
ISRs with an RTI instruction. Inside the appconfig.h file, INT_VECTOR_ADDR_xx and
ITCN_INT_PRIORITY_xx define statements are used to install the ISR at the specified interrupt
vector and to define the interrupt priority level. The achEnableInt() macro and the ITCN driver
commands ITCN_INIT_GPRS and ITCN_INIT_IPR are used to enable interrupts.
Example 2-35. Installing ISRs and enabling interrupts
1) appconfig.h file
/*****************************************************************************
**
*
* Freescale Semiconductor Inc.
* (c) Copyright 2004 Freescale Semiconductor, Inc.
* (c) Copyright 2001-2004 Motorola, Inc.
* ALL RIGHTS RESERVED.
*
******************************************************************************
**
*
* File Name: appconfig.h
*
* Description: file for static configuration of the application
*
*
*****************************************************************************/
#ifndef __APPCONFIG_H
#define __APPCONFIG_H
FREESCALE SEMICONDUCTOR
(initial values, interrupt vectors)
Targeting 56F8xxx Platform
Boot Sequence
2-29

Advertisement

Table of Contents
loading

Table of Contents