Problem of converting groups (ADC) with SPC56EL70L5
Hi,
I write in this forum for a problem with the ADC of the microcontroller SPC56EL70L5.
My goal is to perform two group conversions in ADC0 and wo in ADC1.
I use the function generated by the program "adc_std_start_conversion" but some values obtained from the conversion are not valid.
The adc work with interrupts and I'm respecting the conversion waiting times.
The behavior changes with different values of Tsample and Tconv, but the problem is not solved.
I had thought at this point to try to set a presempling but the application does not generate me the registers to set.
The program that creates problems is the following:
osalThreadDelayMicroseconds(3);
adc_lld_start_conversion(&ADCD1, &adc0_group_ADC0_FAST,samples_0_fast, ADC0_GROUP_ADC0_FAST_BUF_DEPTH);
osalThreadDelayMicroseconds(30);
adc_lld_start_conversion(&ADCD2, &adc1_group_ADC1_FAST,samples_1_fast, ADC1_GROUP_ADC1_FAST_BUF_DEPTH);
osalThreadDelayMicroseconds(3);
while(num_conv_1<3 || num_conv_2<3){
if(num_conv_1==1){
if(mux_set_port<=16 && mux_set_port>=1)
adc_lld_start_conversion(&ADCD1, &adc0_group_ADC0_SLOW,samples_0_slow, ADC0_GROUP_ADC0_SLOW_BUF_DEPTH);
else if(mux_set_port==17)
adc_lld_start_conversion(&ADCD1, &adc0_group_ADC0_SLOW_REG1_LINE_CURR,samples_0_slow_reg1_line_curr, ADC0_GROUP_ADC0_SLOW_REG1_LINE_CURR_BUF_DEPTH);
else if(mux_set_port==18)
adc_lld_start_conversion(&ADCD1, &adc0_group_ADC0_SLOW_APS33M,samples_0_slow_aps33m, ADC0_GROUP_ADC0_SLOW_APS33M_BUF_DEPTH );
else
num_conv_1++;
num_conv_1++;
}
if(num_conv_2==1){
adc_lld_start_conversion(&ADCD2, &adc1_group_ADC1_FAST_13_14,samples_1_fast_13_14, ADC1_GROUP_ADC1_FAST_13_14_BUF_DEPTH);
num_conv_2++;
}
}
num_conv_1 and num_conv_2 are used only to start the next conversions at the end of the first ones by setting it in the callback.
What do you advise me to do?
I have made many attempts but I cannot resolve.
