cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 - Correct method for ADC Calibration?

jfolsom
Associate II
Posted on May 24, 2016 at 03:30

Hello,

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:

ADC_Init(...);

ADC_RegularChannelConfig(...);

/* Enable ADC1 */

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

/* Enable ADC1 reset calibration register */   

ADC_ResetCalibration(ADC1);

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

while(ADC_GetResetCalibrationStatus(ADC1));

/* Start ADC1 calibration */

ADC_StartCalibration(ADC1);

/* Check the end of ADC1 calibration */

while(ADC_GetCalibrationStatus(ADC1));

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!

0 REPLIES 0