Introduction: How to Get Started With the Seeedstudio XIAO

About: I am a software engineer and I write about projects and ideas I have. More about me here: https://nerdhut.de/about/

Please note: I'd like to mention that this Instructable was sponsored by Seeedstudio.

When you order the XIAO online, you'll receive a package that contains the XIAO board and a sticker. The XIAO board comes with additional pin headers, but you can also get a pre-assembled version. Make sure to lay out all the components and heat up your soldering iron before you start!

But what is this device in the first place?

The XIAO features a powerful ARM Cortex-M0 microcontroller clocked at 48 MHz. Besides that, it offers 256kB of Flash memory and 32kB of RAM. Besides that, it is absolutely tiny! It's only around 20 by 17.5 millimeters in size, which makes it the smallest member of the Seeeduino family. Furthermore, it's fully compatible with the Arduino IDE and CircuitPython.

Step 1: Assembling the Board

Note: This step only applies if you haven't bought the pre-assembled version.


Luckily, the assembly process is rather simple. All you need to do is to put the pin headers in a breadboard and then place the XIAO board on top of the headers. Doing this will ensure that you can easily solder the pins in place without them getting misaligned. As the last step, use a soldering iron to solder the pins in place. You can then remove the XIAO from the breadboard.

Lastly, you can put one of the stickers (that come with the XIAO in the small plastic bag) on top of the main chip to remind you of the board's pinout.

Step 2: Setting Up the Arduino IDE

First, navigate to the Arduino IDE settings. In the settings window, add the following additional board manager URL (See the first image of this section for details):

https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

Once you're done, close the settings window, and navigate to the Boards Manager in the Arduino IDE (Tools -> Board -> Boards Manager). In the board manager, search for "XIAO" or "Seeed SAMD", and install the board support package. This may take a while (It took around five minutes on my computer). When the process is done, you can close the Boards Manager window.

Now you can select the Seeedstudio boards as the compile/upload target in the Arduino IDE. Make sure to also select the correct serial port (See the third image for details).

Step 3: Putting Together a Short Hardware Test Script

Now that you've installed the board support for the Seeedstudio SAMD devices in the Arduino IDE, it's time to upload and run some code on the XIAO. For that, you can assemble a very simple circuit that contains a single LED and a matching resistor.

Connect the LED's anode to the XIAO's digital pin number seven, then connect the cathode of the LED to the resistor, and connect the other side of the resistor to GND (See the image). When you're done, upload the following code to the XIAO:

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

void loop()
{
digitalWrite(7, HIGH);
delay(500);
digitalWrite(7, LOW);
delay(500);
}

All this code does is initialize the digital pin number 7 of the XIAO in the setup method, and then turn the LED on, wait for half a second, before turning the LED off again.

Step 4: Interesting Things to Note

Firstly, notice just how small the XIAO is. The first image of this section shows it next to an Arduino Nano and an Arduino UNO. The tiny footprint of this Seeeduino makes it the perfect choice for wearable projects and embedded applications.

Then, note that the Seeedstudio XIAO can not only read analog signals, but it can also output true analog values between zero and 3.3 Volts via its analog pin A0. You can use the following code and an oscilloscope to test its capabilities!

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

void loop()
{
digitalWrite(7, HIGH);
delay(500);
digitalWrite(7, LOW);
delay(500);
}