2020-11-23 01:38 AM
Hey,
If a power off occurs, I would like that the RTC function will keep alive, until Power on.
As I understand, i should connect a coin battery 3.0 to VBAT pin.
My questions are:
2020-11-23 04:38 AM
Your 3rd question consists of three sub-questions:
When your question is answered, please close this topic by choosing Select as Best.
Good luck!
/Peter
2020-11-23 05:30 AM
Hey peter
maybe my explanation wasn’t clear enough.
The RTC will work continuously.
The purpose is to use the Battery power only when the system powered down.
this is the reason why I asked if VBAT should be connected to P3V3 and P3V_battery at the same time with diode for example, or only to battery, and when power on the energy will consumed internally from VDD (P3V3).
Moreover, I’m afraid that current from battery will leak to the periphery powered from P3V3 (VDD) when power is off, through the MCU.
2020-11-23 05:51 AM
Just connect the backup battery or supercapacitor to VBAT if the RTC shall run continously, it will not supply the MCU when VDD is absent, i.e. VBAT definitely only powers the VBAT domain.
I forgot to mention that the VBAT domain only draws current from VBAT when VDD is absent, because the VBAT switch is open when VDD is present. This significantly extends the battery or supercap life.
2020-11-24 09:54 AM
When I turned on the RTC function in CubeMX, the power calculation was 250nA without periphery. When I turned on the RTC it jumped to 2.5-3.5uA, depends on LSE high drive, low drive, medium high, medium low.
2020-11-24 10:37 AM
The current consumption of the RTC depends on several parameters: the voltage at VDD, the temperature, the clock being used or the selected drive strength for the LSE.
You will find its parameters in the datasheet of the STM32 in a table like Low-speed external user clock. The 4 options give some idea about the power the LSE oscillator pumps into the crystal. Please carefully read the extremely helpfull application note AN2867 (Oscillator design guide for STM8AF/AL/S, STM32 MCUs and MPUs) for more information about this behavior.