XMC_VADC_GLOB_StartupCalibration() is stuck in loop as calibration does not complete

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19396
Level 1
Level 1
Two ADC groups are used. The calibration does not complete during startup of the device.
The code is stuck in 'while' loop and the powerup of device fails due to failing ADC calibration.

From the code snippet below :

void XMC_VADC_GLOBAL_StartupCalibration(XMC_VADC_GLOBAL_t *const global_ptr)
{

global_ptr->GLOBCFG |= (uint32_t)VADC_GLOBCFG_SUCAL_Msk;


/* Loop until all active groups finish calibration */
for(i=0U; i < 2U; i++)
{
group_ptr = g_xmc_vadc_group_array;
if ( (group_ptr->ARBCFG) & (uint32_t)VADC_G_ARBCFG_ANONS_Msk)
{
/* This group is active. Loop until it finishes calibration */
while((group_ptr->ARBCFG) & (uint32_t)VADC_G_ARBCFG_CAL_Msk)
{
/* NOP */
}

}
}

Please advice.
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Which device are you using?
0 Likes
User19396
Level 1
Level 1
Its a pick and place robot arm used for SMT. The microcontroller is XMC4700.

Could you kindly advice on why the CAL bit is not set to 1 ?

Thank you.
0 Likes