RTC Calibration question

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

RTC Calibration question

Post by JimTal001 » Thu Nov 05, 2015 2:18 pm

Is there a way to make the RTC calibration value persist through power cycles with VBAT un-powered.?

Now that I have a determined my pyboard RTC needs to be adjusted by a value of -129, what is the best way to apply this adjustment?
I was under the impression that once the correction was applied via: rtc.calibration(-129) it would persist through power cycles with VBAT un-powered, I was wrong.

Maybe the only solution is to add the following lines to boot.py:

Code: Select all

rtc=pyb.RTC()
rtc.calibration(-129)

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: RTC Calibration question

Post by blmorris » Thu Nov 05, 2015 4:00 pm

I think you have the right answer. Without power or VBAT you only retain what you have stored in flash (or the SD card). Everything else - RTC time, backup RAM and backup registers - is lost. The RTC calibration register is just another RAM address, albeit one that implements a specific write protection method and is backed up by VBAT.
Other than that, are you finding that the RTC calibration lets you lock in the precision you need?
-Bryan

JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

Re: RTC Calibration question

Post by JimTal001 » Thu Nov 05, 2015 7:40 pm

Thanks Bryan,

Code: Select all

Other than that, are you finding that the RTC calibration lets you lock in the precision you need?
So far so good.

Post Reply