Raspberry Pi Pico

From Deskthority wiki
Jump to navigation Jump to search

This article is a stub. You can help Deskthority by expanding it.

Raspberry Pi Pico
Manufacturer Raspberry Pi Foundation
License Open-source
Host port USB Micro B (OTG)
Voltage 3.3V
Digital I/O pins 26
I/O Voltage 3.3V
Website www.raspberrypi.org/products/raspberry-pi-pico/
Schema datasheets.raspberrypi.org/pico/RPi-Pico-R3-PUBLIC-20200119.zip

The Raspberry Pi Pico is a product line of microcontroller boards from the Raspberry Pi foundation, with their own microcontrollers.

Variants

Board MCU processor SRAM Flash
Raspberry Pi Pico RP2040 2 × ARM Cortex-M0 @ 133 MHz 264 KB (4×64 + 2×4 KB) 2 MB
Raspberry Pi Pico W RP2040 2 × ARM Cortex-M0 @ 133 MHz 264 KB (4×64 + 2×4 KB) 2 MB
Raspberry Pi Pico 2 RP2345A 2 × ARM Cortex M33 @ 150 MHz, and
2 × Hazard3 RISC-V @ 150 MHz
520 KB (4×64 + 2×8 KB) 4 MB

All boards are pin-compatible and most well-behaved software should run unmodified after a recompile to either.

On the Pico 2, only two processor cores can be enabled at once. Software for the Pico 2 that does not include assembly code should run the same regardless whether it is compiled to the ARM or RISC-V processors.

Raspberry Pi Pico

The first microcontroller board from the Raspberry Pi Foundation. It has their own RP2040 microcontroller and 2 MB of external Flash memory.

The RP2040 chip has two ARM Cortex M0+ CPU cores running at up to 133 MHz (before overclocking). Each core also has a separate integer division unit because the core does not have divide instructions.

There are library functions for floating point emulation and memory copying in ROM.

Raspberry Pi Pico W

The Raspberry Pi Pico W is a Pico extended with a CYW43439 wireless module for Wi-Fi. GPIO23 and GPIO24 have been reassigned to an SPI interface between them, and the power circuit and LED are now controlled indirectly through the Wi-Fi module. While the wireless module technically does have Bluetooth its firmware does not support access to it from the pins connected to the RP2040.

Raspberry Pi Pico 2

The Raspberry Pi Pico 2 has the RP2350A microcontroller.

While the hardware has four cores, only two cores can be active at once.

  • two ARM Cortex-M33 cores with divide instructions and 64-bit floating point support.
  • two Hazard3 RISC-V cores (RV32IMAC with Zba/Zbb/Zbs/Zbkb and Zcmp), without floating point.

Software can switch core configuration between 2×ARM or 2×RISC-V (or one of each) at the next watchdog reset unless a fuse has been set to lock the MCU into using only one pair indefinitely.

Both CPUs have hardware divide instructions, so the chip has no separate division circuit. The ARM cores do have simple coprocessors for 64-bit floating point maths in addition to their built-in 32-bit FPUs.

There is no support library in ROM. Floating point emulation on RISC-V would have to be linked with the binary downloaded into Flash.

Compared to the RP2040, the PIO units have also been extended from two to three, and there are minor hardware enhancements in many other functional units.

Features

Each core (ARM or RISC-V) has two interpolator units. There are two FIFOs and 32 spinlocks for inter-core communication. On the RP2350, cores can also send interrupts to each other through "doorbells".

PIO

The RP2040 have two programmable I/O modules (PIO). The RP2350 has three. These can be used to implement many protocols that don't have any dedicated unit.

XIP Flash

Program code (firmware) is loaded from Flash chip on the board. There is a 16 KB SRAM cache which allows eXecution In Place (XIP) as if all the program memory was in RAM — albeit with a performance hit on cache misses. Code can also be loaded into internal SRAM and run from there. If all code is run from SRAM, the cache could be reused as additional SRAM instead.

Board

The footprint is one pin wider than a typical DIP package. The boards have castellated edges for flush mounting, but there are bare test pads on the bottom.

USB

The USB port is a USB Micro receptacle, but with the shield being through-hole soldered — thus being more durable than a typical surface-mounted USB Micro port as on e.g. a Pro Micro. Even though the RP2040 is capable of being both device or host, the port's ID pin is not connected (it is "floating"), meaning that it always identifies as a device to OTG-compliant cables and devices.

The port is broken out on test points (pads) on the bottom:

  • TP2 - USB D-
  • TP3 - USB D+

The VBUS pin is connected directly to USB 5V+. There are several pins for GND, which is also connected to test point TP1.

VBUS is connected to GPIO24 via a voltage divider, with power to the rest of the board passing through a diode. This allows the MCU to test if USB is connected — which could be useful for split keyboards to test if the MCU is master or slave.

The USB module supports as many as 15 in endpoints available for HID interfaces (i.e. virtual devices).

Alternatives

Boards with Raspberry Pi Foundation's microcontrollers are also available from other manufacturers, in Pico form factor with extended feature sets or in different form factors altogether.

All microcontrollers are also available separately. While the Pico 2 has the RP2350A, there exist also the compatible RP2350B, RP2354A and RP2354B. The 'B' variants have 48 GPIO pins. The RP2354 have 2 MB Flash memory on board, enabling a smaller component footprint and thus smaller boards.

Example boards:

  • Pimoroni Pico Lipo has Pico form factor, but with USB-C, battery charging, larger flash memory and a Stemma QT/Qwiic connector for I²C modules.
  • Sumolink Erhu RP2040 has 4 MB flash and an USB-C connector, at low price.

There are also boards with the same footprints as other popular boards such as the Pro Micro, Feather. ItsyBitsy and the Arduino Nano.

Firmware

Firmware framework:

  • KMK based on CircuitPython.
  • QMK supports it through ChibiOS.
  • ZMK support is in beta (Jan 2022)

Libraries: