David Bell is one of our interns, and is equipped with one of the office Peltier coolers. He decided last week to indulge in some experimentation to find out how much he could overclock a RP2040. The results surprised us.
It turns out that with some very special treatment, RP2040 can be overclocked to be shockingly fast. And overclocking it as David describes here will also stop it working altogether – but it’s all about the journey, right? Here’s David to tell you more.
One of the things I really like about RP2040 is how useful it is for learning about computing. Whether it’s picking up the basics of MicroPython, interfacing hardware with the GPIO, or learning how to write C for an embedded application, it has a lot to offer. One thing I’ve been using RP2040 to learn more about is overclocking, and as it turns out, RP2040 makes for a fantastic overclocking platform capable of reaching 1GHz, even outperforming the original Raspberry Pis.
To compare performance between the Pi and the Pico, I used the Dhrystone benchmark, an industry standard created by Reinhold Weicker in 1984. The version I used on the Pico was adapted for the RP2040 C/C++ SDK by Roy Longbottom, a veteran benchmarker. I also used Roy’s executables to run Dhrystone on a Pi 1 Model B and a Zero W. It should be noted that Roy’s Dhrystone scores for the Pi 1 at 700MHz and 1GHz are higher than the scores I was able to achieve – with the Pico at 1GHz still beating the Pi at 700MHz but losing out to the Pi at 1GHz.
RP2040’s system clock runs with a max speed of 133MHz out of the box – a very respectable frequency for a microcontroller, but a long way off from the gigahertz frequencies of modern computers. Overclocking can help close that gap, but to get all the way up to 1GHz every trick in the book is needed to really push RP2040 to its limits (and very much beyond).
Overclocking basics: process, voltage and temperature
Before we go any further, it’s important to note that running your RP2040 outside of the limits given in the RP2040 datasheet will void your warranty, so if you decide to overclock your RP2040, continue at your own risk!
There are three key factors that determine the frequency of any processor – process (which can be thought as the inherent speed of the silicon), voltage, and temperature. A processor’s base frequency will reflect the worst case scenario for process, voltage and temperature, as processor manufacturers need to be able to guarantee that the base frequency will be met in all conditions. Overclocking is used to unlock the full performance of a given chip by increasing the frequency as much as the chip’s process will allow (for a given voltage and temperature).
Overclockers will often try to maximise frequency by lowering the temperature of their processor and increasing the voltage. To further increase their chances, they might try to find a ‘golden chip’, a chip with a particularly fast process. On RP2040, process can be compared across chips by finding the chip with the highest ring oscillator frequency for a given voltage and temperature.
Getting to 1 GHz on RP2040
To get the most out of overclocking on RP2040, there are a couple of tricks that are helpful to get to higher frequencies. The first is copying the overclocking script to RAM, as the SPI flash used by RP2040 can’t keep up once RP2040 exceeds about 260 to 270MHz. The other trick is using the ring oscillator as the system clock, which is able to dynamically change frequency depending on voltage and temperature, meaning that it will always run as fast as the chip allows. This often means that you can get a small advantage over using the default crystal oscillator. However, to get the most out of the ring oscillator, it’s worth changing a few of its parameters: setting the divider to 1, the number of stages to 2, and the drive strength to maximum will maximise the frequency. For more details on how to do all of the above, I’ve put the scripts I used on GitHub.
In my overclocking attempt, I tried to maximise the voltage I could supply to the RP2040 by cutting the tracks on the Pico between the VREG_OUT pin and the DVDD pin. The DVDD pin supplies the voltage to the RP2040, so I soldered on connections to an external power supply to control RP2040’s core voltage directly.
To minimise temperature, I used a Peltier cooler to get the temperature down to -40°C. Once the chip was thoroughly frozen, I began to increase the voltage. To get to 1GHz, I had to increase the voltage all the way to 3V, a massive increase from the default 1.1V. However, the chip didn’t survive long at 3V. I was able to run Dhrystone a couple of times, but after being at such a high voltage for about two minutes, the chip duly died, and hasn’t been able to turn on since.
So, it’s official. Raspberry Pi silicon can outperform a Raspberry Pi, if that Raspberry Pi is 10 years old and the RP2040 is willing to sacrifice itself in the process. In terms of practical usage, I can’t think of any reason someone would want to overclock RP2040 to the point where it fries itself. But, just because you shouldn’t, doesn’t mean you mustn’t.