2024-12-01 07:51 PM
I am planing to have a time functionality on a project I want to make.
After reading the manual I undestood I have a 32 bit counter which increases with TR_CLK.
Let's say I want to update the clock every 1ms, that would leave me with aproximately 49.5 days of clock, which is not enough.
Did I understood correctly? Is this how it should be used?
What should I do to save more time? Should I manually save time into flash or smth?
I've seen some "Calendar" functionality on CubeMX so I guess something is possible (I'd like to stay out of HAL functions)
Thanks in advance, best regards.
2024-12-02 12:09 AM
Normally, RTC is clocked from a 32.768kHz crystal and you program the prescaler so, that TR_CLK increments the counter itself once in a second, that gives you some 136 years of time.
The 32.768kHz input frequency cannot be prescaled to 1kHz. You can use HSE/128 as input to RTC, but that can't run under VBAT alone.
JW