2019-11-14 01:56 AM
Hello,
I have a system using STM32F100RBT needs wake up from standby mode every second.
Some operations it conducts when it wakes might take longer than a second.
Each time before going to sleep, I read the current RTC time, and set an alarm for this time + 1 second.
The problem is that the RTC resolution is 1 second, and this is also the interval I'm waiting.
I need to avoid a time race, where an RTC second increases just between reading the RTC and going to standby.
One option is, assuming the system won't be awake longer than an hour, to use the systick milliseconds, and be stuck in a busy-wait before reading the RTC, if (systick % 1000 > 990) (having a 10ms buffer).
This will work only if I'm guaranteed that the systick starts ticking the moment RTC reaches a full second (or with a small, but constant delay, without an accumulating error).
Thanks!
2019-11-17 11:51 PM
Anyone? :)
2019-11-18 08:41 AM
Unfortunately you keep opening threads on materially the same topic, and I haven't used F1 series parts actively in a decade, and used a different library. I have relatively little interest is reopening that can of worms in an unpaid capacity.
a) Remember the last Alarm point, and advance that number.
b) Use a different prescaler so the 32-bit RTC count has a finer granularity.
2019-11-19 01:21 AM
First of all, thank you!
these topics, while similar in dealing with RTC on a 1 second level, are all different in their specific question, and were opened at different times after I found some temporary workaround:
This is to attract a quick, direct answers, rather than a long, developing correspondence, and help future users with their search.
Is there a different approach on these forums?