is the 32-kHz crystal necessary?

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
v923z
Posts: 168
Joined: Mon Dec 28, 2015 6:19 pm

is the 32-kHz crystal necessary?

Post by v923z » Wed Nov 15, 2017 10:01 pm

Hi all,

If I don't care about the RTC, do I need the 32-kHz crystal on the pyboard? I have to make my own board, because the pyboard is just a tad large, and I would like to strip everything that is not required. On the pyboard lite this crystal is optional. Apart from the target, and as far as the code is concerned, is there a difference between the pyboard, and its lite version? In other words, if I remove the crystal, and upload the pre-compiled firmware, is that going to work, or the RTC is linked to some very fundamental functions of the firmware?

Thanks,
Zoltán

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: is the 32-kHz crystal necessary?

Post by Damien » Thu Nov 16, 2017 5:58 am

The firmware will try to autodetect the presense of an external 32kHz crystal (LSE). If the LSE fails to start then the firmware will fallback to the LSI setting (internal osc). So, to answer your question, if you remove the crystal and use the pre-complied PYBv1.x firmware then it will (or at least should!) just work. The RTC will work but may be a little off due to inaccuracies of the LSI.

If you want to build your own firmware then you can change mpconfigboard.h to have "#define MICROPY_HW_RTC_USE_LSE (0)" which will disable LSE and use LSI only.

v923z
Posts: 168
Joined: Mon Dec 28, 2015 6:19 pm

Re: is the 32-kHz crystal necessary?

Post by v923z » Thu Nov 16, 2017 7:40 am

Damien wrote:
Thu Nov 16, 2017 5:58 am
The firmware will try to autodetect the presense of an external 32kHz crystal (LSE). If the LSE fails to start then the firmware will fallback to the LSI setting (internal osc). So, to answer your question, if you remove the crystal and use the pre-complied PYBv1.x firmware then it will (or at least should!) just work. The RTC will work but may be a little off due to inaccuracies of the LSI.
OK, this sounds good. Much better than I expected. Thanks!
Damien wrote:
Thu Nov 16, 2017 5:58 am
If you want to build your own firmware then you can change mpconfigboard.h to have "#define MICROPY_HW_RTC_USE_LSE (0)" which will disable LSE and use LSI only.
Well, while this is a useful piece of information, this is what I would like to avoid. The benefit of making the board itself pyboard-compatible is that one can just grab the pre-compiled firmware from the website. That is always up-to-date, and very convenient.

Zoltán

Post Reply