cancel
Showing results for 
Search instead for 
Did you mean: 

ADC calibration issue

vasudev
Associate II

Hi , I am trying to calibrate ADC in STM32334R8. But the code is stoping at calibration phase itself. I will attach the initilization code below for your reference. 

 

LL_ADC_Disable(ADC1);
LL_GPIO_ResetOutputPin(GPIOC,LL_GPIO_PIN_8);
LL_ADC_EnableInternalRegulator(ADC1);
LL_ADC_DELAY_VREFINT_STAB_US;
LL_ADC_DELAY_INTERNAL_REGUL_STAB_US;
LL_ADC_StartCalibration(ADC1,LL_ADC_SINGLE_ENDED);
while (LL_ADC_IsCalibrationOnGoing(ADC1) != 0) {
LL_GPIO_SetOutputPin(GPIOC,LL_GPIO_PIN_8);
}
LL_GPIO_ResetOutputPin(GPIOC,LL_GPIO_PIN_8);
LL_ADC_Enable(ADC1);

The GPIO pin gets sets and will never reset . which means it is getting struck in calibration phase itself. 

 

1 REPLY 1
STTwo-32
ST Employee

Hello @vasudev and welcome back to the ST Community :smiling_face_with_smiling_eyes:.

I suggest you compare your code to the calibration part of this example. That may help you locating and solving your problem.

PS: Make sure to enable ADC before starting calibration.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.