• Pin Configuration
  • Embedded Development Workflow Analysis

    Introduction

    This document presents a comparative analysis of the development workflows of Seeed XIAO ESP32-C3 and Raspberry Pi Pico created by Fabacademy Students of the Hisar IdeaLab Fablab students. It explores technical specifications, performance, resource utilization, and development processes, providing visual representations where applicable.


    Technical Specifications

    Seed XIAO ESP32-C3

    The Seeed XIAO ESP32-C3 is a compact, powerful, and Wi-Fi-enabled microcontroller based on the ESP32-C3 chip.

    Features:

    • 16-pin package
    • Clock Speed: 160MHz RISC-V processor
    • Flash Memory: 4MB onboard QSPI
    • SRAM: 400KB
    • Operating Voltage: 3.3V
    • GPIO Pins: 11 multi-function pins
    • Wi-Fi and Bluetooth 5.0 LE support

    Pin Configuration:

    • VDD: Supply voltage
    • GND: Ground
    • Digital Pins: Configurable as input/output
    • Analog Pins: ADC1, ADC2
    • External Clock Pin: GPIO2 (for external oscillator use)
    • Communication:
      • UART: TX/RX available
      • SPI: Configurable on multiple GPIOs
      • I2C: Supports multiple devices
      • Wi-Fi and Bluetooth 5.0 LE: Built-in wireless connectivity

    ESP32_connect

    Raspberry Pi Pico

    The Raspberry Pi Pico is a powerful microcontroller board based on the RP2040 chip, designed for high-performance embedded applications.

    Features:

    • 40-pin package
    • Clock Speed: Up to 133MHz (configurable)
    • Flash Memory: 2MB onboard QSPI
    • SRAM: 264KB
    • Operating Voltage: 1.8V to 3.3V
    • GPIO Pins: 26 multi-function pins

    Pin Configuration:

    • VDD: Supply voltage
    • GND: Ground
    • Digital Pins: All GPIOs configurable as input/output
    • Analog Pins: ADC0, ADC1, ADC2
    • External Clock Pin: GPIO21 (for external oscillator use)
    • Communication:
      • UART: Multiple TX/RX pairs available
      • SPI: Configurable on multiple GPIOs
      • I2C: Supports multiple devices with flexible pin assignment

    Pico Pin

    Hardware Comparisons

    Feature Seeed XIAO ESP32-C3 Raspberry Pi Pico
    Processor ESP32-C3 (RISC-V) RP2040 (ARM Cortex-M0+)
    Architecture 32-bit RISC-V 32-bit ARM
    Clock Speed 160MHz 133MHz
    RAM 400KB 264KB
    Flash Storage 4MB 2MB
    GPIO Pins 11 26
    Communication I2C, SPI, UART, Wi-Fi, BLE I2C, SPI, UART
    Power Consumption ~80mA (Wi-Fi active) ~100mA
    Price ~$6-$10 ~$4-$10

    Programming

    Programming with Thonny for Raspberry Pi Pico

    Installing Development Environment

    1. Install Thonny:

      • Download and install Thonny from thonny.org.
      • Ensure Python is installed as Thonny requires it.
    2. Thonny Website
    3. Set Up Thonny for Pico:

      • Open Thonny and go to Tools > Options.
      • Select Interpreter and choose MicroPython (Raspberry Pi Pico).
      • Connect the Raspberry Pi Pico via USB and ensure it's detected.
    Thonny for Pico

    Writing and Uploading Code

    1. Creating a New Script

      • Open a new script and write the MicroPython program.
      • Save the file with a .py extension.
    2. Thonny Script
    3. Uploading the Code

      • Click Run to execute the script directly on the Pico.
      • Save the script onto the Pico’s filesystem if persistence is required.
      • Example Code: Led On&Off

        from time import sleep
        from picozero import pico_led
        
        while True:
            pico_led.on()
            sleep(0.1)
            pico_led.off()
            sleep(0.1) 

        Pico Led Blink

        Debugging and Serial Output

    4. Using the REPL (Read-Eval-Print Loop)

      • Open the Shell in Thonny to interact with the Pico.
      • Type Python commands to test GPIOs and other functionalities live.
    5. Using Print Statements for Debugging

      • Insert print() statements in the script to observe values.
      • Monitor the output in the Shell.
    6. Flashing a New Firmware

      • Download the latest MicroPython .uf2 file.
      • Hold the BOOTSEL button and connect the Pico via USB.
      • Drag and drop the .uf2 file onto the Pico storage.

    Programming with Arduino IDE for Seed XIAO ESP32-C3

    Installing Development Environment

    1. Install Arduino IDE:

      • Download and install the latest Arduino IDE from arduino.cc.

      • Arduino Web
      • Open Arduino IDE and go to Preferences.

      • Arduino Download
      • Add the ESP32 Board Manager URL to the Additional Board Manager URLs field:
        https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

    2. Install ESP32 Board Definitions:

      • Go to Tools > Board > Boards Manager.

      • Search for ESP32 and install the ESP32 package.

      • Select Seeed XIAO ESP32-C3 as the board.

    ESP32 Connect

    Writing and Uploading Code

    1. Creating a New Sketch

      • Open a new Arduino sketch.

      • Write the program using standard Arduino functions.

      • Example: Blinking an LED.

    void setup() {
        pinMode(LED_BUILTIN, OUTPUT);
    }
    void loop() {
        digitalWrite(LED_BUILTIN, HIGH);
        delay(1000);
        digitalWrite(LED_BUILTIN, LOW);
        delay(1000);
    } 
    1. Uploading Code to Seeed XIAO ESP32-C3

      • Connect the Seeed XIAO ESP32-C3 via USB.

      • Select the correct board and port from Tools.

      • Click Upload to flash the code to the microcontroller.

    Debugging and Serial Output

    1. Using the Serial Monitor

      • Open the Serial Monitor from Tools > Serial Monitor.

      • Set the baud rate to 115200.

      • Use Serial.print() statements for debugging:

    void setup() {
        Serial.begin(115200);
    }
    void loop() {
        Serial.println("Hello, ESP32!");
        delay(1000);
    } 
  • Troubleshooting Upload Issues

    • Ensure the correct port and board are selected.

    • Try pressing the boot button while clicking Upload.

    • If the upload fails, install the CP210x USB to UART driver.

  • Programming with VS Code for Raspberry Pi Pico

    Installing the Raspberry Pi Pico VS Code Extension

    1. Install Required Software
    • Download and install VS Code from official site.

    • VS Code Download
    • Install Python 3.x.x from python.org if not already installed.

    • Python Installation
    • Install the MicroPython firmware for Raspberry Pi Pico from Raspberry Pi's official site.

    2. Installing the Raspberry Pi Pico VS Code Extension
    • Open VS Code and navigate to Extensions (Ctrl+Shift+X).

    • Search for Raspberry Pi Pico extension (official) and install it.

    • Installing Pico Extension
    • Restart VS Code after installation.

    3. Setting Up MicroPython on Raspberry Pi Pico
    • Download the latest MicroPython uf2 firmware.

    • Install Micropython
    • Connect the Pico via USB while holding the BOOTSEL button.

    • Drag and drop the .uf2 file onto the mounted Pico drive.

    • Once done, the Pico will reboot with MicroPython enabled.


    Features of the Raspberry Pi Pico VS Code Extension

    1. Project Setup and Management
    • Project Generator: Easily create and configure new projects with built-in support for I2C, SPI, and PIO.

    • Quick Project Setup: Initiate new Pico projects directly from the Explorer view when no workspace is open.

    • MicroPython Support: Create and develop MicroPython-based Pico projects with built-in support from the extension.

    2. Configuration and Tool Management
    • Automatic CMake Configuration: Configures CMake automatically when loading a project.

    • Version Switching: Allows easy switching between different versions of the Pico SDK.

    • No Manual Setup Required: Handles environment variables, toolchains, SDK, and tool management.

    • Includes an Uninstaller: Easily remove the extension along with installed SDKs.

    2. Build, Debug, and Documentation
    • One-Click Compilation and Debugging: Automatically configures OpenOCD, Ninja, and CMake for a streamlined build process.

    • Offline Documentation: Access Pico SDK documentation within the editor, even when offline.

    • One-Click Compilation: Compile projects directly from the VS Code status bar.

    • Integrated Debugging: Debug programs using GDB with full VS Code integration.

    Create MicroPython Project

    1. Navigate to the Pico icon on the VSCODE sidebar
    Openning Pico Extension
    2. Click on new Micropython Project
    • Name your Project: On the basic settings section name your project

    • Chose Python Version: Either system default, from system extensions or a custom version you manually upload

    • Chose Directory: Chose a directory for your project to reside in- in user directory by default on mac-

    • Press start and you are good to go .):

    Writing and Uploading Code

    • After you have created your project just plug your pico in an run the code
    • Extension Interface

    • Example Code: Led On&Off
    from time import sleep
        from picozero import pico_led
        
        pico_led.on()
        sleep(1)
        pico_led.off()