Week4 Embedded programming.
Group Assignment
...
Individual Assignment
QPAD – XIAO
The assignment for this week is to study, understand, and program a microcontroller provided by FabLab León: a XIAO RP2040 For this study, we use the manufacturer’s datasheet, and for programming we use Arduino, which must be installed and configured on our computer.
The electronic board provided to us is a QPAD-XIAO, equipped with a Seeed Studio XIAO RP2040 development board, a 0.96-inch I2C OLED display (128×64, SSD1306), and six capacitive touch buttons.
Seeed Studio XIAO RP2040 & RP2040 Microcontroller
In the documentation available online, we can find all the technical specifications, inputs, outputs, and other details.
XIAO-RP2040 RP2040It is important to differentiate between the Seeed Studio XIAO RP2040 development board and the RP2040 microcontroller.
The development board includes:
The microcontroller
The microcontroller, in this case an RP2040 designed by Raspberry Pi, is part of the development board and is composed of:
The microprocessor itself consists of two ARM Cortex-M0+ cores running at 133 MHz.
This differentiation between the different layers of components was a real discovery for me, since I had never worked at this level of detail before. I had always thought that the large black chip in the middle of a power board was already “the processor”.
In the following image, created by ChatGPT, we can clearly see this differentiation between the different component levels.
In the following diagrams, we can see the interconnection between the different components of the board.
Development board
Microcontroller
Pinout
Pinout Development board
Summary of functions
In summary, the functions of each of the three main components present in a board such as the Seeed Studio XIAO RP2040 are as follows:
Finally, the power board corresponds to the complete assembly provided to us, where the display and buttons are already installed.
Programming the RP2040 microcontroller with Arduino
Once we understand what we are working with, it is time to start programming.
Installation
In my case, I had never programmed a microcontroller before; in fact, I did not even know what Arduino was. Therefore, the first step was to download and install the Arduino IDE on my computer.
Once installed, it must be configured, which includes selecting the type of board to be used. Since the Seeed XIAO RP2040 is not included by default in the Arduino libraries, it must be downloaded from the official Seeed Studio website. After that, I installed Raspberry Pi Pico/RP2040 from the Boards Manager.
With the correct board installed, the next step was to select it and configure the communication port where the QPAD–XIAO was connected, in my case COM3.
Programming
Since I had never worked with this type of software before, the first step was to use the examples included in the Arduino IDE. Additionally, I was able to use the examples provided in the QPAD–XIAO Repository.
First example: Blink
The first program was simple: making one of the onboard LEDs blink. I opened the example, compiled it, and… it worked!
Second example: Hello World – Hello Efren
In this example, I realized during compilation that some components were missing. Arduino warned me that the Adafruit library was not installed. I searched online for the display model and installed the corresponding libraries, specifically Adafruit SSD1306. After that, I modified the text line and, instead of “Hello World”, I obtained a nice “Hello Efren” on the screen.
Third example: Buttons
In this example, I learned how to use the buttons included on the board. After compiling the example, all the buttons responded correctly.
Custom program
In this case, I tried to write more text on the display by configuring the cursor position, achieving a third line of text.
Summary
My experience with this assignment has been very rewarding. I cannot say that I have learned how to program in Arduino yet, but I have discovered more layers in the construction of microcontroller-based systems and now better understand their architecture. At the same time, reading and testing different example codes is helping me become familiar with this programming language, even if for now I barely know how to edit the code. But every journey has to start somewhere.