Embedded Programming

Sometime by Week 8...

Blinking the MCUs

Coming form having used the Arduino Uno, but only the Arduino Uno, in the past, I was equal parts nonchalant that things would just work, and tense that this was new ground not the defaults I was used to. I was correct on both counts; it's easy enough but definitely has it's quirks.

Seeeduino XIAO RP2040

The RP2040 was highly recommended by Neil and the Fab team, and - having come from using the Arduino Uno most of the time - I was utterly fascinated at the size of the thing as well. While I wandered through the wilderness gathering other chips, it was the RP2040 that I was finally making my way towards.

XIAO Pin Diagram

Seeed Studio have excellent resources on their website for the XIAO series, including documentation for the RP2040 as well.

The Datasheet is also available there, linked below, as well as some of the more relevant chapters. RP2040 documentation
RP2040 Datasheet
- GPIO
- I2C Protocol for the RP2040

XIAO Pin Diagram
XIAO Pin Diagram

Installation

I followed Adrian Torres' excellent FabXIAO page for instructions.

Since the RP2040 is also used in the Raspberry Pi Pico, all the references to this chip in the IDE and online talk about it as the Pico; in case of confusion.

The essential steps were

  1. Add the URL for board in the Arduino IDE preferences
    Arduino-Pico by Earlephilhower
    Board Manager

  2. Download the Pico Board in the Board Manager. Board Install

  3. Select the correct board from the list of boards. Board Selection

  4. Load up the Blink program from Neil's page.
    Blink for RP2040
    Blink1 Blink2

    Blink2

Learning :

  1. Always read the code ! I was initially mystified as to why the board wasn't working, since it wouldn't blink. Turns out, the code operates it so that it only works when you give it an input from the Serial Monitor ! Assuming it would blink like the Arduino Blink example was a bad idea.

  2. The program does NOT load if you have the Serial Monitor open already, because then it cannot find the port. This took another round of poke-it-with-a-stick to find out what the problem was. Error

  3. The way it works, it shows up momentarily as an external drive with a couple of files loaded. I don't know why this is so, but it's a sign it has worked. File File

Exercise Files

XIAO Blink Code
XIAO RGB Code