2025-03-04 7:26 PM
I am using TIM2 to create PWMs for LEDs. When I enter STOP mode I expect the PWM to stop. Yet it does not. From the manual TIM do not have wakeup capability from stop mode. So they should not be requesting the HSI to operate.
What could possibly cause the HSI to continue to operate in STOP mode. I am waking in 5s from RTC. during this whole time and continuously uninterrupted as far as I can tell the PWM keep going. Shouldn't they stop?
HSIKERON is 0.
Solved! Go to Solution.
2025-03-10 4:10 PM
Hello Carl_G,
Thank you for your observation regarding the behavior of TIM2 and the HSI in STOP mode. Based on the information provided from our G0 reference manual, there are some points to be considered when using low-power modes:
I hope this answer meets your needs. If you have any further questions or need additional assistance, please feel free to reach out.
2025-03-04 8:38 PM
Seems setting the debug in STOP mode can cause this. It allows the "internal RC oscillator" clock to feed FCLK and HCLK. While it is unclear exactly which internal RC oscillator they mean, it would seem this is the culprit. Turning this feature off allows the HSI or at least TIM2 to stop. This should probably be listed in the RCC and/or PWR section as a caveat.
2025-03-10 4:10 PM
Hello Carl_G,
Thank you for your observation regarding the behavior of TIM2 and the HSI in STOP mode. Based on the information provided from our G0 reference manual, there are some points to be considered when using low-power modes:
I hope this answer meets your needs. If you have any further questions or need additional assistance, please feel free to reach out.
2025-03-13 11:43 AM
I get that the info is available and a programmer will eventually find it. Also I somewhat misstated TIM2. Tim2 didn't stop because I didn't stop it. It's still enabled and waiting on any clock pulses that happen to feed it.