I'm looking for guidance on how to select the Sampling Time for the ADC on my STM32L432KCU6. I found some tables in AN2834, but they are for the STM32H7 Series. I'm interested in getting ±0.5 LSB accuracy with 12-bit resolution. I'm running my ADC clock at 32 MHz.
One question I have is whether the ADC discharges (resets) the internal capacitor (C-adc) between every sample or not. If it does, then that tells me that I need to give the circuit enough time to charge C-adc up from 0 to the target voltage, with the worst-case time being when the target voltage is Vref (3 volts).
With my current configuration, I noticed that as I increase the voltage presented to the ADC, the counts value stops increasing near ~4086 which is less than the maximum value of 4095. Does this mean that my Sampling Time is too low?
Also, how do I determine Sampling Time for the internal Channel Temperature Sensor (IN17)?
Here's what I tried: With Sampling Time for all channels set to 12.5 cycles and maximizing the voltage applied to one of the ADC channels, the highest counts I see for that channel are ~4086. When I changed the Sample Time to 24.5 cycles, the highest counts I see for that channel are ~3856. I expected the longer Sampling Time to allow the counts value to go higher, but instead they were unexpectedly lower.