2025-05-11 7:29 AM
Hi all,
I'm building a discharger using my STM F446RE, such that it's RTC registers are used to store data that'll be loaded to set parameters in my code every time the discharger is plugged into the power. Just to clarify - I'm NOT using the RTC as a clock, I just use it's registers to store data.
For a reason I don't understand, the RTC's registers get cleared (i.e. all data is set to 0) every time the discharger is unplugged from the power. I saw that plugging a battery to the Vbat pin helps keep the RTC consistent, but my superior claims that it's actually not needed in this case, because I'm only using the RTC's registers and not the clock itself (so the data should be saved regardless of power connection).
Is my superior correct, and there's a way to solve this without plugging a battery to the Vbat pin, or is he wrong and the Vbat pin must be fed a battery for the RTC to save it's register's data?
Thanks in advance for any help on the subject!
Solved! Go to Solution.
2025-05-11 10:33 AM
Correction: His statement is not completely wrong, because data can also be written to flash, where it is retained without a power supply. This is particularly easy with the family with EEPROM, but with other families the special features of flash must be taken into account.
However, if you want to use the RAM of the backup domain, a voltage at VBAT is absolutely necessary as soon as VCC fails.
2025-05-11 7:33 AM - edited 2025-05-11 10:33 AM
Welcome @nivg, to the community!
short answer: he is wrong.
The backup domain (see reference manual) requires an external battery connected to VBAT.
Regards
/Peter
2025-05-11 10:33 AM
Correction: His statement is not completely wrong, because data can also be written to flash, where it is retained without a power supply. This is particularly easy with the family with EEPROM, but with other families the special features of flash must be taken into account.
However, if you want to use the RAM of the backup domain, a voltage at VBAT is absolutely necessary as soon as VCC fails.
2025-05-12 3:04 AM
Thanks Peter! Both for the quick and direct answer and for the kindness