RTC drift autonomo

Anyone did any work correcting the RTC clock drift on an Autonomo ?

Do you have any more details on this issue?

What I mean is that the clock (RTC) gains ~18 seconds in 11 days. I have seen a register that can be used to calibrate the RTC, just curious if you have experience doing this.

Looking at the schema, the oscillator has a +/-100ppm frequency tolerance.

The ~18s in 11 days is about a 19ppm drift.

The RTC module can apply a correction of up to +/-127ppm.

I’m not sure how you can calculate the required correction though. The value is most likely specific to each individual oscillator and it will likely vary depending on the operating temperature.

The oscillator is an external component connected to the SAMD21, and I don’t see any way of retrieving any factor calibration information for it.

To test it out you will want to set the RTC->MODE2.FREQCORR register.

The register should be set to the absolute value (maximum 7 bits) of the desired correction with the 8th bit set for negative values (can be done with a | RTC_FREQCORR_SIGN).

I believe you need to wait for synchronisation (while RTC->MODE2.STATUS.bit.SYNCBUS) before and after modifying the register.

thanks I will give this a go later

This register can be write protected, is that feature enabled that you know ?

I’ve not used the write protection features, however, it appears that write protection is controlled via the Peripheral Access Controller (PAC).