Home / Learn Chip Programming / RP2040 and Raspberry Pi Pico

RP2040 and Raspberry Pi Pico

Dual Cortex-M0+ at 133 MHz, 264 KB RAM and PIO for under Rs 400.

In shortDual Cortex-M0+ at 133 MHz, 264 KB RAM and PIO for under Rs 400.

Theory in plain words

RP2040 blocks2 x Cortex-M0+ 133 MHz (overclocks above 200 MHz)264 KB SRAM in 6 banks (parallel access)External QSPI flash up to 16 MB, execute in place30 GPIO, 2 UART, 2 SPI, 2 I2C, 16 PWM, 4 ADC, USB host/device8 PIO state machines + 2 DMA controller with 12 channels
RP2040 blocks

What it is

RP2040 has two Cortex-M0+ cores, 264 KB SRAM in 6 banks, USB 1.1, 2 UART, 2 SPI, 2 I2C, 16 PWM, 12 bit ADC and 8 PIO state machines. Flash is external QSPI. RP2350 adds Cortex-M33/RISC-V and security.

Why we use it

Great documentation, a UF2 drag-and-drop bootloader burned into ROM and the unique PIO make it perfect for learners and custom interfaces.

How it works

Hold BOOTSEL while plugging USB: it mounts as a drive; drop a .uf2 file. SDKs: C/C++ Pico SDK, MicroPython, CircuitPython, Arduino-Pico.

Where it is used

  • Raspberry Pi Pico / Pico W
  • USB devices, displays, LED matrices
  • Custom protocols with PIO

Pico vs others

Compare Pico, Arduino Uno and ESP32Try it Yourself

Pico is the best value for learning embedded C and PIO; ESP32 when you need radio; Uno for the simplest start.

Blink with the Pico SDK
#include "pico/stdlib.h"
int main() {
    const uint LED = 25;                 // Pico W uses the CYW43 chip: cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1)
    gpio_init(LED); gpio_set_dir(LED, GPIO_OUT);
    while (true) { gpio_put(LED, 1); sleep_ms(500); gpio_put(LED, 0); sleep_ms(500); }
}
// build: mkdir build && cd build && cmake .. && make   ->  blink.uf2: hold BOOTSEL, plug in, drag the file
Tip:The M0+ has no FPU and no divide instruction in hardware (RP2040 has a fast hardware divider in the SIO block). Use integer maths for speed.

Quick quiz

1. How do you load firmware on a Pico?

2. Number of PIO state machines on RP2040?

Common questions

How do you load firmware on a Pico?

Hold BOOTSEL and copy a .uf2 file. It appears as a USB drive.

Number of PIO state machines on RP2040?

8. Two PIO blocks with four state machines each.