Hi,
I want to use all of the ADC pins at once. I configured pins like this:
static void ADC_CONF4(void)
{
adc_config_t adcConfigStruct4;
adc_sd_config_t adcSdConfigStruct4;
ADC_GetDefaultConfig(&adcConfigStruct4);
adcConfigStruct4.channelEnable = (1U << ADC_CHANNEL_4);
adcConfigStruct4.channelConfig = (ADC_CFG_IDX << ADC_CHANNEL_4);
adcConfigStruct4.triggerSource = ADC_TRIGGER;
adcConfigStruct4.clock = kADC_Clock2M;
adcConfigStruct4.convMode = kADC_ConvModeSingle;
ADC_Init(ADC, &adcConfigStruct4);
ADC_GetSdDefaultConfig(&adcSdConfigStruct4);
adcSdConfigStruct4.downSample = kADC_DownSample32;
ADC_SetSdConfig(ADC, ADC_CFG_IDX, &adcSdConfigStruct4);
g_AdcBandgap4 = ADC_GetBandgapCalibrationResult(ADC, ADC_CFG_IDX);
g_AdcVinn4 = ADC_GetVinnCalibrationResult(ADC, &adcConfigStruct4);
ADC_Enable(ADC, true);
}
and then activate the channels like this:
static void ADC_CH_4(void)
{
//Activate ADC4
POWER_EnableADC(true);
ADC_CONF4();
ADC_Enable(ADC, true);
ADC_DoSoftwareTrigger(ADC);
while (!(ADC_GetStatusFlags(ADC) & kADC_DataReadyFlag))
{
}
adcConvResult4 = ADC_GetConversionResult(ADC);
fresult4 = ADC_ConversionResult2Mv(ADC, ADC_CHANNEL_4, ADC_CFG_IDX, g_AdcBandgap4, g_AdcVinn4,
adcConvResult4);
}
I used channel 4 till channel 11 (8 channels)
But channel 8 values are related to channel 4 and channel 9!
I separated every parameter but it still related and changed with these 2 pins. I checked with 5 different QN9080 board.
What is the problem?