2025-09-16 9:56 PM
Hello,
I have a ADC clock running at 96MHz prescaler divided by 10, 12bit, Sampling time 47.5 Cycles. I am just trying to sample this DC volgtages. I have a battery that has around 20Volts, and I am stepping this voltage down using the voltage divider as U8, U1, U2 to be sampled by the ADC. I have two ADC measuring BN, and Vref to measure the current across the 1Ohm resistor. I am getting consistently accurate values, but I have this random 5mv difference or 30mV spikes that happens out of no where. I am not sure how to fix this to improve my ADC resolution. Could you please give me an idea how to proceed?
I really appreciate the time and effort for this matter
Thank you
2025-09-17 5:51 AM
You will always have some amount of noise in the ADC reading. You can't get 12 noise-free bits from the STM32 ADC. It looks like you only get a few counts of noise which is about as good as you can do.
General tips for improving accuracy here:
How to optimize the ADC accuracy in the STM32 MCUs - Application note