2022-05-18 02:58 AM
Hi there,
On a battery-powered board using the STM8l050J3, in order to reduce at the minimum the power consumption, in Active Halt mode and using RTC wakeup, (at a few tens or at most hundreds of uA) as indicated, I want to disable Vrefint.
To do so, during initialization, I use this sequence of commands:
---
PWR_DeInit();
PWR_PVDCmd(DISABLE);
PWR_UltraLowPowerCmd(ENABLE);
PWR_FastWakeUpCmd(ENABLE);
VREFINT_STATUS = PWR_GetFlagStatus(PWR_FLAG_VREFINTF);
---
... but the VREFINT_STATUS, used only for a verify, return that Vrefint is always SET (value = 1)
Thanks a lot for any suggestion.
Sisto
2022-06-14 05:54 AM
Hi!
When you wakeup from active halt mode to read the register about VREFINT status, or before you execute the halt instruction, the VREINT will automatically be enabled. This is why you always read it as 1, on.
So, the voltage ref. will only be disabled when the CPU is in one of the 2 halt modes, after yuo execute halt instruction.