Overview of Interrupts
7-2
7.1
Overview of Interrupts
An interrupt is an event that stops the current process in the CPU so that the
CPU can attend to the task needing completion because of another event.
These events are external to the core CPU but may originate on-chip or off-
chip. Examples of on-chip interrupt sources include timers, serial ports, DMAs
and external memory stalls. Examples of off-chip interrupt sources include
analog-to-digital converters, host controllers and other peripheral devices.
Typically, DSPs compute different algorithms very quickly within an asynchro-
nous system environment. Asynchronous systems must be able to control the
DSP based on events outside of the DSP core. Because certain events can
have higher priority than algorithms already executing on the DSP, it is some-
times necessary to change, or interrupt, the task currently executing on the
DSP.
The ’C6000 provides hardware interrupts that allow this to occur automatically.
Once an interrupt is taken, an interrupt subroutine performs certain tasks or
actions, as required by the event. Servicing an interrupt involves switching
contexts while saving all state of the machine. Thus, upon return from the inter-
rupt, operation of the interrupted algorithm is resumed as if there had been no
interrupt. Saving state involves saving various registers upon entry to the inter-
rupt subroutine and then restoring them to their original state upon exit.
This chapter focuses on the software issues associated with interrupts. The
hardware description of interrupt operation is fully described in the
TMS320C6000 CPU and Instruction Set Reference Guide.
In order to understand the software issues of interrupts, we must talk about two
types of code: the code that is interrupted and the interrupt subroutine, which
performs the tasks required by the interrupt. The following sections provide in-
formation on:
-
Single and multiple assignment of registers
-
Loop interruptibility
-
How to use the ’C6000 code generation tools to satisfy different require-
ments
-
Interrupt subroutines