DSPRelated.com
Forums

DSP56F803EVM ADC

Started by elowe_spsy May 12, 2003
Hello,

I'm trying to measure how long the A to D coversions are taking.
I'm using inputs 0 and 1 in differnetial mode.
I have it set up to use the call back on conversion.
I drive a gpio line high when I call the ioctl with ADC_START
and then drive the line low in the call back.
It seems to be taking 8 microsecs per conversion and sometimes
the call back routine doesn't get called.
The manual says the coversion time should be 1.7 micro seconds.

Also, if I'm running from my main routine in a loop waiting
for the call back routine to get called, it never gets called.
I had to put a nanosleep in my loop for this to happen ?

Any suggestions on what I'm doing wrong.

Thanks



I do not think you can measure exact ADC conversion
time by using software. There are many factors you
haven't taken in account. The first all, interrupt
latency. The second, ioctl and callback code
efficiency. To roughly measure ADC conversion rate,
1st use assembly instruction; 2nd measure the period
of 8 conversions instead of single conversion; 3rd
slow down ADC clock. So that you may be able to get
rough cycle number of 8 conversions. Hopefully this
will help.

C.W.

--- elowe_spsy <> wrote:
> Hello,
>
> I'm trying to measure how long the A to D coversions
> are taking.
> I'm using inputs 0 and 1 in differnetial mode.
> I have it set up to use the call back on conversion.
> I drive a gpio line high when I call the ioctl with
> ADC_START
> and then drive the line low in the call back.
> It seems to be taking 8 microsecs per conversion and
> sometimes
> the call back routine doesn't get called.
> The manual says the coversion time should be 1.7
> micro seconds.
>
> Also, if I'm running from my main routine in a loop
> waiting
> for the call back routine to get called, it never
> gets called.
> I had to put a nanosleep in my loop for this to
> happen ?
>
> Any suggestions on what I'm doing wrong.
>
> Thanks >


__________________________________


We have a set of ADC routines in the FAQ system that might help you. Take a look
at the following FAQ.

http://e-www.motorola.com/webapp/sps/utils/SingleFaq.jsp?FAQ-11868.xml
<http://e-www.motorola.com/webapp/sps/utils/SingleFaq.jsp?FAQ-11868.xml>

The example 4-Sim Triggered - 2 us is quite efficient in the way it is written.
If you use this type of structure of installing a static super fast ISR you can
effectively measure the conversion time sicnce the interrupt latency times will
be minimized. Although I guarantee it will match the times as stated in the user
manual and data sheets.

A common mistake for when the ADC is taking longer than expected is that unsued
channels are not turned off. The above examples are written for a 805 EVM , but
the general code applies to the 803. Thanks.

- Bill

-----Original Message-----
From: Charlie W [mailto:]
Sent: Tuesday, May 13, 2003 9:28 PM
To: elowe_spsy;
Subject: Re: [motoroladsp] DSP56F803EVM ADC I do not think you can measure exact ADC conversion
time by using software. There are many factors you
haven't taken in account. The first all, interrupt
latency. The second, ioctl and callback code
efficiency. To roughly measure ADC conversion rate,
1st use assembly instruction; 2nd measure the period
of 8 conversions instead of single conversion; 3rd
slow down ADC clock. So that you may be able to get
rough cycle number of 8 conversions. Hopefully this
will help.

C.W.

--- elowe_spsy <> wrote:
> Hello,
>
> I'm trying to measure how long the A to D coversions
> are taking.
> I'm using inputs 0 and 1 in differnetial mode.
> I have it set up to use the call back on conversion.
> I drive a gpio line high when I call the ioctl with
> ADC_START
> and then drive the line low in the call back.
> It seems to be taking 8 microsecs per conversion and
> sometimes
> the call back routine doesn't get called.
> The manual says the coversion time should be 1.7
> micro seconds.
>
> Also, if I'm running from my main routine in a loop
> waiting
> for the call back routine to get called, it never
> gets called.
> I had to put a nanosleep in my loop for this to
> happen ?
>
> Any suggestions on what I'm doing wrong.
>
> Thanks >


__________________________________

<http://rd.yahoo.com/M%3924.3294213.4590844.1261774/D=egroupweb/S05771855:H\
M/A80983/R=2/id=noscript/*http://companion.yahoo.com/config/features5>

<http://us.adserver.yahoo.com/l?M%3924.3294213.4590844.1261774/D=egroupmail/S=\
:HM/A80983/randd3112798>

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp
<http://www.yahoogroups.com/group/motoroladsp>

More Groups: http://www.dsprelated.com/groups.php3
<http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/> .