cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to create an Exact 1ms wakeup period using RTC in Stm32l1 series controller? if yes, How it can be done? 

Posted on March 24, 2017 at 12:35

(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.

3 REPLIES 3
Posted on March 25, 2017 at 01:10

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

Posted on March 29, 2017 at 08:16

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 = 1ms
Posted on March 29, 2017 at 08:21

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?