cancel
Showing results for 
Search instead for 
Did you mean: 

Where is STM32 RTC counter value? (Not F1 family)

Martijn Jonkers
Associate II
Posted on December 08, 2016 at 20:29

Hi,

In the scheduling system we use we need a simple 32kHz low power counter value. 

Exactly like in the stm32F1 family is present.

But in any other family, the RTC registers are replaced by Time and Date registers.

I am able to covert the Time register back to a counter value that overflows every 24 hours and add the number of days.

This way I can get a 32 bit counter value running at 32kHz.

But it is an enourmous hassle and it takes a lot more processing time than needed.

Is there a simple way to get a low power 32kHz counter value, so we can use it for our scheduling?

We aim to disable the HSI/HSE/PLL clocks when no tasks needs to run, but keep de Low power LSE/LSI running to wakeup from stop mode.

We do not need any timestamp values like year month day hour minute second.

Thank you!

11 REPLIES 11
Posted on December 21, 2017 at 14:55

Thanks for bumping this post, I can't believe how incredibly awesomely it demonstrated my point...

The primary rule is being divisible by 4.

If it is divisible by 100 but not 400 is is not.

2000 % 4 == 0

2000 % 400 == 0

1901 .. 2099 being very simple to implement in silicon due to (year % 4) being easy to implement, and the only test needed in that range.

Beware of code written and tested by idiots.. They do the stupidest things at the most inappropriate times..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..