RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
max.kviatkouski
Posts: 6
Joined: Fri May 11, 2018 6:39 pm

RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by max.kviatkouski » Mon May 21, 2018 7:33 am

Steps to reproduce:
1. Enter REPL and set RTC time to be same as time on PC (I'm using Ubuntu)
2. Wait for ~10 minutes (either remaining in REPL and connected to USB or disconnect and use backup battery (VBAT))
3. After 10 minutes PyBoard RTC is 15-20 seconds behind my PC clock.

>>> os.uname()
(sysname='pyboard', nodename='pyboard', release='1.9.4', version='v1.9.4-46-g3ea0862a on 2018-05-21', machine='PYBLITEv1.0 with STM32F411RE')

Please kindly let me know if there is anything to diagnose/fix.

Thanks,
Max.

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by shaoziyang » Mon May 21, 2018 9:22 am

Maybe 32K crystal is inaccurate.

max.kviatkouski
Posts: 6
Joined: Fri May 11, 2018 6:39 pm

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by max.kviatkouski » Mon May 21, 2018 4:26 pm

Is there any way to deal with it?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by pythoncoder » Mon May 21, 2018 5:37 pm

I can confirm this. On mine the error is 3.8%. This is much greater than is plausible from a crystal oscillator - I have a vague recollection that the PyBoard Lite uses a resonator in place of a crystal as a cost saving measure.

Pyboard V1.1 and V1.0 use a crystal which can be calibrated to within ~2 mins/year (+-0.0004%). The only solutions I can see are to use a Pyboard or to use an external RTC such as the DS3231.
Peter Hinch
Index to my micropython libraries.

max.kviatkouski
Posts: 6
Joined: Fri May 11, 2018 6:39 pm

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by max.kviatkouski » Mon May 21, 2018 8:18 pm

pythoncoder wrote:
Mon May 21, 2018 5:37 pm
I can confirm this. On mine the error is 3.8%. This is much greater than is plausible from a crystal oscillator - I have a vague recollection that the PyBoard Lite uses a resonator in place of a crystal as a cost saving measure.

Pyboard V1.1 and V1.0 use a crystal which can be calibrated to within ~2 mins/year (+-0.0004%). The only solutions I can see are to use a Pyboard or to use an external RTC such as the DS3231.
Thank you very much! I just wanted to make sure that I'm not the only one seeing it. I'm writing a data logger. One of the options would be to compensate for this error by stretching timestamps based on reference time in the end of logging period after I've downloaded data.
Thanks again for your response!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by pythoncoder » Tue May 22, 2018 7:42 am

The DS3231 is cheap, highly accurate, and there is a driver for it.
Peter Hinch
Index to my micropython libraries.

chuckbook
Posts: 135
Joined: Fri Oct 30, 2015 11:55 pm

Re: RTC (Clock) is too slow on PyBoard Lite v1.0 with accelrometer

Post by chuckbook » Tue May 22, 2018 3:28 pm

It should be mentioned that PYBLITE doesn't use a crystal for the RTC but an RC oscillator. However, it is pretty easy to solder in a TH crystal.

Post Reply