2021-03-26 07:17 AM
Hello,
I'm using the ADC on a STM32G431 to read 5 voltages at 20kHz. Everything works well, but suddenly the 5 channels "get stuck" or freeze, i.e. the value they measure becomes constant even though the voltages on the input pins still fluctuate. Sometimes the measured values resume to being correct again by themselves after a little while (like after 200 samples for instance), other times the values remain constant until I manually cycle the MCU power.
Some more details about the code architecture:
Some info about my debugging so far:
NB: this is surprisingly similar to this question by @FChen.3 , but since no answer was given there I thought sharing my case still is useful.
Solved! Go to Solution.
2023-03-01 08:28 PM
Hi Igor,
Actually I am trying to measure the voltage of PWM signal at 1kHz with 50% duty cycle. Now the signal I am measuring having amplitude 3.1V checked on CRO and the ADC considering this and showing the results as per this for instance Vref is 3.3V ADC is 12-Bit. (4095/3.3)xADC_IN0=3846 which is I am getting with slightly jumping that is not a problem for now. But, when I check the voltage with multimeter it is showing 1.6V now I am confusing what's going on.?
I want to just measure the PWM signal with right way.
Also tried one thing I used 1uF,25V electrolytic capacitor just after the PWM signal and 10K resistance in series with ADC pin by doing this it is showing right value as per the multimeter. I am not sure that it is right way to measure the PWM signal or not.
Am I doing right or wrong here pl let me know??
What sort of thing I should be taken care of while measuring PWM signal.?
2023-03-01 10:24 PM
2023-03-01 10:48 PM
Ok thanks for the reply.