keepcalculator

06 Numbers and Powers

Raspberry Pi Pico with Arduino IDE: Setup Guide

Card No. 06·86681 · Updated · Standard formula, shown below

Yes, you can program the Raspberry Pi Pico with the Arduino IDE. You need to install the Raspberry Pi Pico/RP2040 board package via Boards Manager, select the correct board, and upload your sketch over USB. This guide walks you through the entire process, from installing the necessary tools to troubleshooting common issues.

Why Program the Pico with Arduino IDE?

The Raspberry Pi Pico uses the RP2040 chip, which normally runs MicroPython or C/C++ with the official SDK. The Arduino IDE is a popular alternative because it lets you use thousands of existing libraries and examples written for Arduino boards. If you already know Arduino, you can start blinking LEDs, reading sensors, or driving motors without learning a new toolchain. The Arduino core for RP2040 is community-maintained and provides a familiar environment while still giving access to the chip’s dual-core processor and PIO (Programmable I/O) features.

What You Need

  • A Raspberry Pi Pico or Pico W board
  • A USB cable that supports data (many cables are charge-only)
  • The Arduino IDE, version 2.x or 1.8.x (both work)
  • An internet connection to download the board package

Step-by-Step Setup

  1. Install Arduino IDE – Download from the official Arduino website and install it.
  2. Add the Pico board URL – Open File > Preferences. In the “Additional Boards Manager URLs” field, paste: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  3. Install the board package – Go to Tools > Board > Boards Manager. Search for “Raspberry Pi Pico” and install “Raspberry Pi Pico/RP2040 by Earle Philhower”.
  4. Select your board – Go to Tools > Board > Raspberry Pi RP2040 Boards and choose “Raspberry Pi Pico” (or “Raspberry Pi Pico W” for the wireless version).
  5. Put the Pico in bootloader mode – Hold the BOOTSEL button on the Pico while plugging it into your computer via USB. It will appear as a USB mass storage device named “RPI-RP2”.
  6. Upload your sketch – Write or open a sketch (e.g., Blink), then click the Upload button. The IDE will compile and upload via USB.

After the first upload, you can usually unplug and replug the Pico without holding BOOTSEL; the IDE will reset it automatically.

Choosing the Right Board Setting

In the Tools menu, you’ll see options like “CPU Speed” and “Core”. For most beginners, leave these at defaults. If you have a Pico W, select that specific board, not the plain Pico, because the wireless chip needs different initialization. For the Pico W, you also need to install the “Earle Philhower” core version 2.6.0 or later to get Wi-Fi support. If you’re using a Pico with pre-soldered headers, the board selection is the same; the headers don’t change the programming method.

Common Problems and Fixes

  • Board not detected – Make sure you’re using a data-capable USB cable. Try a different port. If the Pico appears as a drive but the IDE doesn’t see it, close and reopen the IDE.
  • Upload fails with “No device found” – Hold BOOTSEL while plugging in, then immediately click Upload. If you’re using the IDE 2.x, you may need to select the correct “Port” under Tools > Port.
  • Sketch compiles but doesn’t run – Check that you selected the correct board (Pico vs Pico W). Also, if you’re using a library that requires a specific core version, update the board package.
  • Serial monitor shows garbage – Set the baud rate to 115200 in the Serial Monitor, which is the default for the RP2040 core.
  • Pico W Wi-Fi issues – The Wi-Fi library is different from the ESP8266/ESP32. Use the examples that come with the core (File > Examples > WiFiNINA or the core’s own examples).

Arduino IDE vs. MicroPython vs. C++ SDK

The Arduino IDE is great for quick projects and for people who already know Arduino. MicroPython is easier for beginners who want to type commands interactively. The official C++ SDK gives you the most control and performance, but has a steeper learning curve. The Arduino core actually uses the SDK underneath, so you can still access low-level features like PIO and DMA if you include the right headers. For most hobby projects, the Arduino IDE is a good balance of simplicity and power.

Performance and Limitations

The RP2040 runs at 133 MHz by default, and the Arduino core lets you overclock it to 250 MHz in the Tools menu. It has two cores, but the Arduino core runs your sketch on core 0 by default. You can use the setup1() and loop1() functions to run code on the second core – a feature that’s unique to this core. The Pico has 264 KB of RAM and 2 MB of flash (on the standard board). The Arduino core uses some of that for the USB stack, so you have slightly less than the full amount available. For most sketches this is irrelevant, but if you’re doing heavy audio or graphics, you might need to optimize.

Frequently Asked Questions

Do I need to install drivers on Windows?
No, the Pico uses the built-in USB HID and Mass Storage drivers. It shows up as a serial port automatically.

Can I use the Pico W with the same Arduino code as the Pico?
Most code works, but you must select the “Raspberry Pi Pico W” board. Wi-Fi libraries are separate, and some pins are used for the wireless chip, so check the pinout.

How do I reset the Pico to run MicroPython again?
Hold BOOTSEL while plugging in, then drag-and-drop a MicroPython UF2 file onto the RPI-RP2 drive. That overwrites the Arduino bootloader.

Why does my upload take so long?
The first upload compiles the core and all libraries, which can take a minute or two. Subsequent uploads are faster because the core is cached.

Can I use the Pico’s PIO with Arduino?
Yes, the core includes the PIO library. You can find examples under File > Examples > PIO.

What if I get a “Cannot open COM port” error?
Close other programs that might be using the serial port (like a Serial Monitor from a previous session). Unplug and replug the Pico, then try again.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →