August 2007 Rev 1 1/14
AN2604
Application note
STM32F101xx and STM32F103xx RTC calibration
Introduction
The real-time clock (RTC) precision is a req uirement in most embedded applications, but
due to external environment – temperature change, frequency variation of the crystal that
clocks the RTC – the RTC precision may not be as a ccurate as expected.
The RTC embedded in the STM32F101xx and STM32F103xx comes with a digital clock
calibration circuit suitable for manufacturing environments, that allows applications to
compensate f o r crystal and temperatur e v ariations. This a pplication note d iscusses the R TC
calibration basics and explains how RTC calibration can be used to improve timekeeping
accuracy.
www.st.com
Contents AN2604 - Application note
2/14
Contents
1 R TC calibration basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Crystal accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Calculating the needed amount of calibration . . . . . . . . . . . . . . . . . . . 10
3 Calculating calibration over a temperature rang e . . . . . . . . . . . . . . . . 11
4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13