The Xiao SAMD21, manufactured by Seeed, is a compact microcontroller board based on the SAM D21 ARM Cortex-M0+ processor. Designed for low-power applications, it offers a versatile range of I/O options, including digital and analog pins, making it ideal for a variety of embedded systems and IoT projects. Its small form factor and powerful processing capabilities make it a popular choice for developers seeking a balance between performance and size.
The Xiao SAMD21 is packed with features that make it a versatile and efficient microcontroller board. Below are its key technical details:
The Xiao SAMD21 features a total of 14 pins, including power, digital, and analog pins. Below is the pinout description:
Pin | Type | Description |
---|---|---|
3V3 | Power | 3.3V output for powering external components. |
GND | Power | Ground connection. |
D0/RX | Digital (UART) | Digital I/O pin, also serves as UART RX (receive) pin. |
D1/TX | Digital (UART) | Digital I/O pin, also serves as UART TX (transmit) pin. |
D2 | Digital | Digital I/O pin with PWM support. |
D3 | Digital | Digital I/O pin with PWM support. |
D4 | Digital | Digital I/O pin with PWM support. |
D5 | Digital | Digital I/O pin with PWM support. |
A0 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
A1 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
A2 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
A3 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
A4 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
A5 | Analog/Digital | Analog input (12-bit ADC) or digital I/O pin. |
The Xiao SAMD21 is easy to use and can be programmed using the Arduino IDE or other compatible development environments. Below are the steps to get started and some best practices for using the board.
Powering the Board:
Programming the Board:
Connecting Peripherals:
The following example demonstrates how to blink an LED connected to pin D2 of the Xiao SAMD21:
// Blink an LED connected to pin D2 on the Xiao SAMD21
const int ledPin = 2; // Define the LED pin (D2)
void setup() {
pinMode(ledPin, OUTPUT); // Set the LED pin as an output
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
The board is not recognized by the computer:
Code upload fails:
Peripherals are not working as expected:
Can the Xiao SAMD21 be powered by a battery?
Yes, you can power the board using a 3.7V LiPo battery connected to the 3V3 and GND pins.
Does the Xiao SAMD21 support Wi-Fi or Bluetooth?
No, the Xiao SAMD21 does not have built-in wireless connectivity. However, you can add wireless modules via UART, I2C, or SPI.
What is the maximum current output of the 3V3 pin?
The 3V3 pin can supply up to 200mA, depending on the input power source.
By following this documentation, you can effectively utilize the Xiao SAMD21 for your projects and troubleshoot common issues with ease.