> failed to get anything out
This is not a proper problem description. You should describe in detail, what are the observations and how do they differ from the expectations.
You have to disable ADC deep powerdown and enable its regulator first.
Also, calibration is recommended. Read the ADC chapter in RM.
/*
To start ADC operations, it is first needed to exit Deep-power-down mode by setting bit DEEPPWD=0.
Then, it is mandatory to enable the ADC internal voltage regulator by setting the bit
ADVREGEN=1 into ADCx_CR register. The software must wait for the startup time of the
ADC voltage regulator (T ADCVREG_STUP ) before launching a calibration or enabling the
ADC. This delay must be implemented by software
*/
ADC1->CR = 0
| (0 * ADC_CR_DEEPPWD)
| (1 * ADC_CR_ADVREGEN)
;
LoopDelay(100); // t ADCVREG_STUP = 20us max -- this is uncalibrated delay, but it's certainly more than 1 cycle per loop, so at 4MHz this is at least 100/4=25us (use any other delay you have at hand)
// we are not going to be measuring differentially so don't need to set ADCALDIF prior to launching calibration
ADC1->CR = 0
| (1 * ADC_CR_ADVREGEN)
| (1 * ADC_CR_ADCAL)
;
while (ADC1->CR & ADC_CR_ADCAL); // wait until calibration ends
// and that's it
JW