RP2040 mikroBUS™ Development Board Hookup Guide

Pages
Contributors: santaimpersonator, MAKIN-STUFF
Favorited Favorite 0

Software Overview

The Raspberry Pi foundation provides excellent documentation for the RP2040 on their website. This includes information for users to program the RP204 with MicroPython and C/C++ through the Pico SDK. Arduino, has also announced the release of their Mbed RP2040 Arduino core. The instructions below, are meant to help users setup and utilize the RP2040 mikroBUS™ Development Board with the Arduino IDE.

Note: We recommend that users program their RP2040 mikroBUS™ development board through the Arduino IDE. Additionally, we recommend that users select Click boards™ based on available and compatible Arduino libraries.

If users wish to use another development platform/environment or utilize a Click board™ without an Arduino library, it is expected that the user is experienced enough port the necessary resources on their own.

For utilizing the Pico SDK (C/C++) and MicroPython, users can follow the instructions provided by the Raspberry Pi Foundation documentation:

To utilize the mikroSDK™, users can refer to instructions provided by MikroElektronika:

Arduino IDE

Note: For first-time users, who have never programmed before and are looking to use the Arduino IDE, we recommend beginning with the SparkFun Inventor's Kit (SIK), which includes a simpler board like the Arduino Uno or SparkFun RedBoard and is designed to help users get started programming with the Arduino IDE.

Most users will be familiar with the Arduino IDE and it's use. As a point of reference for professional developers who aren't aware, the Arduino IDE is an open-source development environment, written in Java, that makes it easy to write code and upload it to a supported board. For more details, feel free to check out the Arduino website.

To get started with the Arduino IDE, check out the following tutorials:

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Installing the RP2040 Board Definition

Install the latest Arduino Mbed OS RP2040 board definitions in the Arduino IDE. Users unfamiliar with the board definition installation process can reference our tutorial below.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Installation Instructions:

  1. Search for RP2040 in the Boards Manager.

    board manager
    Arduino Mbed OS RP2040 listed in the Boards Manager. (Click to enlarge)

  2. To complete the installation process, selected the Arduino Mbed OS RP2040 core and click on the INSTALL button that appears in the lower, right-hand corner. The board definition and upload tools will be installed automatically; users will notice that this may take a while.

    Note: Users may need to disable their anti-virus software when installing the Arduino Mbed OS RP2040 board definition. We ran into issues, where the installation of the upload tools for the Arduino core were blocked by the anti-virus software. Arduino is already aware of the issue, they are working to get their files white-listed. For more information, users can reference this GitHub issue.

  3. Programming Tip:

    The board may not show up on a COM port, if users who have already programmed their board through a different method. A simple solution is to:

    1. Download the picoprobe.uf2 file from the Raspberry Pi foundation's Pico board documentation page
    2. Copy the picoprobe.uf2 firmware file to the board (while it is in BOOTSEL mode)
    3. If the board isn't automatically listed on a COM port users should reset (or unplug and re-plug in the board to the computer)

    Note: If users have the Arduino IDE's Tools drop down menu open looking for a new COM port to be added, the Arduino IDE doesn't automatically repopulate and update the listed COM ports. To update the available COM ports list, users should close and then re-open the Tools drop down menu and navigate to the available COM ports.

Note: Users trying to access the SD card slot will need to modify the pins_arduino.h file to reconfigure the SPI bus pins. However, this will make the SPI bus inaccessible through the breakout pins (when utilizing the SPI library).

  • On a Windows 10 computer, with the Arduino IDE installed through the App store, the location of the pins_arduino.h file is:

    C:\Users\<username>\Documents\ArduinoData\packages\arduino\hardware\mbed_rp2040\<package_version>\variants\RASPBERRY_PI_PICO

    Arduino folder for file modification
    pins_arduino.h file in the RASPBERRY_PI_PICO folder. (Click to enlarge)

  • Users will need to modify lines 45 - 47 of the pins_arduino.h file to the following:

    // SPI
    #define PIN_SPI_MISO  (12u) //(4u)
    #define PIN_SPI_MOSI  (15u) //(3u)
    #define PIN_SPI_SCK   (14u) //(2u)
        

    line modifications
    Line modifications to the pins_arduino.h file. (Click to enlarge)
Note: GitHub user earlephilhower has ported an unofficial Arduino core for the RP2040, which is based on the Pico SDK. This is useful for customers who want the functionality of the Pico SDK in the Arduino IDE. Installation instructions are available in the GitHub repository.