Interrupt Handling - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

6.5 Interrupt Handling

6.5.1
General Points About Interrupts
As long as you follow the guidelines in this section, you can interrupt and return
to C code without disrupting the C environment. When the C environment is
initialized, the startup routine does not enable or disable interrupts. Interrupts
are disabled if the system is initialized via a hardware reset. If your system
uses interrupts, you must handle any required enabling or masking of inter-
rupts. Such operations have no effect on the C environment and are easily
incorporated with asm statements or by callling an assembly language func-
tion.
An interrupt routine can perform any task performed by any other function,
-
including accessing global variables, allocating local variables, and calling
other functions.
When an interrupt routine is entered, the run-time-support function
-
I$$SAVE is called to save the complete context of the interrupted function.
All registers are saved. Upon return from the interrupt routine, the run-
time-support function I$$REST is called to restore the environment and
return to the interrupted function.
The name c_int0 is the C entry point; this name is reserved for the system
-
reset interrupt. This special interrupt routine initializes the system and
calls the function main. Because it has no caller, c_int0 does not save any
registers.
To associate an interrupt routine with an interrupt, a branch must be placed
-
in the appropriate interrupt vector. You can use the assembler and linker
to do this by creating a simple table of branch instructions with the .sect
assembler directive. For information on where the interrupt vector table is
located, consult the user's guide for the device you are targeting.
Interrupt Handling
Run-Time Environment
6-25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents