ADC changes values after voltage change on neighboring channel
Hello All,
We have a problem with crosstalk between two neighboring ADC pins. On a STM32L496, on PA7 and PC4, two independent single-ended ADC channels are configured in the most simplified way possible.
Connected pins and ADC config:


Method/Function:
This is the function to read the ADC value.
uint32_t getVoltageADC(ADC_HandleTypeDef *hadc, uint8_t channel) {
// Configure the ADC channel parameters
ADC_ChannelConfTypeDef sConfig = {
.Channel = STM32ADCChannelLookUp[channel],
.SamplingTime = ADC_SAMPLETIME_640CYCLES_5,
.Rank = 1
};
HAL_StatusTypeDef status = HAL_OK; // Initialize status variable to track HAL function success
status |= HAL_ADC_ConfigChannel(hadc, &sConfig); // Configure ADC channel
status |= HAL_ADC_Start(hadc); // Start ADC conversion
status |= HAL_ADC_PollForConversion(hadc, HAL_MAX_DELAY); // Wait for conversion to complete
uint32_t raw = HAL_ADC_GetValue(hadc); // Retrieve raw ADC value
status |= HAL_ADC_Stop(hadc); // Stop ADC operation
assert(status == HAL_OK);
HAL_Delay(5); // Ensure all HAL operations completed successfully
return (uint32_t)raw; // Return the raw ADC value
}It is called with
ai_throttleRead = getVoltageADC(&hadc1, 12);The hardware design can be found in the attached image. Throttle (c_throttleRead) is an input from 1-5V, Regen (c_regenRead) is a 10k potentiometer, powered by 3.3V.
Problem:
As long as the potentiometer for the regen is not connected, the throttle works perfectly and has an ADC value of 1500 for 1V (0.64V at pin) and larger values for more throttle. This seem high but I can handle that in the software.
If the regen potentiometer gets connected, the reading for the constant throttle voltage of 1V changes from ADC=2500 if GND is connected and ADC=600 for 3.3V on the regen pin. In other words, changing the voltage at the neighboring pin, changes the ADC reading.
Notes:
- Neighboring pins can be configured as a differential input. (Maybe part of the problem?)
- It is only for those two pins the case.
Tests:
- Use hadc1 for throttle and hadc2 for regen does not change the behavior at all.
- Connect the regen to a spare analog input solved the problem (undesirable!). It is specific for these two pins.
- A lot of different software configurations didn't change it.
- Same behavior for multiple identical boards.
Hardware

Hardware Chip: STM32L496VGTx
