ADC output ranging about 2000 up to 4095
I'm running an STM32L452RCTX uC, and I'm trying to implement a 2.5Vref+ ADC.
Things weren't looking quite right on the pins I intend to implement, so for now I'm driving a floating TP with a power supply so I can directly test input vs output.
When driving the pin to ground, the output is around 2000 (I've seen it in the 198X through 200X range).
When increasing the voltage, I reach the full 4095 at 2.35V, which I feel is reasonably close to my measured 2.482 reference for my application.
I've scoured everywhere I can think of, and I can't seem to find any information on why this might happen. The behavior is almost as if the Vref- is somewhere near -2.5V, but I have that pin (confirmed through measurement) tied to ground.
As for circuitry, I have 3.3V running through a 470 ohm resistor to the top of a 2.5V zener (LM4040), across two caps to ground (2.2uF and 0.1uF), and through a series 0 ohm resistor into the Vref+ pin. The Vref- pin is soldered directly to the ground plane. The test point I am driving is about 3mm from the pin of the uC.
And the programming, using the HAL drivers:

//Additional initializations beyond HAL implementation
HAL_ADC_Stop(&hadc1);
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
//Battery checker, in main loop
if(check_adc && ((hadc1.State & HAL_ADC_STATE_READY) == HAL_ADC_STATE_READY))
{
//Configure ADC for conversion
adc_channel = TP_ADC;
sConfig.Channel = adc_channel;
sConfig.Rank = 1;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_Start(&hadc1) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_PollForConversion(&hadc1, 100) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_Stop(&hadc1) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_Start(&hadc1) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_PollForConversion(&hadc1, 100) != HAL_OK)
{
Error_Handler();
}
uint16_t temmp = hadc1.Instance->DR;
HAL_ADC_Stop(&hadc1);
check_adc = NO;
adc_check_timer = ADC_CHECK_TIME;
}
Registers while device is paused, currently a floating pin:


And measured results of the DR register:
Pin grounded: 0x7C0
Pin floating: 0x8E2
Pin 3.324V: 0xFBF
