Arduino-Pico: A Core Library for Arduino IDE Based on Raspberry Pi Pico Microcontroller

Arduino-Pico is a core library for Arduino based on the Raspberry Pi Pico microcontroller, providing developers with a simple and easy-to-use platform for developing various embedded applications. This article will detail the features, installation, usage methods, and some advanced tips for Arduino-Pico.

Arduino-Pico: A Core Library for Arduino IDE Based on Raspberry Pi Pico Microcontroller

Powerful Features of Arduino-Pico

Arduino-Pico is based on the RP2040 microcontroller of Raspberry Pi and has the following key advantages:

  • Dual-core ARM Cortex-M0+ processor: Provides powerful computing capabilities, supporting multi-threaded operations and more complex applications.

  • 264 KB SRAM: Provides ample memory space for storing program data and variables.

  • 2 MB Flash: Stores program code and data, supporting file system functionalities.

  • Rich peripherals: Including SPI, I2C, UART, PWM, ADC, etc., allowing easy connection of various sensors and actuators.

  • High-speed USB: Supports USB HID, allowing Pico to simulate keyboard, mouse, storage devices, etc., facilitating debugging and data transfer.

  • Low power consumption: Supports low-power modes, extending battery life, suitable for various portable projects.

  • Open source: All hardware and software are open source, making it easy for developers to carry out secondary development and customization.

Installing the Arduino-Pico Core Library

Install via Arduino Boards Manager

  1. 1. Open Arduino IDE and go to File -> Preferences.

  2. 2. Add the following address in the “Additional Boards Manager URLs” field:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  1. 1. Click “OK” to close the settings window.

  2. 2. Go to Tools -> Board -> Board Manager.

  3. 3. Type “pico” in the search box and select the “Arduino-Pico” core library to install.

Install via Git Clone

  1. 1. Create a directory: mkdir -p ~/Arduino/hardware/pico

  2. 2. Clone the Arduino-Pico library: git clone https://github.com/earlephilhower/arduino-pico.git ~/Arduino/hardware/pico/rp2040

  3. 3. Change to the cloned directory: cd ~/Arduino/hardware/pico/rp2040

  4. 4. Initialize submodules: git submodule update --init

  5. 5. Change to the submodule directory: cd pico-sdk

  6. 6. Initialize submodules: git submodule update --init

  7. 7. Download the toolchain: cd ../tools && python3 ./get.py

Connecting Arduino-Pico to the Computer

When using Arduino-Pico for the first time, you need to connect the Pico to the computer.

  1. 1. Connect the Pico to the USB port of the computer.

  2. 2. Hold down the BOOTSEL button on the Pico while connecting the USB cable to the computer.

  3. 3. Release the BOOTSEL button.

This way, the Pico will enter bootloader mode and be recognized as a new serial device.

Uploading Your First Program

  1. 1. In Arduino IDE, select Tools -> Board -> Raspberry Pi Pico.

  2. 2. Select Tools -> Port -> Corresponding Serial Port.

  3. 3. Write your first simple LED blink program:

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}
  1. 1. Click the “Upload” button to upload the program to the Pico.

Now, the built-in LED on the Pico should start blinking.

Conclusion

Arduino-Pico is a powerful and easy-to-use embedded development platform that provides developers with rich resources and support, enabling them to easily build various interesting projects. Whether you are a beginner or an experienced embedded developer, Arduino-Pico can meet their needs and support their innovative journey.

Project Address: https://github.com/earlephilhower/arduino-pico

Leave a Comment

Your email address will not be published. Required fields are marked *