cancel
Showing results for 
Search instead for 
Did you mean: 

My ADC outputs values from 970 and above

Panagiotis
Associate III

I 'm making a voltmeter - amp meter, this one...

I 'm using an STM32F030K6T6.

But when nothing is connected to the input, instead of outputing 0, the ADC gives me a value around 980.

VDDA is tied to VDD.

Boot0 is tied to GND.

These are the ADC 's settings:

ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;
Resolution = ADC_RESOLUTION_12B;
DataAlign = ADC_DATAALIGN_RIGHT;
ScanConvMode = ADC_SCAN_DIRECTION_FORWARD;
EOCSelection = ADC_EOC_SINGLE_CONV;
LowPowerAutoWait = DISABLE;
LowPowerAutoPowerOff = DISABLE;
ContinuousConvMode = DISABLE;
DiscontinuousConvMode = DISABLE;
ExternalTrigConv = ADC_SOFTWARE_START;
ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
DMAContinuousRequests = DISABLE;
Overrun = ADC_OVR_DATA_PRESERVED;

What have I done wrong?

Any help is welcome.

10 REPLIES 10
Panagiotis
Associate III

Analog->ADC->Configuration->Parameter settings->ADC_Regular_ConverstionMode>-Sampling Time.

I changed it's value from 1.5 cycles to 239.5 cycles and works fine!!

It was so simple!