<< Chapter < Page | Chapter >> Page > |
As your spectrum analyzer works on a block of samples at a
time, you will need to use interrupts to pause your processingwhile samples are transferred from/to the CODEC (A/D and D/A)
buffer. Fortunately, the interrupt handling routines havebeen written for you in a C shell program available at
v:\ece320\54x\dspclib\lab4main.c
and the core
code.
Interrupts are an essential part of the operation of any microprocessor. They are particularly important in embeddedapplications where DSPs are often used. Hardware interrupts provide a way for interacting with external devices whilethe processor executes code. For example, in a key entry system, a key press would generate a hardware interrupt.The system code would then jump to a specified location in program memory where a routine could process the key input.Interrupts provide an alternative to polling. Instead of checking for key presses at a predetermined rate (requires aclock), the system could be busy executing other code. On the TI-C54x DSP, interrupts provide a convenient way totransfer blocks of data to/from the CODEC in a timely fashion.
The
lab4main.c
and the core code are intended
to make your interaction with the hardware much simpler. Atthe heart of this interaction is the auto-buffering serial
port. In the auto-buffering serial mode, the TI-C54xprocessor is able to do processing
uninterrupted while samples are
transferred to/from a buffer of length
samples. However, the spectrum analyzer to be
implemented in this lab works over a block of
samples. If it were possible to compute a
1024-point FFT in the sample time of one
BlockLen
, then no additional interrupt handling
routines would be necessary. Samples could be collected ina 1024-length buffer and a 1024-point FFT could be computed
uninterrupted while the auto-buffering buffer fills.Unfortunately, the DSP is not fast enough to accomplish this
task.
We now provide an explanation of the shell C program
lab4main.c
listed in
Appendix A . The
lab4main.c
file contains the function
interrupt void irq
and a main program. The
main program is an infinite loop over blocks of
samples. Note that while the DSP is executing
instructions in this loop, interrupts occur every
BlockLen
samples. Inside the infinite loop,
you will insert code to do the operations whichfollow. Although each of these operations may be performed
in C or assembly, we suggest you follow the guidelinessuggested.
Notification Switch
Would you like to follow the 'Ece 320 - spring 2003' conversation and receive update notifications?