cancel
Showing results for 
Search instead for 
Did you mean: 

about RTC calibration! by use for LSI clk. (STM32F091V)

Ukazu
Associate III

I use STM32F091V

I use LSI for RTC clock.

I know that LSI is inaccurate.

I set the RTC interrupt to 1 second.

However, the interrupt interval was 860ms.

Can anyone tell me how to calibrate the RTC?

I am happy with the sample source code.

1 ACCEPTED SOLUTION

Accepted Solutions

LSI is very imprecise an not very stable, see datasheet. You can somewhat compensate for this by setting different values to the RTC prescaler, but it's not suitable for maintaining real time. Use LSE with a crystal.

JW

View solution in original post

4 REPLIES 4

LSI is very imprecise an not very stable, see datasheet. You can somewhat compensate for this by setting different values to the RTC prescaler, but it's not suitable for maintaining real time. Use LSE with a crystal.

JW

Ukazu
Associate III

Hi jan!!

Thank you for your support.

In my system, the main clock is a crystal, so I will use this crystal to correct the RTC interrupt time.

Add the correction value to the RTC count value.

Alternatively, you can use directly the HSE output (divided by 32) as RTC input; of course you have then adjust the RTC prescaler values according to the actual crystal frequency.

0690X00000DXJfHQAX.png

JW

If you chose the LSI as RTC input, you can compare it to the system clock using TIM14, see TIM14_OR.

JW