cancel
Showing results for 
Search instead for 
Did you mean: 

RTC calibration by Temperature using smooth calibration

oziesin
Associate III

I dont know how to calibrate rtc by temperature, i confused. When I look at RTC smooth calibration method like this, I thouht that i understand. After that i encountered AN2604 application note and i confused again.

I cannot understand 2nd section in AN2604. How to calculate 512Hz ?

Do I measure RTC Calib output( 1Hz or 512 Hz )?

Any practical advice , make me happy so much.

0693W00000HoP2oQAF.png 

4 REPLIES 4

> Do I measure RTC Calib output( 1Hz or 512 Hz )?

Yes. Some STM32 allow to output LSE on MCO/LSCO pin, if you use such, you can use that pin, too. It is expected that you have a precise timebease and precise enough instruments to measure 1Hz/512Hz/32768Hz with precision you require (i.e. a few ppm).

Then you calculate the deviation between expected (say 512Hz) and actually measured frequency, and use that to calculate the required value for the calibration, as described in the RTC chapter of RM for your STM32.

Don't try to measure frequency *after* applying calibration, unless you exactly know what are you doing (you have to measure it across the whole window where the calibration is applied, typically 32s) else you will get confusing results.

AN2604 is for STM32F1xx. RTC in 'F1 is different from all other STM32 models, so the description there may be confusing. Read AN4759.

JW

oziesin
Associate III

Thank you for interest.

oziesin
Associate III

Could you please guide me for temperature calibration. I have read AN 4759 and I still confused . I dont know how can i integrate graph ?0693W00000HoYPmQAN.pngFor example i calculate this acc value for me but how will i continue ?

Lastly, RM does not include any guide for calibration by temperature

If you give practical guide or example code , would be appreciate, i dont need theoretical documents. I don't want to be that know rtc calibration , i want to be that able to rtc calibration.

Thanks.

acc is the error in ppm for given temperature. Note, that the formula and values above are only examples and don't necessarily apply to your particular crystal and setup.

Now you take that acc value for any given measured temperature, and use it for the smooth calibration, as described in the RTC smooth digital calibration subchapter of RTC chapter of RM for your STM32.

But first start with just setting up RTC, perhaps on a Nucleo or Disco board, and learning how to measure the actual LSE frequency, at room temperature. Then - still at room temperature - learn how to apply smooth calibration, and how can you measure the effect of it on the output of RTC. Then learn how to measure temperature of the crystal. Finally add all these together.

JW