2023-05-08 07:47 AM
I do have time working but it will reset each time when I power it off. I do have the backup battery connected.
I thought that it is supposed to keep working on battery and I guess it does.
But I guess I might be missing a few lines to read registers and update the time once power in back on.
2023-05-10 01:39 PM
I am trying your code but I do not know where rtc_state is coming from, it says undeclared identfier
2023-05-10 03:14 PM
All of these "restoring" ideas and magic values is a complete nonsense. Instead just read the following Jan's articles:
2023-05-10 08:27 PM
I use it for traceback RTC initialize step on every each restart.
I just don't want to debug for every time of reboot it.
2023-05-11 07:24 AM
Thanks for the code, I did not have to change anything just a few new lines. I did not noticed that opening and closing curly bracket are in the user code area and I thought that it would reset the clock each time.
I checked. it works fine the time still counting after power off/on
2023-05-11 02:02 PM
Actually all you had to do is just check a single bit as written in the links presented below.