Skip to main content

Getting Started with Seeed Studio XIAO ESP32C6

Seeed Studio XIAO ESP32C6

Introduction

Seeed Studio XIAO ESP32C6 is powered by the highly-integrated ESP32-C6 SoC, built on two 32-bit RISC-V processors, with a high-performance (HP) processor with running up to 160 MHz, and a low-power (LP) 32-bit RISC-V processor, which can be clocked up to 20 MHz. There are 512KB SRAM and 4 MB Flash on the chip, allowing for more programming space, and binging more possibilities to the IoT control scenarios.

XIAO ESP32C6 is Matter native thanks to its enhanced wireless connectivity. The wireless stack supports 2.4 GHz WiFi 6, Bluetooth® 5.3, Zigbee, and Thread (802.15.4). As the first XIAO member compatible with Thread, it's a perfect fit for building Matter-compliant projects, thus achieving interoperability in smart-home.

Specifications comparison

ProductsXIAO ESP32C6XIAO ESP32C3XIAO ESP32S3
ProcessorEspressif ESP32-C6 SoCEspressif ESP32-C3 SoCEspressif ESP32-S3R8
Two 32-bit RISC-V processors, with the high-performance one running up to 160 MHz, and the low-power one clocking up to 20 MHzRISC-V single-core 32-bit chip processor with a four-stage pipeline that operates at up to 160 MHzXtensa LX7 dual-core, 32-bit processor running up to 240 MHz
WirelessComplete 2.4GHz Wi-Fi 6 subsystemComplete 2.4GHz Wi-Fi subsystem
BLE: Bluetooth 5.0, Bluetooth MeshBLE: Bluetooth 5.0, Bluetooth MeshBLE: Bluetooth 5.0, Bluetooth Mesh
Zigbee,Thread,IEEE 802.15.4//
On-chip Memory512KB SRAM & 4MB Flash400KB SRAM & 4MB Flash8M PSRAM & 8MB Flash
Interface1x UART,1x LP_UART, 1x IIC, 1x LP_IIC, 1x SPI,11x GPIO(PWM), 7x ADC, 1xSDIO1x UART, 1x IIC, 1x SPI,11x GPIO(PWM), 4x ADC1x UART, 1x IIC, 1x IIS, 1x SPI,11x GPIO(PWM), 9x ADC, 1x User LED, 1x Charge LED
1x Reset button, 1x Boot button
Dimensions21 x 17.5 mm
PowerInput voltageType-C: 5V
BAT: 4.2V
Circuit operating Voltage (ready to operate)USB:5V@9mA
BAT:3.8V@9mA
Type-C: 5V@19mA
BAT: 3.8V@22mA
Charging battery current100mA350mA100mA
Power Consumption Model(Supply Power: 3.8V)Modem-sleep Model~ 30 mA~ 24 mA~ 25 mA
Light-sleep Model~ 2.5 mA~ 3 mA~ 2 mA
Deep Sleep Model~ 15 μA~ 44 μA~ 14 μA
Working Temperature-40°C ~ 85°C-40°C ~ 65°C

Features

  • Enhanced Connectivity: Integrates 2.4 GHz Wi-Fi 6 (802.11ax), Bluetooth 5(LE), and IEEE 802.15.4 radio connectivity, allowing for the application of Thread and Zigbee protocols.
  • Matter Native: Supports the building of Matter-compliant smart home projects, ensuring interoperability among different smart devices.
  • Security Encrypted on Chip: Utilizes the ESP32-C6 to provide secure boot, encryption, and Trusted Execution Environment (TEE) features, enhancing the security of smart home projects.
  • Outstanding RF Performance: Features an on-board antenna with up to 80m BLE/Wi-Fi range and offers an interface for connecting an external UFL antenna, ensuring reliable connectivity.
  • Leveraging Power Consumption: Offers four working modes, including a deep sleep mode with consumption as low as 15 μA, along with support for lithium battery charge management.
  • Dual RISC-V Processors: Incorporates two 32-bit RISC-V processors, with the high-performance processor capable of running up to 160 MHz and the low-power processor up to 20 MHz.
  • Classic XIAO Designs: Maintains the thumb-size form factor of 21 x 17.5mm and single-sided mount design, ideal for space-limited projects like wearable devices.

Hardware overview

