2021-08-16 04:23 PM
I've been trying to implement a clock and calendar into my solar tracker project(using an stm32f103) so that I can set at which time it should go to sleep ( and for how long) , but every time the board goes into standby the counter -unfortunately- gets reset. To counter act that, I tried writing the values of the counter register into the backup registers (which worked just fine) writing these values back to the counter registers turned out to be quite a hassle however, and it just never seemed to work for me. I did disable the write protection and enabled the CNF bit mind you, but their values just wouldn't change .
Solved! Go to Solution.
2021-08-17 10:11 AM
I solved this issue by turning off the LSE first (RTC clock) before modifying the value of the counters. I noticed that when i was modifying the values of the counter it just resets them so it had to be that , and it was fortunately!
2021-08-16 04:38 PM
From the reference manual:
To write to this register it is necessary to enter configuration mode (see Section 18.3.4: Configuring RTC registers).
Did you do that?
Next time please include the chip number in your post.
2021-08-16 04:39 PM
yes, I did and the chip is the f103
2021-08-17 10:11 AM
I solved this issue by turning off the LSE first (RTC clock) before modifying the value of the counters. I noticed that when i was modifying the values of the counter it just resets them so it had to be that , and it was fortunately!