STM32F091RC-Nucleo ADC Sequencer example not producing correct results
Hi,
I'm using the STM32F091RC-Nucleo ADC sequencer example to understand the ADC initialization but I'm not getting accurate results. It looks like the example uses PA4 on the board:
/* main.h */
#define ADCx_CHANNELa_GPIO_PORT GPIOA
#define ADCx_CHANNELa_PIN GPIO_PIN_4
I have a power supply connected to a PA4 and when I adjust the voltage from the 0 -> 3.3 volts (which should be Vref for the ADC), I get meaningless results. These are the results for the ADC values read at PA4, when I apply 1.0 V:
/* main.c */
uhADCChannelToDAC_mVolt = COMPUTATION_DIGITAL_12BITS_TO_VOLTAGE(aADCxConvertedValues[0]);
1441
1441
1437
1438
1444
And these are the values read when I apply 2.0 V:
1432
1428
1427
1427
1437
The ADC readings are effectively the same for 1.0 volts or 2.0 volts.
Can anybody advise on what's going wrong?