XIAO ESP32C6 indication diagram
XIAO ESP32C6 Pin List
tip

There's an IO port 14 used to select between using the built-in antenna or an external antenna. If port 14 is at a low level, it uses the built-in antenna; if it's at a high level, it uses the external antenna. The default is low level. If you want to set it high, you can refer the code below.

void setup() {
pinMode(14, OUTPUT);
digitalWrite(14, HIGH);
}

Getting started

To enable you to get started with the XIAO ESP32C6 faster, please read the hardware and software preparation below to prepare the XIAO.

Hardware Preparation

You need to prepare the following:

tip

Some USB cables can only supply power and cannot transfer data. If you don't have a USB cable or don't know if your USB cable can transmit data, you can check Seeed USB Type-C support USB 3.1.

Solder header

XIAO ESP32C6 is shipped without pin headers by default, you need to prepare your own pin headers and solder it to the corresponding pins of XIAO so that you can connect to the expansion board or sensor.

Due to the miniature size of XIAO ESP32C6, please be careful when soldering headers, do not stick different pins together, and do not stick solder to the shield or other components. Otherwise, it may cause XIAO to short circuit or not work properly, and the consequences caused by this will be borne by the user.

BootLoader Mode

There are times when we use the wrong program to make XIAO appear to lose ports or not work properly. The specific performance is:

  • Connected to computer, but no port number found for XIAO.

  • The computer is connected and the port number appears, but the upload program fails.

When you encounter the above two situations, you can try to put XIAO into BootLoader mode, which can solve most of the problems of unrecognized devices and failed uploads. The specific method is:

  • Step 1. Press and hold the BOOT button on the XIAO ESP32C6 without releasing it.

  • Step 2. Keep the BOOT button pressed and then connect to the computer via the data cable. Release the BOOT button after connecting to the computer.

  • Step 3. Upload the Blink program to check the operation of the XIAO ESP32C6.

Reset

When the program runs abnormally, you can press Reset once during power-up to let XIAO re-execute the uploaded program.

When you press and hold the BOOT key while powering up and then press the Reset key once, you can also enter BootLoader mode.

Software Preparation

The recommended programming tool for the XIAO ESP32C6 is the Arduino IDE, so you need to complete the Arduino installation as part of the software preparation.

tip

If this is your first time using Arduino, we highly recommend you to refer to Getting Started with Arduino.

And the on-board package for XIAO ESP32C6 requires at least version 2.0.8 to be available.

  • Step 1. Download and Install the stable version of Arduino IDE according to your operating system.

  • Step 2. Launch the Arduino application.
  • Step 3. Add the XIAO ESP32C6 on-board package to the Arduino IDE and click OK.
  • Step 4. Close the Arduino IDE and reopen it.

Add the XIAO-C6 Board

As of April 16, 2024, the most current stable release of Arduino-ESP32 is version 2.0.15. Unfortunately, this version does not support the ESP32-C6 chipset, which means it also does not support the XIAO ESP32-C6 board. To work with XIAO-C6, you'll need to utilize the development release of the board manager URL provided below:

https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json

if you've install the ESP32 board package before, you''ll need to remove it first.

To install the XIAO ESP32C6 board, follow these steps:

  1. Add the above board manager URL to your Arduino IDE preferences.
  1. Download the XIAO ESP32C6 board package.

Additionally, the latest development release version (3.0.0-rc1) was released on April, 2024. And has supported XIAO ESP32C6.

  • Step 1. Launch the Arduino application.

  • Step 2. Navigate to File > Examples > 01.Basics > Blink, open the program.

  • Step 3. Select the board model to XIAO ESP32C6, and select the correct port number to upload the program.

Once the program is successfully uploaded, you will see the following output message and you can observe that the orange LED on the right side of the XIAO ESP32C6 is blinking.

Battery Usage

The XIAO ESP32C6 series has a built-in power management chip that allows the XIAO ESP32C6 to be powered independently by using a battery or to charge the battery through the XIAO ESP32C6's USB port.

If you want to connect the battery for XIAO, we recommend you to purchase qualified rechargeable 3.7V lithium battery. When soldering the battery, please be careful to distinguish between the positive and negative terminals. The negative terminal of the power supply should be the side closest to the USB port, and the positive terminal of the power supply is the side away from the USB port.

caution

When you use battery power, there will be no voltage on the 5V pin.

