cancel
Showing results for 
Search instead for 
Did you mean: 

RTC and battery

Pkats.1
Associate II

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:

  1. when power is on, does the VBAT PIN supplies from VDD (P3V3) or from the VBAT connected? Or should I connect both on the same line with diodes
  2. when power goes low, the switch is automatically?
  3. in case I want only the RTC function when power off, what is the current consumption? Is the 32khz oscillator is used? So the 32khz oscillator should be supplied from vbat too?

5 REPLIES 5
Peter BENSCH
ST Employee
  1. Vbat is only supplying the Backup Domain incl. the RTC when VDD is absent. This is performed using an internal switch (transistor) and described in the datasheets in section "VBAT operation". You don't need any diode to connect VBAT.
  2. Correct.

Your 3rd question consists of three sub-questions:

  • When activated, the RTC will normally run permanently i.e. either supplied by VDD or while by Vbat if present. You need to disable the RTC if you really want it running only while VDD is absent, which sounds strange, but could be achieved using an interrupt from the PVD (Programmable Voltage Detector).
  • The RTC consumes about 400...800nA depending on the STM32H7 (with/without LDO, etc), the voltage at VBAT, the clock source and the temperature. Further details can be found in the datasheet of the relevant STM32H7 at e.g. Typical and maximum current consumption in VBAT mode.
  • The RTC can be clocked from different sources: internal and external. It makes sense to clock it with sources that are independent of VDD: LSE or LSI. The LSI is independent from the high speed clocks and very useful for the IWDG (Independent Watchdog), but very inaccurate. So use the LSE if you need some accurate and predictable clock. And yes, this LSE would be supplied by VBAT too.

When your question is answered, please close this topic by choosing Select as Best.

Good luck!

/Peter

In order 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.

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.

Peter BENSCH
ST Employee

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.

In order 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.

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.

  1. what is the difference between the 4 options?
  2. why the current jumped from 400-800nA to 3uA?

Peter BENSCH
ST Employee

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.

In order 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.