2023-11-15 08:34 AM
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.
2023-11-15 08:59 AM - edited 2023-11-16 12:45 AM
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.