help in a/d convert of pic 18f458(picc compiler)

Started by kaci...@yahoo.fr September 8, 2008
hi all,
in need some hope(oriontatin) in my application.
my application consist in;
i have 3 analog input (3 sinusoidal tensions),then i neeed a/d converter
an0,an1,an3 (10bit conversion) and the 3 result of conversion will be used in calcul(var =fonction(read(1),read(2),read(3...) fonction is(arctan..) )
i use the pic 18f458(with picc compiler) and i want to obtain a hightspeed intern (40MHZ)
,for this i have used 10MHZ with pll enabled

my progam;
#include<18f458.h>
#device adc
#fuses hs, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
#use delay (clock@000000)
double result;
float v1,v2,v3;

void main(void)
{
ld:
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_32); // utilisation de l'horloge interne pour l'ADC
set_adc_channel(0); // Lecture sur le canal 0 du port
result=(double)(read_adc());
v1 = ( 5.0 * result ) / 1024;
set_adc_channel(1); // Lecture sur le canal 1 du portA
delay_us(10);
result=(double)(read_adc());
v2 = (5.01 * result) / 1024;
delay_us(10);
result=(double)(read_adc());
v3 = (5.01 * result) / 1024;
goto ld;
}
my questions;
1.how much time to the ad convertion (convert 3analog input to digital)
2.what is the faster a/d convertion 8bit or 10bit.and how much for difference.
3.what the declaration can i use to obtain max internal execution speed (40Mhz)(i use 10MHZ with pll enabled)
(1).#fuses hs, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
#use delay (clock@000000)

or:
(2).#fuses hs, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
#use delay (clock000000)
4.is it necessary to do delay time; (delay_us(10);)

thanks.