DSPRelated.com
Forums

Data Acquisition using AD9954, DMA, and ways to optimize TMS320C6713 usage while data collection is in progress

Started by William C Bonner January 28, 2008
I am doing data acquisition on a system based around a 6713 dsp. Im
using a signal generator (Analog Devices AD9954) to generate a chirp
signal and an ADS8401 Analog-to-digital converter to capture the data.

Ive got the AD9954 (using Linear Sweep Mode) set with two directional
ramps, so I set a pin and it starts at the bottom frequency of the ramp
and goes to the top frequency in however long it takes, then holds at
the top, then I switch the pin logic and it starts at the top and goes
to the bottom.

Im using DMA to pull the output of the ADS8401 and put it into
consecutive spaces in an array.

Ive set up a DMA completion interrupt to signal me when the ramp has
completed, either going up or going down. This is based on the number of
data samples, so effectively a certain amount of time, and not really
when the ramp completes.

Im only paying attention to the data from the up direction ramp, and so
am only using the DMA on the down ramp to generate the transfer complete
interrupt.

The reason Im describing all of this is that my current routines gather
data from multiple ramps, and then do signal processing on the ramps,
including some form of averaging the data together. Its important that
the data be consistent from ramp to ramp and so Im currently looping on
a volatile Boolean value that gets set when the final ramp has
completed. I think means that the DSP is essentially not doing anything
for the time that Im gathering data. (while(SamplesCollected == false);)

When I tried to work so that the next set of ramp data was being
collected while I processed the previous set, the result that I saw on
an oscilloscope was sort of a stuttering set of ramps. I believe that
the stuttering was caused by interrupts not being able to be serviced
during some of the signal processing that I was doing.

What Im wondering is if theres a way I can program the DMA controller
to string together a series of ramps without having to service anything
in the main execution thread of the processor. Heres the bulk of my ISR
as it is.
static volatile bool SamplesCollected = false;
static volatile bool RampUp = true;
extern "C" {
interrupt void AquireData_isr(void)
{
if (RampUp == true)
{ // Start ramp down process
RampUp = false;
StartRampDown();
}
else
{
// see if we need to start a ramp up process
// increment to next buffer position
RampSample++;
if (RampSample < RampSamplesToCollect)
{
RampUp = true;
StartRampUp();
}
else
{
install_interrupt(CPU_INT8, NULL); // EDMA ready interrupt (DMA interrupt)
SamplesCollected = true;
SamplesCollecting = false;
}
}
}
}

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
William,

At 13:41 28.01.2008 -0800, William C Bonner wrote:
>When I tried to work so that the next set of ramp data was being
>collected while I processed the previous set, the result that I saw on
>an oscilloscope was sort of a stuttering set of ramps. I believe that
>the stuttering was caused by interrupts not being able to be serviced
>during some of the signal processing that I was doing.

This is quite likely on a C6x: most, if not all, of TI's optimized signal
processing functions from dsplib and imglib turn off interrupts during
execution. These functions make excessive use of software pipelining, and
any interrupt would mess-up the SW-pipeline.

Small looped calculations like average, RMS, etc. may disable interrupts
too: if optimized, the code often fits into the 5 delay slots of the loop's
branch instruction. Branch and its delay slots are not interuptable, hence
the entire loop will block interrupts.

You should use the -mi compiler switch (must iterate) to define a threshold
how many cycles the code is allowed to block interrupts. If using
dsplib/imglib functions try processing smaller sets of data to minimize the
blocking time.
>What I'm wondering is if there's a way I can program the DMA controller
>to string together a series of ramps without having to service anything
>in the main execution thread of the processor.

This depends on the size and arrangement of your data. It is possible to
perform automatic sorting using the IDX field, but the "jump width" is
limited to +/-32k Bytes. Chaining can be used to start another EDMA once
the current process is finished. Please look at the examples in spru234c.pdf

Best Regards,
Adolf Klemenz, D.SignT

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467