Deep sleep mode and wake-up

The XIAO ESP32C6 has a complete deep sleep mode and wake-up function. Here we will show two of the more common examples offered by the ESP.

Demo1: Deep Sleep with External Wake Up

This code displays how to use deep sleep with an external trigger as a wake up source and how to store data in RTC memory to use it over reboots.

/*
=====================================
This code is under Public Domain License.

Hardware Connections
======================
Push Button to GPIO 33 pulled down with a 10K Ohm
resistor

NOTE:
======
Only RTC IO can be used as a source for external wake
source. They are pins: 0,2,4,12-15,25-27,32-39.

Author:
Pranav Cherukupalli <[email protected]>
*/

#define BUTTON_PIN_BITMASK 0x200000000 // 2^33 in hex

RTC_DATA_ATTR int bootCount = 0;

/*
Method to print the reason by which ESP32
has been awaken from sleep
*/
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;

wakeup_reason = esp_sleep_get_wakeup_cause();

switch(wakeup_reason)
{
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
}
}

void setup(){
Serial.begin(115200);
delay(1000); //Take some time to open up the Serial Monitor

//Increment boot number and print it every reboot
++bootCount;
Serial.println("Boot number: " + String(bootCount));

//Print the wakeup reason for ESP32
print_wakeup_reason();

/*
First we configure the wake up source
We set our ESP32 to wake up for an external trigger.
There are two types for ESP32, ext0 and ext1 .
ext0 uses RTC_IO to wakeup thus requires RTC peripherals
to be on while ext1 uses RTC Controller so doesnt need
peripherals to be powered on.
Note that using internal pullups/pulldowns also requires
RTC peripherals to be turned on.
*/
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1); //1 = High, 0 = Low

//If you were to use ext1, you would use it like
//esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);

//Go to sleep now
Serial.println("Going to sleep now");
esp_deep_sleep_start();
Serial.println("This will never be printed");
}

void loop(){
//This is not going to be called
}

Demo2: Deep Sleep with Timer Wake Up

ESP32 offers a deep sleep mode for effective power saving as power is an important factor for IoT applications. In this mode CPUs, most of the RAM, and all the digital peripherals which are clocked from APB_CLK are powered off. The only parts of the chip which can still be powered on are: RTC controller, RTC peripherals ,and RTC memories.

This code displays the most basic deep sleep with a timer to wake it up and how to store data in RTC memory to use it over reboots.

/*
Simple Deep Sleep with Timer Wake Up
=====================================
This code is under Public Domain License.

Author:
Pranav Cherukupalli <[email protected]>
*/

#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */

RTC_DATA_ATTR int bootCount = 0;

/*
Method to print the reason by which ESP32
has been awaken from sleep
*/
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;

wakeup_reason = esp_sleep_get_wakeup_cause();

switch(wakeup_reason)
{
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
}
}

void setup(){
Serial.begin(115200);
delay(1000); //Take some time to open up the Serial Monitor

//Increment boot number and print it every reboot
++bootCount;
Serial.println("Boot number: " + String(bootCount));

//Print the wakeup reason for ESP32
print_wakeup_reason();

/*
First we configure the wake up source
We set our ESP32 to wake up every 5 seconds
*/
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) +
" Seconds");

/*
Next we decide what all peripherals to shut down/keep on
By default, ESP32 will automatically power down the peripherals
not needed by the wakeup source, but if you want to be a poweruser
this is for you. Read in detail at the API docs
http://esp-idf.readthedocs.io/en/latest/api-reference/system/deep_sleep.html
Left the line commented as an example of how to configure peripherals.
The line below turns off all RTC peripherals in deep sleep.
*/
//esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
//Serial.println("Configured all RTC Peripherals to be powered down in sleep");

/*
Now that we have setup a wake cause and if needed setup the
peripherals state in deep sleep, we can now start going to
deep sleep.
In the case that no wake up sources were provided but deep
sleep was started, it will sleep forever unless hardware
reset occurs.
*/
Serial.println("Going to sleep now");
Serial.flush();
esp_deep_sleep_start();
Serial.println("This will never be printed");
}

void loop(){
//This is not going to be called
}
tip

If you want to learn to use more of the deep sleep mode and wake-up functions, you can find more sample programs officially written for the chip by ESP in the Arduino IDE.

Resources

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...