2021-11-28 08:49 AM
hi i am trying to measure battery voltage with Vrefint channel. it works . when the microcontroller goes to sleep, after waking up, the battery measurements do not work.
while (1)
{
HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, 100);
adc = HAL_ADC_GetValue(&hadc1); adc
HAL_ADC_Stop(&hadc1);
sprintf(str, "%04d", adc);
FontSet(Font_11x18);
LCD_DrawStr(str, 60, 70, Black);
LCD_UpdateScreen();
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
HAL_ResumeTick();
}
I wake up with an external interrupt
what am I doing wrong?
HAL_Delay(3000);