DSPRelated.com
Forums

DSP 6416

Started by Ceausu Adrian May 12, 2011
Hello,
I have a DSP 6416T and i'm using it for calculating the effective value
of a sine wave.I've made the default settings in registers, 0x0017 for
input and 0x01f9 for output, and when i generate (with a signal
generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its
only 0.8Vp-p.
Does anyone knows why ? Thank you.
Ceausu Adrian,

On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
> Hello,
>
> I have a DSP 6416T and i'm using it for calculating the effective
> value of a sine wave.
> I've made the default settings in registers, 0x0017 for input and
> 0x01f9 for output, and when i generate (with a signal generator) a
> sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p.
>
> Does anyone knows why ?

a. the impedance of the load is incorrect for the signal generator
or
b. the signal generator is broken or incorrectly set up
or
c. the scope or probe is broken, out of calibration, or incorrectly set up
mikedunn
> Thank you.
>
I connected the signal from signal generator to the oscilloscope and its a sine wave with 2Vp-p amplitude. The signal generator has 2 output impedances (50ohm and 600ohm) and the result its the same. 
________________________________
From: mikedunn
To: Ceausu Adrian
Cc: c...
Sent: Thursday, May 12, 2011 7:42 PM
Subject: Re: [c6x] DSP 6416
Ceausu Adrian,

On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
 
>Hello,
>I have a DSP 6416T and i'm using it for calculating the effective value of a sine wave.
>I've made the default settings in registers, 0x0017 for input and 0x01f9 for output, and when i generate (with a signal generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p. 
>Does anyone knows why ?

a. the impedance of the load is incorrect for the signal generator
or
b. the signal generator is broken or incorrectly set up
or
c. the scope or probe is broken, out of calibration, or incorrectly
set up
mikedunn
Thank you. 
>
Ceausu Adrian,

It sounds like the scope or signal generator.
1. connect directly to your scope with a coax cable. ok?? [you may be
doing this already]
2. connect the scope to a 3.3vdc power supply. 3.3vdc?? verify with meter.

Also, what is the frequency of the sine wave?? khz??

mikedunn

On 5/12/2011 2:01 PM, Adi aditza wrote:
> I connected the signal from signal generator to the oscilloscope and
> its a sine wave with 2Vp-p amplitude. The signal generator has 2
> output impedances (50ohm and 600ohm) and the result its the same.
>
>
> *From:* mikedunn
> *To:* Ceausu Adrian
> *Cc:* c...
> *Sent:* Thursday, May 12, 2011 7:42 PM
> *Subject:* Re: [c6x] DSP 6416
>
> Ceausu Adrian,
>
> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
>> Hello,
>>
>> I have a DSP 6416T and i'm using it for calculating the effective
>> value of a sine wave.
>> I've made the default settings in registers, 0x0017 for input and
>> 0x01f9 for output, and when i generate (with a signal generator) a
>> sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p.
>>
>> Does anyone knows why ?
>
> a. the impedance of the load is incorrect for the signal generator
> or
> b. the signal generator is broken or incorrectly set up
> or
> c. the scope or probe is broken, out of calibration, or incorrectly set up
> mikedunn
>> Thank you.
>>
Adi-

> I connected the signal from signal generator to the
> oscilloscope and its a sine wave with 2Vp-p amplitude.

Is that not what you expect? Can you vary the level using the amplitude control on the signal generator?

> generator has 2 output impedances (50ohm and 600ohm)
> and the result its the same.

Scope inputs are high impedance, so it won't matter what is the signal generator output impedance -- both selections
should look the same.

> I have a DSP 6416T and i'm using it for calculating
> the effective value of a sine wave.

Can you clarify your setup? If the signal generator is producing the sine wave and the scope is measuring it, then
what is the DSP doing? And what type of board do you have? DSK 6416? Something else?

-Jeff

> ________________________________
> From: mikedunn
> To: Ceausu Adrian
> Cc: c...
> Sent: Thursday, May 12, 2011 7:42 PM
> Subject: Re: [c6x] DSP 6416
> Ceausu Adrian,
>
> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
>  
>>Hello,
>>I have a DSP 6416T and i'm using it for calculating the effective value of a sine wave.
>>I've made the default settings in registers, 0x0017 for input and 0x01f9 for output, and when i generate (with a
>> signal generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p. 
>>Does anyone knows why ?
>
> a. the impedance of the load is incorrect for the signal generator
> or
> b. the signal generator is broken or incorrectly set up
> or
> c. the scope or probe is broken, out of calibration, or incorrectly
> set up
> mikedunn
> Thank you. 
>>

_____________________________________
Let me start again with the problem.

Here is the code im using:

#include "dsk6416_aic23.h" //codec-DSK support file
Uint32 fs=DSK6416_AIC23_FREQ_48KHZ; //set sampling rate
interrupt void c_int11() //interrupt service routine
{
short sample_data;
sample_data = input_sample(); //input data
output_sample(sample_data); //output data
return;
}
void main()
{
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop
}

I generate a signal with 2Vp-p amplitude and 1kHz frequency with a signal generator and connect it to Line IN. After i run the code, the signal from Line OUT shown on oscilloscope is a sine wave with 0.8Vp-p and 1kHz. If i vary the frequency and amplitude at input, it varies at output (frequency at output is the same as input only the amplitude is attentuated at output).

The cables im working with are coaxial with BNC plug at one end and audio jack (3.5mm) at the other end, and another coaxial has BNC plugs at both ends.
The signal generator and oscilloscope are connected to 230VAC.

The board im using is TMS320C6416T. If you need the other files im using let me know. They are:C6416dskinit.c,C6416dsk.cmd,Vectors_intr.asm,c6416dskinit.h,dsk6416_aic23.h.
________________________________
From: Jeff Brower
To: Adi Aditza
Cc: c...
Sent: Thursday, May 12, 2011 10:40 PM
Subject: Re: [c6x] DSP 6416

Adi-

> I connected the signal from signal generator to the
> oscilloscope and its a sine wave with 2Vp-p amplitude.

Is that not what you expect? Can you vary the level using the amplitude control on the signal generator?

> generator has 2 output impedances (50ohm and 600ohm)
> and the result its the same.

Scope inputs are high impedance, so it won't matter what is the signal generator output impedance -- both selections
should look the same.

> I have a DSP 6416T and i'm using it for calculating
> the effective value of a sine wave.

Can you clarify your setup? If the signal generator is producing the sine wave and the scope is measuring it, then
what is the DSP doing? And what type of board do you have? DSK 6416? Something else?

-Jeff

> ________________________________
> From: mikedunn
> To: Ceausu Adrian
> Cc: c...
> Sent: Thursday, May 12, 2011 7:42 PM
> Subject: Re: [c6x] DSP 6416
> Ceausu Adrian,
>
> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
>  
>>Hello,
>>I have a DSP 6416T and i'm using it for calculating the effective value of a sine wave.
>>I've made the default settings in registers, 0x0017 for input and 0x01f9 for output, and when i generate (with a
>> signal generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p. 
>>Does anyone knows why ?
>
> a. the impedance of the load is incorrect for the signal generator
> or
> b. the signal generator is broken or incorrectly set up
> or
> c. the scope or probe is broken, out of calibration, or incorrectly
> set up
> mikedunn
> Thank you. 
>>
Adi,

Now we are getting somewhere - it looks like we are getting to the real
question.

-->Everyone who asks for help,
When you are describing a problem by telephone or email, visualize that
you are communicating with a blind person who is familiar with
electronic components, but has no idea how they are connected. You need
to "paint a picture in the person's mind".
I have included 6 step sample template of how one might begin to do that.
---------------------
example:
1. My Project Description:
I am using a 6416 DSK to read a sine wave from a signal generator. The
sine wave is sampled on line in. My program then outputs the sine wave
on line out.
2. What is working:
My program is sampling the sine wave and successfully outputting a sine
wave on line out.
3. What is not working:
"I generate a signal with 2Vp-p amplitude and 1kHz frequency with a
signal generator and connect it to Line IN. After i run the code, the
signal from Line OUT shown on oscilloscope is a sine wave with 0.8Vp-p
and 1kHz. If i vary the frequency and amplitude at input, it varies at
output (frequency at output is the same as input only the amplitude is
attentuated at output)."
I expect the output amplitude to vary like the frequency does.
4. What I have done/steps that I have taken:
I do not know where to start.
5. Test cases or sample code:
[NOTE: This should be a small piece of code. If you have an application
that is hanging/crashing/misbehaving, make a copy an edit it down to the
smallest amount of code that will show the problem. The more lines of
code that you provide, the less likely that someone will volunteer their
own time to examine it in detail.]
6. Additional information that might help:
none
----------------------------
Now back to Adi's problem.

On 5/13/2011 10:11 AM, Adi aditza wrote:
> Let me start again with the problem.
>

As a learning exercise, I suggest modifying your code for polling. See
how it works - set a breakpoint at the end of a buffer read and verify
that you get different values for different voltages. Once you are
confident it is working, focus on the output.
Once you get it working in polling mode, then enable the interrupt.

mikedunn
> Here is the code im using:
>
> #include "dsk6416_aic23.h" //codec-DSK support file
> Uint32 fs=DSK6416_AIC23_FREQ_48KHZ; //set sampling rate
> interrupt void c_int11() //interrupt service routine
> {
> short sample_data;
> sample_data = input_sample(); //input data
> output_sample(sample_data); //output data
> return;
> }
> void main()
> {
> comm_intr(); //init DSK, codec, McBSP
> while(1); //infinite loop
> }
>
> I generate a signal with 2Vp-p amplitude and 1kHz frequency with a
> signal generator and connect it to Line IN. After i run the code, the
> signal from Line OUT shown on oscilloscope is a sine wave with
> 0.8Vp-p and 1kHz. If i vary the frequency and amplitude at input, it
> varies at output (frequency at output is the same as input only the
> amplitude is attentuated at output).
>
> The cables im working with are coaxial with BNC plug at one end and
> audio jack (3.5mm) at the other end, and another coaxial has BNC plugs
> at both ends.
> The signal generator and oscilloscope are connected to 230VAC.
> The board im using is TMS320C6416T. If you need the other files im
> using let me know. They are:
> /C6416dskinit.c, C6416dsk.cmd, Vectors_intr.asm, c6416dskinit.h, dsk6416_aic23.h./
>
>
> *From:* Jeff Brower
> *To:* Adi Aditza
> *Cc:* c...
> *Sent:* Thursday, May 12, 2011 10:40 PM
> *Subject:* Re: [c6x] DSP 6416
>
> Adi-
>
> > I connected the signal from signal generator to the
> > oscilloscope and its a sine wave with 2Vp-p amplitude.
>
> Is that not what you expect? Can you vary the level using the
> amplitude control on the signal generator?
>
> > generator has 2 output impedances (50ohm and 600ohm)
> > and the result its the same.
>
> Scope inputs are high impedance, so it won't matter what is the signal
> generator output impedance -- both selections
> should look the same.
>
> > I have a DSP 6416T and i'm using it for calculating
> > the effective value of a sine wave.
>
> Can you clarify your setup? If the signal generator is producing the
> sine wave and the scope is measuring it, then
> what is the DSP doing? And what type of board do you have? DSK
> 6416? Something else?
>
> -Jeff
>
> > ________________________________
> > From: mikedunn > >
> > To: Ceausu Adrian >
> > Cc: c...
> > Sent: Thursday, May 12, 2011 7:42 PM
> > Subject: Re: [c6x] DSP 6416
> >
> >
> > Ceausu Adrian,
> >
> > On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
> > br /> > >>Hello,
> >>
> >>
> >>I have a DSP 6416T and i'm using it for calculating the effective
> value of a sine wave.
> >>I've made the default settings in registers, 0x0017 for input and
> 0x01f9 for output, and when i generate (with a
> >> signal generator) a sine wave with 2Vp-p amplitude, on the
> oscilloscope its only 0.8Vp-p.br /> > >>
> >>
> >>Does anyone knows why ?
> >
> > a. the impedance of the load is incorrect for the signal generator
> > or
> > b. the signal generator is broken or incorrectly set up
> > or
> > c. the scope or probe is broken, out of calibration, or incorrectly
> > set up
> >
> >
> > mikedunn
> > Thank you.br /> > >
Adi-

> Let me start again with the problem.
>
> Here is the code im using:
>
> #include "dsk6416_aic23.h" //codec-DSK support file
> Uint32 fs=DSK6416_AIC23_FREQ_48KHZ; //set sampling rate
> interrupt void c_int11() //interrupt service routine
> {
> short sample_data;
> sample_data = input_sample(); //input data
> output_sample(sample_data); //output data
> return;
> }
> void main()
> {
> comm_intr(); //init DSK, codec, McBSP
> while(1); //infinite loop
> }
>
> I generate a signal with 2Vp-p amplitude and 1kHz frequency
> with a signal generator and connect it to Line IN. After i
> run the code, the signal from Line OUT shown on oscilloscope
> is a sine wave with 0.8Vp-p and 1kHz. If i vary the
> frequency and amplitude at input, it varies at output
> (frequency at output is the same as input only the amplitude
> is attentuated at output).
>
> The cables im working with are coaxial with BNC plug at one
> end and audio jack (3.5mm) at the other end, and another
> coaxial has BNC plugs at both ends.
> The signal generator and oscilloscope are connected to
> 230VAC.
>
> The board im using is TMS320C6416T. If you need the other
> files im using let me know. They
> are:C6416dskinit.c,C6416dsk.cmd,Vectors_intr.asm,
>c6416dskinit.h,dsk6416_aic23.h.

It could be the DSK board has different gain settings for input vs. output. In your first post you mentioned some
register values -- what are those? AIC23 registers? If so which ones? Do you have input and output gain (or
attenuation) set as matching?

Also, try doing the following in your ISR:

static unsigned short int i = 0;
static short int posmax =0;
static short int negmax = 0;

sample_data = input_sample(); //input data
if (sample_data > posmax) posmax = sample_data;
if (sample_data < negmax) negmax = sample_data;
sample_data = (short int)i++;
output_sample(sample_data); //output data

This will cause output ranging from 0 to 65535; i.e. maximum possible range. What's the max Vpp you see on the scope?
If your max scope Vpp is still 0.8, then clearly something in hardware is restricting your output amplitude level.

And you can look at posmax and negmax values after you pause the code. First they should be symmetric, if not then
you don't have the signal generator hooked up correctly. Second from what I recall with the DSK boards and AIC23
codecs, you should be able to give +/- 2V input to the boards, maybe a bit higher. So in your case posmax should be
around 15,000.

-Jeff

> ________________________________
> From: Jeff Brower
> To: Adi Aditza
> Cc: c...
> Sent: Thursday, May 12, 2011 10:40 PM
> Subject: Re: [c6x] DSP 6416
>
> Adi-
>
>> I connected the signal from signal generator to the
>> oscilloscope and its a sine wave with 2Vp-p amplitude.
>
> Is that not what you expect? Can you vary the level using the amplitude control on the signal generator?
>
>> generator has 2 output impedances (50ohm and 600ohm)
>> and the result its the same.
>
> Scope inputs are high impedance, so it won't matter what is the signal generator output impedance -- both selections
> should look the same.
>
>> I have a DSP 6416T and i'm using it for calculating
>> the effective value of a sine wave.
>
> Can you clarify your setup? If the signal generator is producing the sine wave and the scope is measuring it, then
> what is the DSP doing? And what type of board do you have? DSK 6416? Something else?
>
> -Jeff
>
>> ________________________________
>> From: mikedunn
>> To: Ceausu Adrian
>> Cc: c...
>> Sent: Thursday, May 12, 2011 7:42 PM
>> Subject: Re: [c6x] DSP 6416
>> Ceausu Adrian,
>>
>> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
>>  
>>>Hello,
>>>
>>>
>>>I have a DSP 6416T and i'm using it for calculating the effective value of a sine wave.
>>>I've made the default settings in registers, 0x0017 for input and 0x01f9 for output, and when i generate (with a
>>> signal generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p. 
>>>
>>>
>>>Does anyone knows why ?
>>
>> a. the impedance of the load is incorrect for the signal generator
>> or
>> b. the signal generator is broken or incorrectly set up
>> or
>> c. the scope or probe is broken, out of calibration, or incorrectly
>> set up
>> mikedunn
>> Thank you. 
>>>

_____________________________________
Adi-

You're worried about too many things -- it takes too much time to read your post and try to follow along.

The art of debug requires you to simplify and divide the problem, and check basic things one at a time. Start by
separating input from output and checking your output levels, by generating output signals in software.

I explained how to do this in my previous post. I can't help you any further unless you do those specific
experiments. What results do you get?

-Jeff

> I've been doing some research on the board and found out this in Rulph Chassaing book: "The maximum allowable input
> signal level at the LINE IN inputs to the codec is
> 1 V rms. However, the C6713 and C6416 DSKs contain a potential divider circuit with a gain of 0.5 between their LINE
> IN sockets and the codec itself with the effect
> that the maximum allowable input signal level at the LINE IN sockets on the DSKs is 2 V rms. Above this level, input
> signals will be distorted. Input and output sockets
> on the DSKs are ac coupled to the codec." 
>
> I used this code from the book: 
>
> //loop_poll.c loop program using polling
> #include "DSK6416_AIC23.h" //codec support
> Uint32 fs=DSK6416_AIC23_FREQ_8KHZ; //set sampling rate
>
> void main()
> {
> short sample_data;
> comm_poll(); //init DSK, codec, McBSP
> while(1) //infinite loop
> {
> sample_data = input_left_sample(); //input sample
> output_left_sample(sample_data); //output sample
> }
> }
>
> From the book again: "Input a sinusoidal waveform to the LINE IN connector on the DSK, with an amplitude of
> approximately 2.0 V p - p and a frequency of approximately 1 kHz. Connect
> the output of the DSK, LINE OUT, to an oscilloscope, and verify the presence of a tone of the same frequency, but
> attenuated to approximately 1.0 V p - p. This attenuation
> is due to the potential divider network, comprising two resistors, on the DSK circuit board between the LINE IN
> socket and the codec input."
>
> Done that but with different results, at LINE OUT the signal had same frequency and amplitude of 0.4Vp-p. The AIC23
> codec had this values in registers: 
>
> DSK6416_AIC23_Config config = { 
> 0x0017, /* Set-Up Reg 0 Left line in volume control */
> 0x0017, /* Set-Up Reg 1 Right line in volume control */ 
> 0x01f9, /* Set-Up Reg 2 Left channel headphone volume */ 
> 0x01f9, /* Set-Up Reg 3 Right channel headphone volume */ 
> 0x0011, /* Set-Up Reg 4 Analog audio path control */ 
> 0x0000, /* Set-Up Reg 5 Digital audio path control */ 
> 0x0000, /* Set-Up Reg 6 Power down control */ 
> 0x0043, /* Set-Up Reg 7 Digital audio interface format */ 
> 0x0081, /* Set-Up Reg 8 Sample rate control */ 
> 0x0001 /* Set-Up Reg 9 Digital interface activation */ 
> };
>
> After this i tested the board for different amplitudes and got this results:
>
> input =1.5Vp-poutput=0.3Vp-p
> input=2Vp-poutput=0.4Vp-p
> input=3Vp-poutput=0.6Vp-p
> input=4Vp-poutput=0.76Vp-p    
> input=5Vp-poutput=1Vp-p
> Looks like the output=0.2*input. How is it possible ?????
> ________________________________
> From: Jeff Brower
> To: c...
> Cc: Adi Aditza
> Sent: Friday, May 13, 2011 11:43 PM
> Subject: Re: [c6x] DSP 6416
>  
> Adi-
>
>> Let me start again with the problem.
>>
>> Here is the code im using: 
>>
>> #include "dsk6416_aic23.h" //codec-DSK support file
>> Uint32 fs=DSK6416_AIC23_FREQ_48KHZ; //set sampling rate
>> interrupt void c_int11() //interrupt service routine
>> {
>> short sample_data;
>> sample_data = input_sample(); //input data
>> output_sample(sample_data); //output data
>> return;
>> }
>> void main()
>> {
>> comm_intr(); //init DSK, codec, McBSP
>> while(1); //infinite loop
>> }
>>
>> I generate a signal with 2Vp-p amplitude and 1kHz frequency
>> with a signal generator and connect it to Line IN. After i
>> run the code, the signal from Line OUT shown on oscilloscope
>> is  a sine wave with 0.8Vp-p and 1kHz. If i vary the
>> frequency and amplitude at input, it varies at output
>> (frequency at output is the same as input only the amplitude
>> is attentuated at output). 
>>
>> The cables im working with are coaxial with BNC plug at one
>> end and audio jack (3.5mm) at the other end, and another
>> coaxial has BNC plugs at both ends. 
>> The signal generator and oscilloscope are connected to
>> 230VAC.
>>
>> The board im using is TMS320C6416T. If you need the other
>> files im using let me know. They
>> are: C6416dskinit.c, C6416dsk.cmd, Vectors_intr.asm,
>> c6416dskinit.h, dsk6416_aic23.h.
>
> It could be the DSK board has different gain settings for input vs. output. In your first post you mentioned some
> register values -- what are those? AIC23 registers? If so which ones? Do you have input and output gain (or
> attenuation) set as matching?
>
> Also, try doing the following in your ISR:
>
> static unsigned short int i = 0;
> static short int posmax =0;
> static short int negmax = 0;
>
> sample_data = input_sample(); //input data
> if (sample_data > posmax) posmax = sample_data;
> if (sample_data < negmax) negmax = sample_data;
> sample_data = (short int)i++;
> output_sample(sample_data); //output data
>
> This will cause output ranging from 0 to 65535; i.e. maximum possible range. What's the max Vpp you see on the scope?
> If your max scope Vpp is still 0.8, then clearly something in hardware is restricting your output amplitude level.
>
> And you can look at posmax and negmax values after you pause the code. First they should be symmetric, if not then
> you don't have the signal generator hooked up correctly. Second from what I recall with the DSK boards and AIC23
> codecs, you should be able to give +/- 2V input to the boards, maybe a bit higher. So in your case posmax should be
> around 15,000.
>
> -Jeff
>
>> ________________________________
>> From: Jeff Brower
>> To: Adi Aditza
>> Cc: c...
>> Sent: Thursday, May 12, 2011 10:40 PM
>> Subject: Re: [c6x] DSP 6416
>>
>> Adi-
>>
>>> I connected the signal from signal generator to the
>>> oscilloscope and its a sine wave with 2Vp-p amplitude.
>>
>> Is that not what you expect?  Can you vary the level using the amplitude control on the signal generator?
>>
>>> generator has 2 output impedances (50ohm and 600ohm)
>>> and the result its the same.
>>
>> Scope inputs are high impedance, so it won't matter what is the signal generator output impedance -- both selections
>> should look the same.
>>
>>> I have a DSP 6416T and i'm using it for calculating
>>> the effective value of a sine wave.
>>
>> Can you clarify your setup?  If the signal generator is producing the sine wave and the scope is measuring it, then
>> what is the DSP doing?  And what type of board do you have?  DSK 6416?  Something else?
>>
>> -Jeff
>>
>>> ________________________________
>>> From: mikedunn
>>> To: Ceausu Adrian
>>> Cc: c...
>>> Sent: Thursday, May 12, 2011 7:42 PM
>>> Subject: Re: [c6x] DSP 6416
>>>
>>>
>>> Ceausu Adrian,
>>>
>>> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
>>>  
>>>>Hello,
>>>>
>>>>
>>>>I have a DSP 6416T and i'm using it for calculating the effective value of a sine wave.
>>>>I've made the default settings in registers, 0x0017 for input and 0x01f9 for output, and when i generate (with a
>>>> signal generator) a sine wave with 2Vp-p amplitude, on the oscilloscope its only 0.8Vp-p. 
>>>>
>>>>
>>>>Does anyone knows why ?
>>>
>>> a. the impedance of the load is incorrect for the signal generator
>>> or
>>> b. the signal generator is broken or incorrectly set up
>>> or
>>> c. the scope or probe is broken, out of calibration, or incorrectly
>>>    set up
>>>
>>>
>>> mikedunn
>>> Thank you. 

