Wrong conversion time on ADC and two samples instead of one.
Hello,
I am using NUCLEO-U5A5ZJ-Q evaluation board.
I have configured ADC1 to do a single conversion and a software start.
I want to measure ADC conversion time.
My main test code looks like this
while(1)
{
HAL_ADC_Start_IT(&hadc1);
HAL_Delay(1);
HAL_ADC_Stop_IT(&hadc1);
adc_value = hadc1.Instance->DR;
}
I have added a test pin for debugging. To check with oscilloscope.
I set pin high inside HAL_ADC_Start_IT just before ADC enabled.
And I reset pin inside interrupt procedure ADC1_2_IRQHandler.
I have connected oscilloscope to ADC input pin directly to see
sample begin. As ADC capacitor is connected to input and it has some charge
it is possible to see discharge curve on the screen.
Here is the picture.

Yellow shows time between start and end of sampling.
Blue shows sampling begin (when capacitor is connected).
Why there are two discharge curves?
I have configured to do only one sample.
Also the timing is wrong.
I am using clock from external HSE.
It is 16MHZ. Divider is 32.
ADC is 12 bit so hold time is 12.5 clock cycles.
Sampling time is 5 clock cycles. (SPE is 0).
Now the time should be:
(12.5+5) * (1/16*32) = 35us
But the time on the screen is 55us.
I guess it is due to two samples but why there are two samples?
Here is screenshot from cube mx with ADC1 configuration.

Thanks.
