Hi,
I need to use the integrated ADC on TS-7400 and I am having some
problems. I succeeded in capturing the values, but the sampling rate
is too low. I've used the routines from ep93xx_adc.h and captured by
calling the following function repetedly:
void ReadADC (double *voltages)
{
int i, j, avg, cur_ch;
double val;
for (i = 0; i < ADC_CHANNELS; i++)
{
switch(i)
{
case 0:
cur_ch = ADC_CH0;
break;
case 1:
cur_ch = ADC_CH1;
break;
case 2:
cur_ch = ADC_CH2;
break;
case 3:
cur_ch = ADC_CH3;
break;
}
read_channel(adc_page, cur_ch);
read_channel(adc_page, cur_ch);
usleep(10000);
avg = read_channel(adc_page, cur_ch);
if(avg < 0x7000)
avg = avg + 0x10000;
avg = avg - 0x9E58;
val = ((double)avg * 3.3) / 0xC350;
voltages[i] = val;
}
}
Basically it works, but the sampling rate is extremly low, about 5
per second. Changing te 'usleep' call to only wait 1000us gives me 10
per second, but I couldn't achieve any more.
According to EP9302 docs the ADC is capable of capturing at least at
around 900 per second, and around 300 if you count in channel
switching.
How come it's that slow? I need much greater sampling rate.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|