Pico Micropython overclocked twice (250MHz) works fine

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Tatito
Posts: 5
Joined: Tue Apr 27, 2021 3:58 pm

Re: Pico Micropython overclocked twice (250MHz) works fine

Post by Tatito » Thu Apr 29, 2021 10:43 pm

Programs are indeed running x2 faster with firmware.250MHZ.uf2. Thanks for providing this!

One observation: this is true if the program is launched from Thonny (Thonny can then be closed and the program keeps running fast). However, the same program saved as main.py and launched by just powering the Pico anew runs at the standard (twice lower) speed. With the conventional firmware installed, both modes of launching lead to the same (twice lower) speed.

I am new to micropython. Is there an obvious reason for the above? Looks counterintuitive to me, but I ran several tests. Is there something that can be added to main.py to have it run x2 faster in standalone mode? (e.g., with the Pico powered by batteries).

Thanks

Online
User avatar
Roberthh
Posts: 2689
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Pico Micropython overclocked twice (250MHz) works fine

Post by Roberthh » Fri Apr 30, 2021 6:08 am

I do not know of a specific firmware.250MHZ.uf2. You set the frequency with the generic v1.15 firmware at each startup, like in main.py. So add to main.py:

import machine
machine.freq(250_000_000)

If you look through the forum, you will also find hints to use even higher frequencies.

Tatito
Posts: 5
Joined: Tue Apr 27, 2021 3:58 pm

Re: Pico Micropython overclocked twice (250MHz) works fine

Post by Tatito » Fri Apr 30, 2021 6:08 pm

That firmware was linked in the opening post in this thread. Your suggestion solved the issue, thanks! (interestingly, it works for generic firmware: for firmware.250MHZ.uf2, machine.freq expects no arguments, i.e., can only be used to read the clock rate, not to modify it).
Thanks again for your help, it allowed me to finish off my little project :-) This is a great forum!

Post Reply