2024-02-26 07:55 AM
Hi everyone,
I'm using a STWINBX1.
Some documentation say that RTC can be plug to Vbat. In my case, my board won't be plug to current and will only work with a battery.
My question is simple, is RTC can "remember" date and time if the battery run out of energy ?
I read that some RTC on modern computer can work without battery, with a crystal. But I can't find a similar information for my board.
Thanks
Solved! Go to Solution.
2024-02-26 09:28 AM - edited 2024-02-26 09:36 AM
Hello,
Most of STM32 MCUs have Vbat pin on which you can connect a battery or supercapacitor.
This is an example from STM32L476-EVAL board:
If JP12 position is 2-3. Vbat pin is connected to the battery.
Internally, there is an internal power switch that controls which power supply will feed the backup domain (that includes RTC) and there is a power low level detection mechanism that monitors VDD. If VDD is available, backup domain is powered from VDD, but if the latter is lost, the switch status changes and will let backup domain to be powered from Vbat (battery).
PS: you can connect CR2032 to Vbat pin.
2024-02-26 08:18 AM
An RTC always requires a power source, even the modern computers you mentioned. There, a 2032 is usually the power source and usually lasts for the entire utilisation time, so that the normal user does not notice its presence.
Embedded systems therefore also require a power source, for which the VBAT connection is intended. If VBAT is connected directly to VDD for reasons of simplification, the RTC will forget the set time and date information.
Hope that answers your question?
Regards
/Peter
2024-02-26 08:23 AM
As an alternative to battery, in some cases a supercapacitor can be used (with all the consequences - limited run time and requirement to charge, mainly).
JW
2024-02-26 08:32 AM - edited 2024-02-26 08:54 AM
Thanks !
2024-02-26 09:04 AM
« If Vbat us connected directly to Vdd »
im a newbie in electronics, but there is others possibilities ?
And St have both design ? Like
RTC connected to a 2032
or
RTC connected to Vdd who is connected to Vbat ?
I guese I can find that information in the datasheet of the MCU ?
2024-02-26 09:28 AM - edited 2024-02-26 09:36 AM
Hello,
Most of STM32 MCUs have Vbat pin on which you can connect a battery or supercapacitor.
This is an example from STM32L476-EVAL board:
If JP12 position is 2-3. Vbat pin is connected to the battery.
Internally, there is an internal power switch that controls which power supply will feed the backup domain (that includes RTC) and there is a power low level detection mechanism that monitors VDD. If VDD is available, backup domain is powered from VDD, but if the latter is lost, the switch status changes and will let backup domain to be powered from Vbat (battery).
PS: you can connect CR2032 to Vbat pin.
2024-02-26 10:09 AM
Thanks you so much for this accurate answer !
I definitely need to work on my electronics skills in order to design my software
2024-02-27 12:21 AM
I checked both datasheets of my MCU (STM32U585xx) and my Board (STEVAL-STWINBX1), and there is no mention of "2032".
When you say "PS: you can connect CR2032 to Vbat pin.", you mean that we can physically add something to the hardware ? Or there is some software feature to use a 2032 that is already installed ?
2024-02-27 12:38 AM - edited 2024-02-27 02:11 AM
CR2032 is just an example. The board may not contain a battery and Vbat is connected to VDD by HW. My comment was regarding the MCU itself where you need an external voltage source like a battery or supercapacitor and there is no software configuration to set or indicate the voltage source.
2024-02-27 02:12 AM
My board contain a battery. I checked the power supply schemes of my MCU and
"VBAT is the power supply for RTC, (through power switch) when VDD is not present."
There is no mention of external voltage source.
So if I understand, If I can't add CR2032 (or equivalent), I can't have guarantee to hold date/time if my battery run out of energy ?