2025-05-08 1:40 PM
Hello everyone,
I'm trying to use IN1, IN2, and IN4 from the ADC1 of the NucleoF303K8. I transmit the ADC values via UART2 to my laptop.
Now to my problem: When all three ADC channels are at 1.6V, I receive the correct values. However, if I pull one of the channels to 0V (GND), the values of all ADC channels decrease. I want to measure the exact value of all three ADC1 channels independently. I have tried different codes, but none of them work. Does anyone know what the problem might be or how I need to change my code to fix this issue?
My code is attached.
I am grateful for any help.
2025-05-08 2:27 PM
> sConfig.SamplingTime = ADC_SAMPLETIME_7CYCLES_5;
Increase this to max for the most improvement in accuracy.
The sampling time needs to be long enough to fully charge the sampling capacitor. Lower impedance sources will need less time.
See especially "4.2.6 SAR ADC sampling time prerequisites" in this app note:
How to optimize the ADC accuracy in the STM32 MCUs - Application note