cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Calibration

tbenson
Associate II
Posted on May 23, 2012 at 16:31

I am trying to figure out if the ADC calibration is reset when the ''ADC_DeInit'' function (from the peripheral library) is called after previously calibrating. My guess is that it does, since the ADC_DeInit function is supposed to reset the peripheral to the power-on state.

Here is a contrived example:

ADC_Cmd(ADC2, ENABLE);
ADC_ResetCalibration(ADC2);
while
(ADC_GetResetCalibrationStatus(ADC2));
//ADC is now calibrated
ADC_DeInit(ADC1);
//but is it still calibrated now? 

I haven't been able to verify this though, since there is no mention of where these values are stored. I can't see anything changing in the ADC1 memory space (other than the data register) before and after calibration. Does anybody know for sure if the calibration is reset? At this point it is for my owncuriosity, because I am removing the DeInit calls in the actual code. They were being used to place the ADCx into a ''known'' state, but that seems to have many side effects (one of them being lost calibration I think). #adc
5 REPLIES 5
frankmeyer9
Associate II
Posted on May 23, 2012 at 17:45

You may need to consult the reference manual, or ST if there is no detailed information.

During a ST training seminar I got the following information concerning the DeInit() functions:

Where possible, the DeInit function deasserts the (hardware) reset signal of the peripheral, i.e. doing a hardware reset, and reasserting reset afterwards.

Where not possible, the configuration registers of this peripheral are just set to their reset state.

I'm not sure how that affects the ADC calibration...

tbenson
Associate II
Posted on May 23, 2012 at 19:26

Thanks for the info. I have scoured the reference manual and a couple of other PDFs that are out there concerning the ADC. I still can't find anything specifically about the calibration being affected by resetting the ADC. I will try my hand at contacting ST directly. 

Either way, I believe I can assume that the calibration will be OK as long I don't reset the chip or call ADC_DeInit after the initial calibration. 

raptorhal2
Lead
Posted on May 24, 2012 at 00:59

My reading of the Peripheral Library is that the ADC_DeInit just switches the state of the peripheral clock, not peripheral power. The reference manual says that calibration should be done after each power on, so my guess is that calibration is not affected by DeInit. It should be interesting to see what ST's response is, because the reference manual is not clear on this.

The F2 and F4 series don't have a calibration function. My guess is that calibration is not needed for these series, or it is done automajically at power up.

Cheers, Hal

frankmeyer9
Associate II
Posted on May 24, 2012 at 09:46

The F2 and F4 series don't have a calibration function. My guess is that calibration is not needed for these series, or it is done automajically at power up.

 

I assume the latter.

tbenson
Associate II
Posted on June 01, 2012 at 15:00

Well ST got back to me here was the response:

The only recommendation is to calibrate the ADC every time it is poweredup to ensure the results will be the most accurate.

I take that to mean that it retains the calibration even if it is de-initialized, though that may be too much of an assumption on my part.