...

Group Assignment 4

Group 1

  • Evelyn Cuadrado

Group 2

  • Student
  • Student
  • Student

Group 3

  • Student
  • Student
  • Student

Group 1

Evelyn Cuadrado

I had a meeting with Armando Calcina, where I shared the activities we need to complete. I updated him on my progress and explained the tasks he needs to work on to catch up with the academy, as I am a bit more advanced.


For this group project, I have reviewed two microcontrollers, the RP2040 and the ESP32-C, conducting a detailed comparison to identify their differences, potential, and architectures.


XIAO-RP-2040

Here you can view and download the data sheet.

The Xiao RP2040 board is a compact development board based on the RP2040 microcontroller from Raspberry Pi. It is designed to offer high performance in a small form factor, ideal for low-power electronics projects.

This board features a dual-core ARM Cortex-M0+ microcontroller running at 133 MHz, and provides 264 KB of SRAM for fast and efficient data storage. The external flash memory of 16 MB allows for additional storage for larger projects.

With 26 GPIO pins (digital input/output), it supports various functions such as PWM, SPI, I2C, and UART, making it highly versatile for controlling and communicating with other devices. It also includes a 12-bit analog-to-digital converter (ADC) for reading analog signals.

The Xiao RP2040 is especially designed to simplify programming and is compatible with development environments like Arduino and MicroPython, allowing users to easily and quickly create applications. The board is perfect for applications in robotics, automation, Internet of Things (IoT), and other projects that require an efficient and small microcontroller.

(This data is taken from ChatGPT.)

Toolchain:

  1. IDE:Visual Studio Code (VSCode), Eclipse, or CLion.
  1. Compiler: arm-none-eabi-gcc (part of GCC).
  1. Pico SDK:Development library to interact with RP2040 hardware.
  1. Debugging:OpenOCD or Segger J-Link (JTAG/SWD).
  1. Firmware Loading:.uf2 files loaded via USB (BOOTSEL mode).

Workflow:

  1. Set up the environment:Install VSCode, CMake, GCC, and the Pico SDK.
  1. Develop the code:Write C/C++ code using the Pico SDK.
  1. Compile:Use CMake and Make to generate the .uf2 firmware file.
  1. Load:Connect the RP2040 in BOOTSEL mode and load the .uf2 file.
  1. Debug (optional):Use OpenOCD or Segger J-Link for debugging.
  1. Test and adjust:Verify the firmware functionality and make adjustments.

This is the typical workflow for developing with the RP2040, making it easier to program and load firmware onto its integrated architecture.


Technical specifications

Item Value
CPU Dual-core ARM Cortex M0+ processor up to 133MHz
Flash Memory 2MB
SRAM 264KB
Digital I/O Pins 11
Analog I/O Pins 4
PWM Pins 11
I2C interface 1
SPI interface 1
UART interface 1
Power supply and dowloading interface Type-C
Power 3.3V/5V DC
Dimensions 21x17.8x3.5mm

Summary of Features:

  1. USB-C Interface: For connection and programming.
  1. Reset Pin:To restart the board.
  1. RGB LED:An LED that can display multiple colors (red, green, blue).
  1. User LED:A user-controllable LED (3 colors: red, green, blue).
  1. Power LED: A red LED indicating the board is powered.
  1. BOOT Pin (BOOTSEL):For entering boot mode and loading firmware.

                        from machine import Pin, Timer
                        ledAzul = Pin(25, Pin.OUT)
                        ledRojo = Pin(17, Pin.OUT)
                        ledVerde = Pin(16, Pin.OUT)
        
                        Counter = 0
                        Fun_Num = 0
        
                        def fun(tim):
                            global Counter
                            Counter = Counter + 1
                            print(Counter)
                            ledVerde.value(1)
                            ledRojo.value(1)
                            ledAzul.value(Counter%2)
        
        
                        tim = Timer(-1)
                        tim.init(period=1000, mode=Timer.PERIODIC, callback=fun)
                    

Next, I will provide a code to control the LEDs on the Xiao RP2040.


Now, I’m running a test for blinking LED lights using multiple lights connected to specific pins. In this case, I have three LEDs: one blue, one red, and one green, and the code is designed to make the blue LED blink periodically.



XIAO ESP 32C3

