2026-05-15 12:27 AM
Mostly i have to use my device with battery. So i need to operate it as low-power as possible. When doing this low-power process(either standby-stop-or sleep deeep sleep etc. i have no experience about these modes), one ADC reading is critical for me. I always have to measure that ADC reading. How should i create the logic? After makins some research, most of peripherals are disabled during standby(i can not verify this if it was true or not). I think that i need a wake-up source to exit standby-stop or sleep modes. How should i configure this wake-up mechanism? Firstly i was plannig to use ADC as an wake-up source but i am not sure if it was true or not? Can you guide me to better options?
2026-05-15 1:58 AM
Hello @tensaisakuragi06
First, for low-power operation, refer to the Wiki, article, and Example projects that explain the available modes in detail.
In stop mode and above, all clocks are disabled and the core is stopped; only LSI and LSE clocks remain active, so most peripherals do not work. Only low-power peripherals that operate from LSI or LSE clocks, such as LPUART, LPTIM, and LPDMA, remain functional. So, ADC cannot be used as a wake-up source from deep low-power modes such as standby or shutdown.
Standby and shutdown modes reset the microcontroller, which results in the loss of the logic that was done previously in the program. Avoid these modes if you need to preserve application state between wakeups.
In your case, I recommend using this logic:
If your application requires an ADC reading, keep the microcontroller in the lowest suitable low-power mode while no measurement is needed (I suggest stop mode). Wake up the microcontroller using a valid low-power wake source, such as a timer, RTC alarm, external interrupt, or wake-up pin. After wake-up, restore the system clocks, if necessary, enable the ADC, perform the conversion, and return to low-power mode.
If ADC readings are required frequently, consider sleep mode if the power consumption is acceptable and you want a simpler ADC path.
BR
Gyessine
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.
2026-05-15 2:23 AM
First of all, i really appreciate your care and attention to my problem. And the first thing i do is to inspect wiki-article examples as you suggest.
For rest, i did not want reset because in my logic there is also an additional option like if (for instance):
1) If 5A goes( for 2 sec) -->> Trip relay
2) If 5A goes(for 2 sec--) -->> Count 1
(+2 Ssec) --> Count =2 and then trip relay.
Simple logic but i have to count something and measure the duarion. So resettting the program will not be suitable for me. For now, i really thank you because i did not realise when program exit lowest modes like shutdown it restarts; i miss this part when inspencting datasheet. The most problematic thibg for me now is i have to draw PCB without experiencing these and if i have to connect something externally as an wake up source other than ADC or something, i have to manually modify my PCB. So, next step is inspecting more about codes, articles, examples. Thank you for clarifications.
BR.