How to calibrate ( RTC )LSE Crystal by temperature ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-09 10:44 PM
I ' ve been working on a device that able to use industrial area. I must be sure that rtc clock is accurate because this device need to use RTC too much. When i researched , i did not find any code example about rtc calibration by temperature. Any suggestion, would be appriciate.
- Labels:
-
RCC
-
RTC
-
STM32G0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-10 12:28 AM
A correction of the LSE is only possible with the calibration functions of the RTC (see e.g. reference manual: RTC smooth digital calibration, availability depends on the derivative).
A temperature-dependent correction requires knowledge of both the exact current temperature and the temperature depending curve shape of the crystal frequency including the load capacitors, etc., which is why no general recommendation can be given.
Good luck!
If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-10 1:46 AM
Generally, you would need to
- have a method to measure temperature of the crystal, e.g. using a thermistor placed so that thermal resistance between it and crystal is way less than thermal resistance of any thermal path which would heat or cool the crystal (this is the "know exact temperature" part mentioned by Peter above)
- have a good characterisation of the temperature dependence of crystal frequency, either from manufacturer, or by characterizing it yourself. In the latter case, you could either perform the characterization once and have faith in that production pieces don't depart from that curve too much; or perform individual factory calibration
- characterize impact of aging, perform artificial aging if needed
- write the program so that it periodically measures crystal temperature and performs corrections - whether by calculating and performing time shifts, or by using the "digital calibration" as Peter suggested
Or, you can simply buy a TXCO or an external RTC with integrated temperature-compensated crystal, where all this has been already done by the TXCO manufacturer.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-13 1:12 AM
Thank you all, but still i confused. I have a few questions.
- am I must be read RTC calibration output (1Hz) via input capture ?
- How can i implement temperature curve into calibration ?
I am wondering if temperature was changed, the RTC output(1Hz) would be change is not it ?
Why am i need to the tempereature curve ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-13 2:44 AM
You could use synchronization with a 1Hz signal (but you don't have to) if you have a very precise reference signal, e.g. the 1PPS of a GPS receiver.
If you want to correct the crystal according to the current temperature, you first need the temperature curve of the crystal, which heavily depends on the manufacture (quartz cut). Usually you can get it from the manufacturer of the crystal, or you have to characterize the curve, as Jan mentioned above. For more information on the temperature curve of crystals, you can take a look at the AN2971, for example, which deals with a different method of compensation, but shows the principle of the temperature curve well.
Then you have to know the exact temperature of the crystal, also depending on the requirements.
Then you could write a program that e.g. does a running smooth calibration and thus fades out or adds individual pulses of the LSE frequency.
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-13 3:00 AM
I cannot figure out PPS stuff , do i calibrate by temperature without reading 1hz signal from RTC out ? I dont use GPS in this project