_____________________________________
Adi,

Slow down and think. You have characterized your problem - that is good.
BTW, I am not familiar with the analog circuitry but I would never apply
more than 2v to line in.

Now that your problem is characterized, you know that you have two
"boxes" [input & output] that could be "broken". Like Jeff has advised,
you need to verify the correct or incorrect behavior of the "boxes".

Some ideas to for troubleshooting...
1. Follow Jeff's suggestions.
2. You could also hack your code to output a value, delay, output a
second value, delay in an infinite loop to create a square wave.
Check measured values vs. expected values.
3. One disadvantage in your setup is that it is unbuffered. You may want
to consider capturing enough input samples for a couple of cycles and
analyzing the values.

As for "how is it possible?" - the answer is usually very clear after
methodical troubleshooting.

mikedunn

On 5/18/2011 1:22 PM, Jeff Brower wrote:
>
> Adi-
>
> You're worried about too many things -- it takes too much time to read
> your post and try to follow along.
>
> The art of debug requires you to simplify and divide the problem, and
> check basic things one at a time. Start by
> separating input from output and checking your output levels, by
> generating output signals in software.
>
> I explained how to do this in my previous post. I can't help you any
> further unless you do those specific
> experiments. What results do you get?
>
> -Jeff
>
> > I've been doing some research on the board and found out this in
> Rulph Chassaing book: "The maximum allowable input
> > signal level at the LINE IN inputs to the codec is
> > 1 V rms. However, the C6713 and C6416 DSKs contain a potential
> divider circuitwith a gain of 0.5 between their LINE
> > IN sockets and the codec itself with the effect
> > that the maximum allowable input signal level at the LINE IN sockets
> on the DSKsis 2 V rms. Above this level, input
> > signals will be distorted. Input and output sockets
> > on the DSKs are ac coupled to the codec."br /> > >
> > I used this code from the book:br /> > >
> > //loop_poll.c loop program using polling
> > #include "DSK6416_AIC23.h" //codec support
> > Uint32 fs=DSK6416_AIC23_FREQ_8KHZ; //set sampling rate
> >
> > void main()
> > {
> > short sample_data;
> > comm_poll(); //init DSK, codec, McBSP
> > while(1) //infinite loop
> > {
> > sample_data = input_left_sample(); //input sample
> > output_left_sample(sample_data); //output sample
> > }
> > }
> >
> > From the book again: "Input a sinusoidal waveform to the LINE IN
> connector on the DSK, with an amplitudeof
> > approximately 2.0 V p - p and a frequency of approximately 1 kHz.
> Connect
> > the output of the DSK, LINE OUT, to an oscilloscope, and verify the
> presence ofa tone of the same frequency, but
> > attenuated to approximately 1.0 V p - p. This attenuation
> > is due to the potential divider network, comprising two resistors,
> on the DSKcircuit board between the LINE IN
> > socket and the codec input."
> >
> > Done that but with different results, at LINE OUT the signal had
> same frequency and amplitude of 0.4Vp-p. The AIC23
> > codec had this values in registers:br /> > >
> > DSK6416_AIC23_Config config = {br /> > > 0x0017, /* Set-Up Reg 0 Left line in volume control */
> > 0x0017, /* Set-Up Reg 1 Right line in volume control */br /> > > 0x01f9, /* Set-Up Reg 2 Left channel headphone volume */br /> > > 0x01f9, /* Set-Up Reg 3 Right channel headphone volume */br /> > > 0x0011, /* Set-Up Reg 4 Analog audio path control */br /> > > 0x0000, /* Set-Up Reg 5 Digital audio path control */br /> > > 0x0000, /* Set-Up Reg 6 Power down control */br /> > > 0x0043, /* Set-Up Reg 7 Digital audio interface format */br /> > > 0x0081, /* Set-Up Reg 8 Sample rate control */br /> > > 0x0001 /* Set-Up Reg 9 Digital interface activation */br /> > > };
> >
> > After this i tested the board for different amplitudes and got this
> results:
> >
> > input =1.5Vp-poutput=0.3Vp-p
> > input=2Vp-poutput=0.4Vp-p
> > input=3Vp-poutput=0.6Vp-p
> > input=4Vp-poutput=0.76Vp-p br /> > > input=5Vp-poutput=1Vp-p
> >
> >
> > Looks like the output=0.2*input. How is it possible ?????
> >
> >
> > ________________________________
> > From: Jeff Brower > >
> > To: c...
> > Cc: Adi Aditza >
> > Sent: Friday, May 13, 2011 11:43 PM
> > Subject: Re: [c6x] DSP 6416
> >
> >
> > br /> > > Adi-
> >
> >> Let me start again with the problem.
> >>
> >> Here is the code im using:br /> > >>
> >> #include "dsk6416_aic23.h" //codec-DSK support file
> >> Uint32 fs=DSK6416_AIC23_FREQ_48KHZ; //set sampling rate
> >> interrupt void c_int11() //interrupt service routine
> >> {
> >> short sample_data;
> >> sample_data = input_sample(); //input data
> >> output_sample(sample_data); //output data
> >> return;
> >> }
> >> void main()
> >> {
> >> comm_intr(); //init DSK, codec, McBSP
> >> while(1); //infinite loop
> >> }
> >>
> >> I generate a signal with 2Vp-p amplitude and 1kHz frequency
> >> with a signal generator and connect it to Line IN. After i
> >> run the code, the signal from Line OUT shown on oscilloscope
> >> is a sine wave with 0.8Vp-p and 1kHz. If i vary the
> >> frequency and amplitude at input, it varies at output
> >> (frequency at output is the same as input only the amplitude
> >> is attentuated at output).br /> > >>
> >> The cables im working with are coaxial with BNC plug at one
> >> end and audio jack (3.5mm) at the other end, and another
> >> coaxial has BNC plugs at both ends.br /> > >> The signal generator and oscilloscope are connected to
> >> 230VAC.
> >>
> >> The board im using is TMS320C6416T. If you need the other
> >> files im using let me know. They
> >> are:C6416dskinit.c,C6416dsk.cmd,Vectors_intr.asm,
> >>c6416dskinit.h,dsk6416_aic23.h.
> >
> > It could be the DSK board has different gain settings for input vs.
> output. In your first post you mentioned some
> > register values -- what are those? AIC23 registers? If so which
> ones? Do you have input and output gain (or
> > attenuation) set as matching?
> >
> > Also, try doing the following in your ISR:
> >
> > static unsigned short int i = 0;
> > static short int posmax =0;
> > static short int negmax = 0;
> >
> > sample_data = input_sample(); //input data
> > if (sample_data > posmax) posmax = sample_data;
> > if (sample_data < negmax) negmax = sample_data;
> > sample_data = (short int)i++;
> > output_sample(sample_data); //output data
> >
> > This will cause output ranging from 0 to 65535; i.e. maximum
> possible range. What's the max Vpp you see on the scope?
> > If your max scope Vpp is still 0.8, then clearly something in
> hardware is restricting your output amplitude level.
> >
> > And you can look at posmax and negmax values after you pause the
> code. First they should be symmetric, if not then
> > you don't have the signal generator hooked up correctly. Second from
> what I recall with the DSK boards and AIC23
> > codecs, you should be able to give +/- 2V input to the boards, maybe
> a bit higher. So in your case posmax should be
> > around 15,000.
> >
> > -Jeff
> >
> >> ________________________________
> >> From: Jeff Brower > >
> >> To: Adi Aditza >
> >> Cc: c...
> >> Sent: Thursday, May 12, 2011 10:40 PM
> >> Subject: Re: [c6x] DSP 6416
> >>
> >> Adi-
> >>
> >>> I connected the signal from signal generator to the
> >>> oscilloscope and its a sine wave with 2Vp-p amplitude.
> >>
> >> Is that not what you expect? Can you vary the level using the
> amplitude control on the signal generator?
> >>
> >>> generator has 2 output impedances (50ohm and 600ohm)
> >>> and the result its the same.
> >>
> >> Scope inputs are high impedance, so it won't matter what is the
> signal generator output impedance -- both selections
> >> should look the same.
> >>
> >>> I have a DSP 6416T and i'm using it for calculating
> >>> the effective value of a sine wave.
> >>
> >> Can you clarify your setup? If the signal generator is producing
> the sine wave and the scope is measuring it, then
> >> what is the DSP doing? And what type of board do you have? DSK
> 6416? Something else?
> >>
> >> -Jeff
> >>
> >>> ________________________________
> >>> From: mikedunn > >
> >>> To: Ceausu Adrian >
> >>> Cc: c...
> >>> Sent: Thursday, May 12, 2011 7:42 PM
> >>> Subject: Re: [c6x] DSP 6416
> >>>
> >>>
> >>> Ceausu Adrian,
> >>>
> >>> On 5/12/2011 8:20 AM, Ceausu Adrian wrote:
> >>> br /> > >>>>Hello,
> >>>>
> >>>>
> >>>>I have a DSP 6416T and i'm using it for calculating the effective
> value of a sine wave.
> >>>>I've made the default settings in registers, 0x0017 for input and
> 0x01f9 for output, and when i generate (with a
> >>>> signal generator) a sine wave with 2Vp-p amplitude, on the
> oscilloscope its only 0.8Vp-p.br /> > >>>>
> >>>>
> >>>>Does anyone knows why ?
> >>>
> >>> a. the impedance of the load is incorrect for the signal generator
> >>> or
> >>> b. the signal generator is broken or incorrectly set up
> >>> or
> >>> c. the scope or probe is broken, out of calibration, or incorrectly
> >>> set up
> >>>
> >>>
> >>> mikedunn
> >>> Thank you./span>