DSPRelated.com
Forums

Re: Analog input for C33 University DSK

Started by Kaustubha Reddy October 31, 2006
Thanks for the help, Mike. I'll try that here.

"c...@juno.com" wrote:
Hi Kaustubha Reddy,

I used siggen3 in the DSK3\DSK3\C_APPS folder.

change
if(IOF&0x8)
{
f = xcv(AIC_L); // Output AIC_L to DAC, returning the ADC value
f += Signal(0); // Line-In is summed with signal generator tones
f += Signal(1);
f += Signal(2);
f += Signal(3);
f += Signal(4);
AIC_L = f;
}

to

if(IOF&0x8)
{
f = xcv(AIC_L);
f = Signal(0);
AIC_L = f;
}

This will force the output left channel signal to the internal signal
(there are two output channels) generator frequency and magnitude. To
read the input channel simply read AIC_L. The value of AIC_L is
porportional to the input voltage by a factor of about 500000 (I think,
needed to experiment). Don't delete the xcv(AIC_L) line. If the xcv
subroutine is not run on either channel the output will fail. Also
don't put a constant value into AIC_L, this will cause an exponentially
decaying ramp function.

Then change the below line
volatile float CTRLA_VAL [10]={ 55, 110, 220, 440, 880,
55, 110, 220, 440, 880};

the first number is the default frequence of signal generator 0.

Then change the below line
float CTRLB_VAL[10] = {10, 10,10,10,10, 10,10,10,10,10};

The first number is the default amplitude.

The control panels can be openned before running siggen3, and modified
live during the run of the program. Notice the min and max may need
adjusted depending the magnitude or frequency you want.

*S0_xdata = f; //outputs analog
x = *S0_rdata; // reads analog

Which side read depends on which channel is active, that occilates
automatically, I think the timers for that are specified in the
assembly, but I'm still not sure how to read the assembly for this
microcontroller.

The values for S0_xdata and S0_rdata are stored in

#include "C3MMR.H"

S0_xdata .set 0808048h ; SP 0 Data transmit
S0_rdata .set 080804Ch ; SP 0 Data receive

If you want to post a copy of this to the dsprelated c3x discussion
groups, that might be good. I didn't want to do it without your
permission.

Sincerely,
Mike

-- "Kaustubha Reddy" wrote:
Hi Mike,

Could you please tell me what address you write to, for the analog
output? How can we access the analog ports? You'd mentioned in your
mail to the C33 group that you were using the analog i/o for sine wave
generation. That is precisely what I intend to do for starters. I've
just started using the kit, and am having trouble locating enough
information about it.

Thanks,
Kaustubha Reddy