Multiple ADC / 805 / SDK2.5 / CW5 question

Started by chaderry January 19, 2004

First off - I apologize if this message reaches some of you twice; I
tried two days ago to post by email and yahoo - for the same reason
it refuses to accept even the passwords it's assigned me for my real
account (forcing me to moonlight as charles derry, my spam attack
address) and for the same reason it never let me view files for other
groups I'm a member of - won't accept posts to this group via email
either. So, here goes - hopefully this will work: Hi. I'm new. :P

I'm using a DSP56f805 to do a 6-axis motor controller for a motion

I grab analog inputs for feedback, pulse width input from a PC for
control, and PWM output to run the motors.

I'm using Code warrior 5 with SDK 2.5.

I've got everything working but the ADC input.

My problem is that I can make one ADC pin work fine, but if I enable
more than one pin, trying to read from any pin other than the first
one initialized in the code results in a crash.

I haven't been able to find any clear explanation of how the SDK's
interface with the ADC works - there are examples all over the place,
but one of them will have:

static const adc_sState sadc0 = {

/* AnalogChannel = */ ADC_CHANNEL_0,
/* SampleMask = */ 0x01,

/* OffsetRegister = */ FRAC16(0.0),
/* LowLimitRegister = */ 0,
/* HighLimitRegister = */ 0,
/* ZeroCrossing = */ 0,


...and the other one will have

static const adc_sState sadc0 = {

/* AnalogChannel = */ ADC_CHANNEL_0,
/* NumSamples = */ 0,

/* OffsetRegister = */ 0,
/* LowLimitRegister = */ 0,
/* HighLimitRegister = */ 0,
/* ZeroCrossing = */ 0,

}; I haven't got the *slightest* idea what's going on. SampleMask
and NumSamples are confused; I've looked at the samplemask grids and
that makes sense, but where the hell do I put it when the code that
works says that it's supposed to be NumSamples?!

I've dug through the help docs, through the archives of this group,
been around the block three times with motorola AND my local
applications guy - who sent me code that uses all 8 ADCs but doesn't
use the SDK!

I'm at wit's end, and would really appreciate some info on using the
ADC that doesn't already assume you know how to use it!

If any of you would like to help but can't without more information,
let me know, and I can post the source code in short order.

Thanks in advance,

-David Wiernicki