about RTC calibration! by use for LSI clk. (STM32F091V)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 6:40 PM
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.
Solved! Go to Solution.
- Labels:
-
RTC
-
STM32CubeMX
-
STM32F0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 11:51 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 11:51 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-25 11:11 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-25 11:46 PM
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.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-25 11:47 PM
If you chose the LSI as RTC input, you can compare it to the system clock using TIM14, see TIM14_OR.
JW
