AnsweredAssumed Answered

STM32F105 - Correct method for ADC Calibration?

Question asked by wanderyr on May 24, 2016

It looks like there is a discrepancy between the StdPeriphLib example programs and the Reference Manual regarding the ADC calibration.  Which is the correct method?

In the RM0008 Reference Manual, Rev 14, Section 11.4:

Note 1: It is recommended to perform a calibration after each power-up.
Note 2: Before starting a calibration the ADC must have been in power-off state (ADON bit = ‘0’) for at least two ADC clock cycles."

However, in each ADC example provided with the STM32F10x Standard Peripherals Library (v 3.5.0), the ADC is enabled immediately before the calibration routine is executed.  Here is an example:


/* Enable ADC1 */
ADC_Cmd(ADC1, ENABLE); // This sets ADON = 1!

/* Enable ADC1 reset calibration register */   

/* Check the end of ADC1 reset calibration register */

/* Start ADC1 calibration */

/* Check the end of ADC1 calibration */

Which is the correct way to do this?  The document says that the correction factor is stored in ADCx->DR, but I don't see it...

Thanks for any help you can give me!