Here you can view and download the data sheet.

Seeed Studio XIAO ESP32C3 is an IoT mini development board based on the Espressif ESP32-C3 WiFi/Bluetooth dual-mode chip. ESP32-C3 is a 32-bit RISC-V CPU, which includes an FPU (Floating Point Unit) for 32-bit single-precision arithmetic with powerful computing power. It has excellent radio frequency performance, supporting IEEE 802.11 b/g/n WiFi, and Bluetooth 5 (BLE) protocols. This board comes included with an external antenna to increase the signal strength for your wireless applications. It also has a small and exquisite form-factor combined with a single-sided surface-mountable design. It is equipped with rich interfaces and has 11 digital I/O that can be used as PWM pins and 3 analog I/O that can be used as ADC pins. It supports four serial interfaces such as UART, I2C and SPI.


Toolchain:

  1. IDE/Development Environment: ESP-IDF (official), Arduino IDE, or PlatformIO.
  1. CompilerGCC (for traditional ESP32), riscv32-espidf-gnu-toolchain (for ESP32-C3).
  1. Build Tools:CMake and Make (ESP-IDF), PlatformIO (automatic).
  1. Debugging and Programming: OpenOCD or Segger J-Link for advanced debugging, esptool.py or Espressif Flash Tool for uploading firmware.

Workflow

  1. Set up the development environment (ESP-IDF, Arduino IDE, or PlatformIO).
  1. Write the code using the appropriate libraries.
    (CMake, make, or PlatformIO).
  1. Build the project
  1. Upload the firmware to the ESP32-C3 using the USB port and BOOTSEL mode.
  1. Debugthe code if necessary (OpenOCD, J-Link).
  1. Test and adjustthe project based on the results.

This workflow enables efficient development and uploading of projects to the ESP32-C3, whether for IoT applications or embedded systems.


Parts of the XIAO ESP32-C3

  1. USB Type-C Interface: Connection for programming and charging.
  1. Charge LED:Indicator for charging and power status.
  1. ESP32-C3 Microcontroller:RISC-V based microcontroller with Wi-Fi and Bluetooth 5.0 LE.
  1. Reset Button:Button to manually reset the board.
  1. Wi-Fi / Bluetooth Antenna:Internal antenna for wireless connectivity.
  1. JTAG Pads:Pads for advanced debugging via JTAG.
  1. Battery Connector: Connector for external battery (Li-Po or Li-ion).
  1. Boot Button:Button to put the board into bootloader mode and upload firmware.
  1. Thermal Pad:Pad for dissipating heat generated by the microcontroller.

This summary highlights the essential components of the XIAO ESP32-C3, making it ideal for IoT and embedded projects.


from machine import Pin
from time import sleep

# Intentar con el pin GPIO 0 (puede ser otro dependiendo de la placa)
led = Pin(10, Pin.OUT)

while True:
    led.value(1)  # Encender el LED (1 = HIGH)
    sleep(1)      # Esperar 1 segundo
    led.value(0)  # Apagar el LED (0 = LOW)
    sleep(1)      # Esperar 1 segundo
                        
                    

With the help of ChatGPT, I have created a code to activate an LED using GPIO pin 10 on the XIAO ESP32-C3 microcontroller.

Now, with the programming, I'm doing a simple test to see how to turn an LED on and off.



Toolchain & Workflow Comparison Table

Aspect RP2040 (XIAO RP2040) ESP32-C3
Architecture ARM Cortex-M0+ (Dual Core, 133 MHz) RISC-V 32-bit (160 MHz)
Connectivity USB, UART, SPI, I2C Wi-Fi, Bluetooth 5.0, UART, SPI, I2C
Development Environment Arduino IDE, Thonny (MicroPython) Arduino IDE, ESP-IDF, MicroPython
Toolchain Arduino Core for RP2040, MicroPython Espressif IDF, Arduino Core, MicroPython
Programming Method USB drag-and-drop (BOOTSEL), Thonny IDE USB/UART flashing tools
Typical Use Case Low-power, compact IoT projects Wireless IoT, more advanced networking
Beginner-Friendliness High – very user-friendly Moderate – requires extra setup

Fab Lab Lima - Creative Commons Attribution Non Commercial

Source code hosted at Fab Lab Lima 2025

|