viewtopic.php?f=144&t=299523
Can I overclock?
The maximum clk_sys clock speed is 133MHz at normal core voltage (1.1V ±10%), but it can be overclocked. However, this requires more power and a higher core voltage, and may affect the life expectancy of your device. No warranties are given when running outside of the limits specified in the datasheet.
I used program q32.c for years to compare single core integer performance of different microcontrollers and CPUs. A week ago I adapted it to the Pico and found that Pico was faster than all Arduinos tested, but slower than the ESP8266:
viewtopic.php?f=145&t=300265&p=1804700#p1804700
Today I evaluated the Pico overclocking options using "set_sys_clock_khz(_, true)".
First there are frequencies (high and "low") that make /dev/ttyACM0 missing (after flashing the Pico):
Code: Select all
//set_sys_clock_khz(275000, true); // /dev/ttyACM0 missing
//set_sys_clock_khz(124400, true); // /dev/ttyACM0 missing
Then I tried to identify at which frequency the Pico runs when not explicitely setting sys_clock. To my surprise it was not the often read 133MHz but 130MHz:
Code: Select all
// 330us
//set_sys_clock_khz(124000, true); // 346us
//set_sys_clock_khz(126000, true); // 340us
//set_sys_clock_khz(128000, true); // 335us
//set_sys_clock_khz(130000, true); // 330us
//set_sys_clock_khz(131000, true); // 328us
Then I wanted to see whether "set_sys_clock_48mhz()" does what it states -- and it does not, it sets 50MHz

Code: Select all
//set_sys_clock_48mhz(); // 894us
//set_sys_clock_khz(48000, true); // 932us
//set_sys_clock_khz(50000, true); // 894us
Finally I went higher and higher, and the maximal frequency I was able to run q32.pico.c was 270MHz(!).
Code: Select all
//set_sys_clock_khz(200000, true); // 214us
//set_sys_clock_khz(250000, true); // 171us
//set_sys_clock_khz(266000, true); // 161us (1596/6)
//set_sys_clock_khz(270000, true); // 158us
Code: Select all
Press CTRL-A Z for help on special keys
158us
47| 29|101|
113| 59| 5|
17| 89| 71|
This is q32.pico.c:
https://gist.github.com/Hermann-SW/6772 ... 543d9d3dbe
Today's commit added printf() of measured time before printing the minimal distinct primes 3x3 magic square. There is a small bug in pico/stdlib(?) that does not always print the last line with the measured time taken into minicom over USB. That happens for high as well as low cpu clocks.
I have not used project generator up to now, I hijacked pico-examples usb hello_world.c and just copied over my code. I don't know the correct way of doing "-O3" compilations, I appended "-O3" just after 1st "$(C_FLAGS)" to
/home/pi/pico/pico-examples/build/hello_world/usbCMakeFiles/hello_usb.dir/build.make
Comparison with ESPs:
80MHz ESP8266 took 304us.
160MHz ESP32 took 149us.
Pico at default 130MHz took 357us.
Pico at maximal 270MHz took 158us.
So Pico (overclocked with 270MHz) is only slightly slower in running q32.pico.c than ESP32.
Other measured microcontrollers and CPUs:
viewtopic.php?f=63&t=208778&p=1804701#p1804701

P.S: