Raspberry Pi has designed its own microcontroller (MCU), the RP2040, and launched a new $4 board based on the new MCU, the Raspberry Pi Pico, programmable in C and MicroPython.
The RP2040 features a dual-core Arm Cortex-M0+ processor with 264KB internal RAM and support for up to 16MB of off-chip Flash. A wide range of flexible I/O options includes I2C, SPI, as well as programmable I/O (PIO). Raspberry Pi’s chief operating officer, James Adams, said in a blog, “We had three principal design goals for RP2040: high performance, particularly for integer workloads; flexible I/O, to allow us to talk to almost any external device; and of course, low cost, to eliminate barriers to entry. We ended up with an incredibly powerful little chip, cramming all this into a 7 × 7 mm QFN-56 package containing just two square millimetres of 40 nm silicon.”
He added that with six independent banks of RAM, and a fully connected switch at the heart of its bus fabric, it is easy to arrange for the cores and DMA engines to run in parallel without contention. In addition, since the Cortex-M0+ lacks a floating-point unit, Raspberry Pi had commissioned optimized floating-point functions from Mark Owen, author of the Qfplib libraries; these are substantially faster than their GCC library equivalents and are licensed for use on any RP2040-based product.
Adams said, “With two fast cores and a large amount of on-chip RAM, RP2040 is a great platform for machine learning applications. For power users, we provide a complete C SDK, a GCC-based toolchain, and Visual Studio Code integration. For beginners, and other users who prefer high-level languages, we’ve worked with Damien George, creator of MicroPython, to build a polished port for RP2040; it exposes all of the chip’s hardware features, including our innovative PIO subsystem. And our friend Aivar Annamaa has added RP2040 MicroPython support to the popular Thonny IDE.”
In his blog, Adams explained the reasons for producing its own silicon. He said the Raspberry Pi has been quite successful in helping bridge the worlds of software and hardware, and as a result sold 37 million units to date. However, he said the existing boards do have limits – for example a Raspberry Pi Zero consumes of the order of 100mW; Raspberry Pi on its own does not support analog input; and while it is possible to run “bare metal” software on a Raspberry Pi, software running under a general-purpose operating system like Linux is not well suited to low-latency control of individual I/O pins.
He added that many applications tend to pair their Raspberry Pi with a microcontroller. While the Raspberry Pi might do the computation, network access and storage, the microcontroller handled analog input and low latency I/O.
Hence by making its own silicon, it could improve performance, I/O and cost. In developing the RP2040, he said, they’d learned the lessons from using other microcontrollers in Raspberry Pi products.
In addition to the microcontroller and the board, Raspberry Pi said it has also been working with various partners to create both a variety of other boards based on the RP2040 silicon platform, as well as accessories for the Raspberry Pi Pico. These partners include Adafruit, Arduino, Pimoroni, and Sparkfun.
Key features of the RP2040
Dual-core Arm Cortex-M0+ @ 133MHz
264KB (remember kilobytes?) of on-chip RAM
Support for up to 16MB of off-chip Flash memory via dedicated QSPI bus
Interpolator and integer divider peripherals
30 GPIO pins, 4 of which can be used as analogue inputs
1 × USB 1.1 controller and PHY, with host and device support
8 × Raspberry Pi Programmable I/O (PIO) state machines
USB mass-storage boot mode with UF2 support, for drag-and-drop programming.
The $4 board
Along with the new microcontroller, the company also introduced a $4 board, the Raspberry Pi Pico. This pairs the RP2040 with 2MB of Flash memory, and a power supply chip supporting input voltages from 1.8-5.5V. This allows the Pico to be powered up from a wide variety of sources, including two or three AA cells in series, or a single lithium-ion cell.
The Pico board provides a single push button, which can be used to enter USB mass-storage mode at boot time and also as a general input, and a single LED. It exposes 26 of the 30 GPIO pins on RP2040, including three of the four analog inputs, to 0.1”-pitch pads; headers can be soldered to these pads or their castellated edges enable Pico to be soldered directly to a carrier board. Volume customers will be able to buy pre-reeled Pico units. The Pico PCB layout was co-designed with the RP2040 silicon and package: a two-layer PCB with a solid ground plane and a GPIO breakout that Adams said “just works”.
Full technical specifications of the RP2040, the Raspberry Pi Pico, and the software development kit (SDK), whether for C/C++ or MicroPython, are available here.