cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f373 internal RTC with LSI clock

Sowmya BR
Associate
Posted on January 11, 2017 at 12:21

Hello,

I am using LSI clock(40KHz) as the RTC clock source and enabled the LSI using the 

RCC_LSICmd(ENABLE);

I configured the RTC registers and the time is leading to the real time.

Initialised the RTC:

RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;

RTC_InitStruct.RTC_AsynchPrediv = 99;

RTC_InitStruct.RTC_SynchPrediv = 399;

RTC_Init(&RTC_InitStruct);

Can any one tell, how can I generate an RTC interrupt for every 1 second? 

And also do am I missing any configuration in clock and prescaler setting?

Regards,

Sowmya

#rtc #stm #stm32f373 #stm32f373-rtc
1 ACCEPTED SOLUTION

Accepted Solutions
Khouloud GARSI
Lead II
Posted on January 11, 2017 at 17:16

Hi 

Sowmya,

Please refer to the 'RTC_LSI' example available under the SPL package:

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32108.html

 (V1.2.3).

The example is found under the path below:

'en.stm32f30x_dsp_stdperiph_lib\STM32F30x_DSP_StdPeriph_Lib_V1.2.3\Projects\STM32F30x_StdPeriph_Examples\RTC'

Khouloud.

View solution in original post

3 REPLIES 3
Khouloud GARSI
Lead II
Posted on January 11, 2017 at 17:16

Hi 

Sowmya,

Please refer to the 'RTC_LSI' example available under the SPL package:

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32108.html

 (V1.2.3).

The example is found under the path below:

'en.stm32f30x_dsp_stdperiph_lib\STM32F30x_DSP_StdPeriph_Lib_V1.2.3\Projects\STM32F30x_StdPeriph_Examples\RTC'

Khouloud.

Posted on January 11, 2017 at 18:10

There doesn't look to be a 1HZ per-se, you have two alarms, and the Wake Up. You can get have it wake up once per second.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 12, 2017 at 11:10

Thank you for the reply.

Changed the code by referring example and it is working.

But there is a 30seconds lag in time.

How can I fix it?