2021-05-23 07:02 PM
Hi, I have a question the difference of waking up between LOW_POWER_SLEEP_MODE and STOP_MODE.
I have used ADC for waking up from STOP_MODE and LOW_POWER_SLEEP_MODE respectively.
According to STM32L051U6 datasheet, both modes cannot be waken up by ADC, however, in LOW_POWER_SLEEP_MODE, it seems that ADC works as wake-up.
Is there anything that I misunderstood? How is it possible to wake up LOW_POWER_SLEEP_MODE by ADC?
I attached snapshots of the datasheet about waking up just in case.
Thank you in advance.
the datasheet for wake-upEntering Stop/low-power-sleep mode
/* Enable Ultra low power mode */
HAL_PWREx_EnableUltraLowPower();
/* Enable the fast wake up from Ultra low power mode */
HAL_PWREx_EnableFastWakeUp();
/* Select HSI as system clock source after Wake Up from Stop mode */
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);
/* enter stop mode */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
/* enter low-power-sleep mode
HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
*/
Exiting Stop/Low-power-sleep mode
SystemClock_Config();
/* Disable Ultra low power mode */
HAL_PWREx_DisableUltraLowPower();
/* Disable the fast wake up from Ultra low power mode */
HAL_PWREx_DisableFastWakeUp();
Solved! Go to Solution.
2021-05-28 06:26 AM
Hello @GKim.7 ,
from the wakeup perspective, the LP sleep is practically equivalent to the regular sleep mode. The difference is that another power regulator is in place. So while the ADC may seem to work and wake up from LP Sleep, the power regulator it needs for correct operation is not active. The result is incorrect ( or at least not guaranteed) conversion result.
I'd avoid using this configuration and stick to normal sleep mode for reliable ADC operation.
Rgds,
Jarda
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.
2021-05-28 06:26 AM
Hello @GKim.7 ,
from the wakeup perspective, the LP sleep is practically equivalent to the regular sleep mode. The difference is that another power regulator is in place. So while the ADC may seem to work and wake up from LP Sleep, the power regulator it needs for correct operation is not active. The result is incorrect ( or at least not guaranteed) conversion result.
I'd avoid using this configuration and stick to normal sleep mode for reliable ADC operation.
Rgds,
Jarda
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.
2021-06-03 10:28 PM
Thank you for answering. So you mean that MCU shouldn't be waken up by ADC in LPSleepMode?
2021-06-04 12:14 AM
Hello @GKim.7 !
What I meant to say is that it should not be used that way. It's a similar situation as LPRun. Even if it appears to work, the ADC results will not be accurate. The parameters stated by the datasheet are no longer guaranteed if ADC is used this way. If it works for you it's probably fine, but mind this limitation.
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.