2021-12-21 04:17 AM
How to convert Accuracy(ppm) to CALP&CALM values from Temperature-Accuracy graph from RTC Calibration by temperature ?
Solved! Go to Solution.
2021-12-21 05:50 AM
You're probably talking about Smooth Calibration right now, right?
It makes sense to carefully work through and understand the corresponding chapter "RTC smooth digital calibration" in the respective reference manual, especially because it also mentions other special features. For example, CALP cannot be set if PREDIV_A is less than 3.
In summary, the Smooth Digital Calibration works as follows:
The reference manual also mentiones the formula [1] for fCAL:
fCAL = fRTCCLK x (CALPx512 - CALM)/(2^20 - CALPx512 + CALM)
where CALP can have the value 0 or 1 and CALM is in the range from 0...511
If you change this formula, you'll get [2]:
ppm = (CALPx512 - CALM)/(2^20 - CALPx512 + CALM) * 10^6
This results in the following table with the most important key figures:
If you want to convert a given temperature (ppm) curve into the values for CALM and CALP, you have to do this in two steps:
Good luck!
/Peter
<edit>@TDK was faster... 😁 </edit>
2021-12-21 05:33 AM
Per the reference manual, CALP increases the frequency by 488.5 ppm and CALM decreases it by 0.9537ppm per count.
So if you want to adjust by +20ppm, CALP=1, CALM=468.5/0.9537=491.
2021-12-21 05:43 AM
Thank you so much i will test it.
2021-12-21 05:50 AM
You're probably talking about Smooth Calibration right now, right?
It makes sense to carefully work through and understand the corresponding chapter "RTC smooth digital calibration" in the respective reference manual, especially because it also mentions other special features. For example, CALP cannot be set if PREDIV_A is less than 3.
In summary, the Smooth Digital Calibration works as follows:
The reference manual also mentiones the formula [1] for fCAL:
fCAL = fRTCCLK x (CALPx512 - CALM)/(2^20 - CALPx512 + CALM)
where CALP can have the value 0 or 1 and CALM is in the range from 0...511
If you change this formula, you'll get [2]:
ppm = (CALPx512 - CALM)/(2^20 - CALPx512 + CALM) * 10^6
This results in the following table with the most important key figures:
If you want to convert a given temperature (ppm) curve into the values for CALM and CALP, you have to do this in two steps:
Good luck!
/Peter
<edit>@TDK was faster... 😁 </edit>
2021-12-21 05:50 AM
468,5 calculated by 488,5- 20 is not it ? if i want to adjust -15 ppm what should i do ?
2021-12-21 05:53 AM
> if i want to adjust -15 ppm what should i do ?
CALP=0, CALM = 15/0.9537
2021-12-21 06:48 AM
Nicely put, Peter.
I wonder, why such a straghforward explanation can't be part of AN4759. Yes, it's there, sort of; but as a practical example, your explanation above is IMO better than anything which is there.
JW
2021-12-25 12:20 AM
Is there a table listing CALP AND CALM value and ppm changes? I just want to get a quick table to look at. Thanks.
2021-12-25 07:51 AM