STM32H725 ADC3 IN12 different transfer function??
Hi, we are using the MCU STM32H725IGKx (UFBGA176) ADC3 configured as follows.
/** Common config
*/
hadc3.Instance = ADC3;
hadc3.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV1;
hadc3.Init.Resolution = ADC_RESOLUTION_12B;
hadc3.Init.DataAlign = ADC3_DATAALIGN_RIGHT;
hadc3.Init.ScanConvMode = ADC_SCAN_ENABLE;
hadc3.Init.EOCSelection = ADC_EOC_SEQ_CONV;
hadc3.Init.LowPowerAutoWait = DISABLE;
hadc3.Init.ContinuousConvMode = DISABLE;
hadc3.Init.NbrOfConversion = 6;
hadc3.Init.DiscontinuousConvMode = DISABLE;
hadc3.Init.ExternalTrigConv = ADC_EXTERNALTRIG_T8_TRGO;
hadc3.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
hadc3.Init.DMAContinuousRequests = ENABLE;
hadc3.Init.SamplingMode = ADC_SAMPLING_MODE_NORMAL;
hadc3.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DMA_CIRCULAR;
hadc3.Init.Overrun = ADC_OVR_DATA_PRESERVED;
hadc3.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
hadc3.Init.OversamplingMode = DISABLE;
if (HAL_ADC_Init(&hadc3) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC3_SAMPLETIME_640CYCLES_5;
sConfig.SingleDiff = ADC_SINGLE_ENDED;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.Offset = 0;
sConfig.OffsetSign = ADC3_OFFSET_SIGN_NEGATIVE;
It converts four external channels + Vrefint + Vsense. Base ADC clock frequency is 1.5MHz.
The external channels are :
- IN0 => PC2_C
- IN1 => PC3_C
- IN12 => PC2
- IN14 => PH3
/**ADC3 GPIO Configuration
PC2 ------> ADC3_INP12
PC2_C ------> ADC3_INP0
PC3_C ------> ADC3_INP1
PH3 ------> ADC3_INP14
*/
GPIO_InitStruct.Pin = GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
GPIO_InitStruct.Pin = AIN_AUX2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(AIN_AUX2_GPIO_Port, &GPIO_InitStruct);
HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PC2, SYSCFG_SWITCH_PC2_OPEN);
HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PC3, SYSCFG_SWITCH_PC3_OPEN);
The conversion process is executed using DMA transfer. Single DMA Transfer is over when all 6 channels are converted.
the DMA transfer is stable and so is the data we obtain.
The problem we face is that the channel IN12 (PC2) seems to have a different transfer function as the rest of channels.
We have applied the same voltage to IN12 (PC2) and IN1 (PC3_C) and we get different binary values.
Here 1024 samples are shown , COMPAMP_UTTEMP (IN12) and COMPAMP_LTTEMP (IN1).

Since IN12 (PC2) is connected internal to all 3 ADC,
we did the same test with PC2 connected to ADC2_IN12 (ADC2 configured as 12 bits) with the same result.
we did the same test with PC2 connected to ADC1_IN12 (ADC1 configured as 12 bits) with the same result.
The Voltage measured with a multimeter at MCU pins PC2 and PC3_C is identical, nevertheless we get the ADC data shown in the previous graph.
The ADC3 calibration is done during boot process.
Can you give us a hint/explanation why IN12 behave different on all 3 ADC?
