2023-09-10 11:47 AM
Hi, I am planning to use stm32g030f6 and also use RTC peripheral with super cap to keep date. However, this IC does not have VBAT pin. Reading datasheet said, that RTC domain can also be supplied from VDD/VDDA pin, but this means that when a voltage supply interrupt, the mcu will not detect and it will start using super cap energy from VDD/VDDA pin, so, the purpose to target only rtc supply energy with super cap is compromised.
Could you clarify if my assumption is correct, and how to achieve my design (super cap supplying energy to rtc when main voltage is down)?
Solved! Go to Solution.
2023-09-10 12:38 PM
The data sheet not only mentions that VBAT is bonded to VDD/VDDA in package variants without a dedicated pin. For an independent supply of the VBAT domain incl. RTC, however, a separate pin is absolutely necessary. Conversely, this means that you cannot use a package TSSOP20 and must use the LQFP48 (or another STM32) if the RTC is to be supplied independently.
Does this answer your question?
Regards
/Peter
2023-09-10 12:38 PM
The data sheet not only mentions that VBAT is bonded to VDD/VDDA in package variants without a dedicated pin. For an independent supply of the VBAT domain incl. RTC, however, a separate pin is absolutely necessary. Conversely, this means that you cannot use a package TSSOP20 and must use the LQFP48 (or another STM32) if the RTC is to be supplied independently.
Does this answer your question?
Regards
/Peter
2023-09-10 01:06 PM
Hello @JCuna.1
I confirm your proposition and I suggest you to use another MCU such as the STM32G030CxT if you want to have an independent power source for the RTC.
Best regards.
II
2024-02-09 12:10 AM
Hi Peter,
I was looking for the answer to the same question. I will use STM32G030K8T6, it does not have a Vbat pin. I made a circuit as shown in the picture for the Vdd input and thought of connecting a super capacitor. I am thinking of reading the VDD interruption with a GPIO pin (via an external interrupt) and putting it into standby mode when I detect this falling edge (that is, when the VDD is interrupted). In this case, the super capacitor will come into play. I think the Vbat pin, which is internally connected in this way, feeds the RTC domain. Does this idea make sense? I'm undecided whether to switch to another cover or try this idea.
2024-02-09 12:35 AM
@acerd1 In your case, the STM32G030K8T6 would still be supplied if VDD fails and should be able to recognise the interruption via the Schmitt trigger of the GPIO pin. As long as the power supply is off, the supercap supplies VDD and, in the case of the STM32G030K8T6, also VBAT. You should therefore dimension the supercap sufficiently so that it can bridge the expected interruption time at the expected ambient temperature.
You will probably use a Schottky with the diode shown, right? Also consider the reverse leakage of this diode, which is added to the VDD current consumption when the supply is off.
2024-02-09 12:51 AM
Yes I will use BAT54WS-7-F. This is schottky diode. I'm thinking of putting it in standby mode so that it doesn't feed Vdd in case of a power outage. Actually, this is a device powered by 230VAC. I designed a 230VAC - 3.3VDC converter. I created a test point at the output of the bridge diode I used for 230VAC and named it VIN. I also read VIN with a voltage divider.
Power_down goes to MCU GPI pin. I plan to configure it as the SysWakeup pin and use it both for waking up from standby and as an external interrupt. According to my plans, the event will briefly occur as follows: When 230VAC is cut off (power goes out), I will detect this with Powerdown. Because it will switch from Logic H to Logic L. I can read this with the falling/rising edge. I will also read the pinstate in the callback function. I will set the flag accordingly. It is currently on standby. When the power comes on, this powerdown pin, which I think of as wakeup, will wake up the system and continue working.
This is the scenario I planned. I can now use the pin that I set as syswakeup as gpio input in main.c. I'll try to set it up as an interrupt. If there is a mistake in my thinking, I would like to hear your suggestions.
2024-02-09 02:12 AM
This should actually be feasible if VIN is the same voltage as +3v3. Otherwise it could be that you inject a current into the GPIO via VIN while MCU_VDD is connected to an almost discharged supercap, for example.
2024-02-09 02:41 AM
Actually, VIN is not +3v3. Approximately 5V but I use a voltage divider. But I understand. Thank you so much really