RP2040 in depth
By Ben Everard. Posted
This article was originally published as part of HackSpace magazine, which has since been incorporated into Raspberry Pi Official Magazine.

The brand new RP2040 microcontroller powers Raspberry Pi Pico and a range of other new microcontroller boards from Adafruit, Sparkfun and Pimoroni. You can get your own Pico by buying the paper version of HackSpace mag issue 39 or subscribing from £10. Click here to subscribe if you're in the UK, or here if you're elsewhere in the world.
Let's take a look at what's going on inside the little black chip.
Advertisement
Introducing the smarter desktop: use cloud apps, thin clients, and get real work done on a Raspberry Pi. Also in the magazine we’re building a digital jukebox, controlling a robot arm, storing…
Processing power
RP2040 has two 32-bit ARM Cortex-M0+ processors running at up to 133MHz (or even more if you want to try overclocking). Microcontroller performance is a bit more nuanced than, say, PC performance because size, power, and cost trade-offs are often important. RP2040 is more than capable for most common microcontroller use-cases: you should find that it has plenty of horsepower. Additionally, RP2040 has optimised floating-point routines in the boot ROM which give it a speed boost.
Communication protocols
RP2040 is a great microcontroller, but you’re likely to need additional parts to build up your projects, and this means you need a way of communicating with them. To make this quick and easy, RP2040 has hardware support for two I2Cs, two SPIs, and two UART buses. If this isn’t enough – or you want to connect more esoteric hardware, you can use Programmable Input and Output which is a unique new method for efficiently handling data coming in or going out. You can find out more information about PIO here.
Low power
The Cortex M0+ cores in Pico don’t suck up a lot of power when running normally, but if you want your projects to run long-term on battery power, they may draw a little too much current. Fortunately, they have a couple of features to help get the most out of limited power sources. Sleep and Dormant modes can drop the power consumption of a Pico down to around 1 mA. In these states, the Pico can’t do any processing, but it can wait for a particular event (such as time signal from the real-time clock, or a signal on a GPIO pin), then wake up and perform a particular task (such as read a sensor and save the value).
Dual core
There are two Cortex-M0+ processor cores in Pico, and each of them is capable of the same set of things. This, for example, allows you to dedicate one core to just running an interface (or set of outputs) while the other takes data in and processes it. Obviously, this lets you do more processing in a given time, but it can be just as useful for simplifying your code. If you’ve got something that needs constant attention (such as an animation you want to proceed smoothly, or a data stream that needs constant processing), you can dedicate one core to just this while the other core handles all the ancillary tasks. Your timing-critical code can then just run uninterrupted and the other bits can still get processor time.
Real-Time Counter (RTC)
Pico includes a timer that can be used with an external reference clock to get the time in human-compatible units such as days, months, and years. This RTC can also be used to generate alarms at particular points. If you want, for example, a particular task to run every day at 10 am, the RTC can trigger it. Similarly, if you want something to trigger an action in a set amount of time (such as a 30-second timeout), the RTC can help.
Fully connected bus
There’s quite a lot going on inside the black package of RP2040 – including two processor cores, peripherals for many protocols, and PIO – and these all need to access memory. The fully connected bus fabric gives fast and predictable performance, even when lots of things are happening at once.
You can get your very own Pico by getting a paper copy of HackSpace mag issue 39 or subscribing to HackSpace magazine from just £10. If you're in the UK head here. For delivery elsewhere in the world, take a look here.

Ben is the Editor of HackSpace magazine. When not wrangling words, he enjoys cycling, gardening, and attempting to identify wild mushrooms.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles

Raspberry Pi camera tripod mount review
The easy way to mount a Raspberry Pi Camera Module.
Read more →

Cassette MagSafe stand
This is one of those builds that straddles the line between silly and brilliant.
Read more →

The Smarter Desktop in Raspberry Pi Official Magazine 156
3D printing has come a long way. Once upon a time you’d have to spend countless hours sanding everything that came off your print bed, and you could have any colour you wanted as long as it was beige. Now you can send a design off to a factory and get industrial-quality prints for pocket-money […]
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.