Dear community,
right now iam trying to solve my following problem with ADC1 Group1 conversion. Look at enclosed snippets with configuration from Halcogen for better understanding my situacion.
I want to use ADC1 Group1 channels 0, 1, 2, 3, 4, 9. I want software trigger and i want interrupt to notify when whole group is converted and ready to be read from buffer. I also want channel ID information.
in my main i call all necesarry functions to set it up (i believe):
adcInit();
adcEnableNotification(adcREG1, adcGROUP1);
_enable_interrupt_();
adcStartConversion(adcREG1, adcGROUP1);
In HL_adc.c i use extern variable to notify main loop that conversion is ready
void adc1Group1Interrupt(void)
{
/* USER CODE BEGIN (39) */
ADC_ready1 = true;
/* USER CODE END */
adcREG1->GxINTFLG[1U] = 9U;
adcNotification(adcREG1, adcGROUP1);
/* USER CODE BEGIN (40) */
/* USER CODE END */
}
And in main i have following: (adc_data1 is array - adcData_t adc_data1[8];)
if(ADC_ready1)
{
uint16 ch_count = 0;
ADC_ready1 = false;
ch_count = adcGetData(adcREG1, adcGROUP1,&adc_data1[0]);
}
so when i start debugging and stop program right after adcGetData function call i look at adc_data1 array and see that there is only one valid value from channel 9 (that is internally connected to ambient light sensor). Other cannels doesnt have even channel ID filled. I would understand, that value of conversion for other channels is 0, because those are floating "in the air", so there could occur unpredictible values, but at least i would expect other channels to have id information filled ...
Even if i look at returned value from adcGetData function, i see it returned value "1" that means only one channel converted?
so what is going on here? How does this multiple channel conversion with interrupt notification works?
Thanks for any suggestions
regards
Jan, Technical support
Honeywell Aerospace