--- In "ambro653" <> wrote:
>
> 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.
>
Did you ever find out about this problem? I cannot even get readings
correct at all. I believe i am using similar code to yours. The
voltage i am reading from a Multimeter, the average is what
read_channel outputs.
voltage average
3.05 23365
2.78 18837
2.47 14122
2.24 10411
2 6932
1.74 3282
1.5 52125
1.26 61799
1.06 58913
0.74 53904
0.48 49962
0.235 46070
0.001 42415
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/
|