2017-03-24 04:35 AM
(ref:
AN4759)
Configuration 1 - able to achieve ~1ms but not exactly 1 ms.
Configuration 2 - not able to achieve 1 ms but successfully achieved 1s as the least period and can program in multiples of it.
2017-03-24 05:10 PM
You need to use a crystal which is an integer multiple of 1kHz, i.e. not the 32.768kHz crystal. 40kHz might be one of the options. The dividers then have to be adjusted accordingly.
JW
2017-03-29 01:16 AM
Thank you Jan.
I achieved 1 ms wakeup period by setting prediv_a as 36 and prediv_s as 0 using LSI 37kHz on the nucleo l152re.
LSI as RTC clock
Time base = ((36 + 1) * (0 + 1)) / 37Khz = 1ms2017-03-29 01:21 AM
The mistake i made was trying to set the prescalers without properly entering the Init mode. Rectified that and thus achieved 1 ms wakeup timebase.
I now have a question, my ck_spre clock frequency is 1 Khz. This ck_spre is the calendar clock.
What would be the effect on the RTC Time value?