Fork me on GitHub

Project Notes

#813 About the Raspberry Pi Pico

All about the Raspberry Pi Pico, demonstrated with a simple LED sequencing programmed using the C/C++ Pico SDK and VS Code extension.

Build

Here’s a quick demo..

clip

Notes

I picked up my first Raspberry Pi Pico from Akizuki Denshi Akihabara 秋月電子通商 for ¥930 in Nov-2025.

It came in a nice little package containing:

  • Raspberry Pi Pico 1 board with castellated pins
  • header pins for board mounting and the SWD interface
  • a micro USB cable
  • and a 5mm yellow LED, because why not?!

kit

About the Raspberry Pi Pico

The Raspberry Pi Pico was launched in January 2021 and was Raspberry Pi’s first microcontroller board built around the RP2040 chip.

The Pico is designed for embedded and real-time applications rather than running Linux, and is typically programmed in MicroPython or C/C++. It offers a rich set of peripherals (GPIO, I²C, SPI, UART, PWM, ADC) and is widely used for learning, prototyping, and hobbyist or lightweight industrial projects.

See the Raspberry Pi Pico 1 datasheet for more information.

Key Specifications

  • RP2040 microcontroller chip designed by Raspberry Pi:
    • Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
    • 264kB on-chip SRAM
    • 2MB on-board QSPI flash
  • 26 multifunction GPIO pins, including 3 analogue inputs
  • 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels
  • 1 × USB 1.1 controller and PHY, with host and device support
  • 8 × Programmable I/O (PIO) state machines for custom peripheral support
  • Low-power sleep and dormant modes
  • Accurate on-chip clock
  • Temperature sensor
  • Accelerated integer and floating-point libraries on-chip
  • Supported input voltage 1.8–5.5V DC
  • 21 mm × 51 mm form factor
  • For the Raspberry Pi Pico W and WH only:
    • 2.4GHz 802.11n wireless LAN
    • Bluetooth 5.2

Pico Pinouts

pico-pinout

Programming Options

The principle methods of programming for the Raspberry Pi Pico:

  • C/C++ Pico SDK. Either:
    • use Raspberry Pi Pico VS Code extension. This is the approach I’ll demonstrate in the example below
    • or setup the SDK manually
  • MicroPython
    • download the appropriate MicroPython UF2 file for the board
    • Drag-and-drop it to the Pico USB
    • then use the device like any other MicroPython host device
  • CircuitPython
    • download the appropriate CircuitPython UF2 file for the board
    • Drag-and-drop it to the Pico USB
    • then use the device like any other CircuitPython host device
  • Arduino IDE with Arduino-Pico core
  • Assembly language. There are two primary ways to approach this:
    • Integrated with the C/C++ SDK: The official Pico SDK is designed to support C, C++, and assembly language. This is the recommended method for most users as it allows you to write performance-critical functions in assembly while leveraging the rich libraries and build system of the C/C++ SDK for other tasks. The build process using CMake and GCC assembler handles the integration.
    • Bare-metal programming: Advanced users can choose to program the entire chip in assembly language without the SDK, which requires manual configuration of the boot process, vector tables, and hardware registers.

The key ways to actually flash the device:

  • Drag-and-drop programming using mass storage over USB
    • For example, this is what the VS Code extension does under the cover
  • OpenOCD to the SWD interface

Demonstration Circuit Design

Schematic designed with Fritzing: see About.fzz.

The circuit simply requires 7 LEDs to be wired to GP7-GP13.

bb

schematic

The schematic shows individual LEDs and current-limiting resistors, but in practice I’m using an 8-bit Red LED module with common cathode - “3-24V 8 Bit Blue/Red Common anode/cathode LED indicator Module Breadboard starter kit Board for MCU ARM 3d printer UNO MEGA2560” (aliexpress seller listing).

bb_build

A Demo Program

I’m using the Raspberry Pi Pico VS Code extension to build and flash a C program for the Pico. The installation and build progress is covered in “Getting started with Raspberry Pi Pico: C/C++ development”.

I’ve created a “blinker” example that runs patterns on 7 LEDs connected to the GP7-13. The source is in blinker/blinker.c, and the project is supported by additional files created by the VS Code extension:

blinker-console

Compiling and programming the device is a simple 2-step procedure

  • hold the BOOTSEL button down on the Pico while plugging in to USB.
    • The Pico will be recognised as a USB device by the OS
    • On the USb device is a file INFO_UF2.TXT that summarises capabilities. In my case:
      • UF2 Bootloader v3.0
      • Model: Raspberry Pi RP2
      • Board-ID: RPI-RP2
  • Select Run Project (USB) from the VS Code Raspberry Pi Pico: Quick Access menu

The program runs a simple LED pattern.

  • first 3 LEDs blink on/off
  • the remaining 4 LEDs display a binary counter

See blinker/blinker.c for the full program:

#include "pico/stdlib.h"

const int LED_DELAY_MS = 250;

// LED pin definitions. The code assumes these are sequential GPIO pins.
const uint8_t LED1 = 7;
const uint8_t LED2 = 8;
const uint8_t LED3 = 9;
const uint8_t LED4 = 10;
const uint8_t LED5 = 11;
const uint8_t LED6 = 12;
const uint8_t LED7 = 13;

int led_init(void) {
    for(int l = LED1; l <= LED7; l++) {
        gpio_init(l);
        gpio_set_dir(l, GPIO_OUT);
    }
    return PICO_OK;
}

void set_led_trio(bool led_state) {
    for(int l = LED1; l <= LED3; l++) {
        gpio_put(l, led_state);
    }
}

void set_quad_counter(uint8_t counter) {
    for(int l = LED4; l <= LED7; l++) {
        gpio_put(l, (counter & (1 << (LED7 - l + 1))) != 0);
    }
}

void loop() {
    static bool trio_state = false;
    static uint8_t quad_counter = 0;

    set_led_trio(trio_state);
    set_quad_counter(quad_counter);

    sleep_ms(LED_DELAY_MS);

    trio_state = !trio_state;
    quad_counter++;
}

int main() {
    int rc = led_init();
    hard_assert(rc == PICO_OK);
    while (true) {
        loop();
    }
}

Here’s a quick demo to see the program in action:

clip

Credits and References

About LEAP#813 Raspberry Pi Pico

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader