DSPRelated.com
Forums

c6713-line out to line in-data seen in graph but not in values [2 Attachments]

Started by nikita iyer March 17, 2012
Hi all,
I'm using TMS 320C6713 DSP starter kit with ccs v3.1 and USB interface. I
am sending out data from line out and simultaneously reading in from line
in. I have been referring Ruplh Chassing's book so using functions like
input_left_sample() and using the polling method. my code looks something
like this

short m[30]; // array m has data to be sent
short f[300]; // array f is where rxd data is stored
int o=0;
for (i=0;i<16;i++)
{
output_left_sample(m[i]);
f[o++]=input_left_sample();
}

Some rather strange things are happening.
1. When I check the values (using the watch window) of f , the sent values
of anything close to it is not to be found at all. this can be seen in the
first image(valuesiteration2.bmp). But when I view the graph of f, I am
able to see the sent waveform(with values matching exactly). When I place
cursors on the waveform and change sampling freq to 48KHz(which is my fs)
the graph looks like the one in the second image (timeit2.bmp). it can be
seen that in the left image which is of m(sent data) waveform starts at
1.875e-4 which is (1/48000)*9 i.e 9th sample. the same start in the right
image which is of f is at 0.0064375 which is (1/48000)*309. Now my array f
only has 300 samples, how do i get the 309th value????
Do these values really exist or are fake?

I also experimented by increasing the array length of f to 1000 thinking
the delay must be of 300 samples but what happens is in the graph rxd
waveform starts at 1009 location. Same when length of f is changed to 40,
it starts at 49. Now this doesnt give a constant delay!!! Dont know why
this is happening.

2. Another strange thing that was happening was that I had forgotten to add
the line comm_poll() which led to the variable poll not being set to 1. but
for this condition, miraculously on some occasions the code worked fine and
in this case f values were exactly similar to m and at the same instance.

Any help, suggestions or corrections are most welcome. Need your help a bit
urgently. Sorry for the long post but I thought it would be better to
explain everything in detail beforehand.

Thanking you in advance
Nikita
Nikita-

One quick suggestion: avoid file I/O in CCS programs. Instead, place file data in memory before your program runs,
and read out after. Reserve sections of external mem for this.

File and console I/O must transit the JTAG interface, which is extremely slow on the DSK C6713 + CCS v3.1 combination.
Any JTAG based operations will interfere with real-time program results. It's obvious to see that happen with
breakpoints and single-step... less obvious with watch windows and file I/O.

-Jeff

> I'm using TMS 320C6713 DSP starter kit with ccs v3.1 and USB interface. I
> am sending out data from line out and simultaneously reading in from line
> in. I have been referring Ruplh Chassing's book so using functions like
> input_left_sample() and using the polling method. my code looks something
> like this
>
> short m[30]; // array m has data to be sent
> short f[300]; // array f is where rxd data is stored
> int o=0;
> for (i=0;i<16;i++)
> {
> output_left_sample(m[i]);
> f[o++]=input_left_sample();
> }
>
> Some rather strange things are happening.
> 1. When I check the values (using the watch window) of f , the sent values
> of anything close to it is not to be found at all. this can be seen in the
> first image(valuesiteration2.bmp). But when I view the graph of f, I am
> able to see the sent waveform(with values matching exactly). When I place
> cursors on the waveform and change sampling freq to 48KHz(which is my fs)
> the graph looks like the one in the second image (timeit2.bmp). it can be
> seen that in the left image which is of m(sent data) waveform starts at
> 1.875e-4 which is (1/48000)*9 i.e 9th sample. the same start in the right
> image which is of f is at 0.0064375 which is (1/48000)*309. Now my array f
> only has 300 samples, how do i get the 309th value????
> Do these values really exist or are fake?
>
> I also experimented by increasing the array length of f to 1000 thinking
> the delay must be of 300 samples but what happens is in the graph rxd
> waveform starts at 1009 location. Same when length of f is changed to 40,
> it starts at 49. Now this doesnt give a constant delay!!! Dont know why
> this is happening.
>
> 2. Another strange thing that was happening was that I had forgotten to add
> the line comm_poll() which led to the variable poll not being set to 1. but
> for this condition, miraculously on some occasions the code worked fine and
> in this case f values were exactly similar to m and at the same instance.
>
> Any help, suggestions or corrections are most welcome. Need your help a bit
> urgently. Sorry for the long post but I thought it would be better to
> explain everything in detail beforehand.
>
> Thanking you in advance
> Nikita
>

_____________________________________