Week04 | Embedded Programming
Overview
This week I explored microcontroller datasheets, documented group comparisons of different embedded toolchains, soldered headers on a Seeed Studio XIAO RP2040 board, and programmed it using both MicroPython and Arduino IDE. I controlled LEDs and an I2C OLED display, successfully demonstrating output interaction and wired communication.
Group Assignment
In the group assignment, we demonstrate and compare the toolchains and development workflows for available embedded architectures.
Individual Assignment
Browsing Microcontroller Datasheet
For this part I took a look at into ATtiny1624 and XIAO RP2040.
ATtiny1624 / 1626 / 1627 (tinyAVR® 2-series)
Even though I did not program this chip this week, I randomly went through a microcontroller provided on the Fab Academy webpage for this week. Here is the micocontroller - ATtiny1624/1626/1627.
Basically in the first few pages of the datasheet some basic and important information can be found, I highlighted them here:
The ATtiny1624/1626/1627 microcontrollers of the tinyAVR® 2 family use the AVR® CPU with hardware multiplier, running at up to 20 MHz, with 16 KB Flash, 2 KB of SRAM, and 256B of EEPROM available in 14-, 20-, and 24-pin packages. The family uses the latest technologies from Microchip with a flexible and low-power architecture, including Event System, advanced digital peripherals, and accurate analog features such as a 12-bit differential ADC with Programmable Gain Amplifier (PGA)1.
The name of a device in the tinyAVR® 2 family is decoded as follows:
I read the feature part of the datasheet:

As I learned, I would not recommend reading the entire datasheet, but rather going directly to the parts you need. Looking through the contents and starting with the introduction section. For this microcontroller introduction was before content.
I went and saw the block diagram:

I check the Peripherals and Architecture part: 8-bit AVR (tinyAVR 2-series). Some information related to watchdog timer; The Watchdog Timer (WDT) is a system function for monitoring the correct program operation. When enabled, the WDT is a constantly running timer with a configurable time-out period. If the WDT is not reset within the time-out period, it will issue a system Reset. ADC of this microcontroller: The Analog-to-Digital Converter (ADC) peripheral is a 12-bit differential and single-ended ADC, with a Programmable Gain Amplifier (PGA), and a conversion rate up to 375 ksps at 12-bit resolution.
I read electrical characterization section:

I checked packaging type as well:

Seeed Studio XIAO RP2040
For the individual assignment, I used the XIAO Seeed RP2040. I read the RP2040 datasheet and the documentation for the Xiao Seeed RP2040 development board. This development board integrates the RP2040 microcontroller developed by the Raspberry Pi Foundation. The board includes some additional electronics that makes easier to use the microcontroller such as USB, buttons for reset and bootloader and additional UI such as LEDs.
The key features of XIAO RP2040 that I reviewed:

It was funny, but I was curious why they named it RP2040::

I checked some info related to interface and onboard:

Important parts that I need for this week is input and output pins and power supply:

Hardware preparation
I appended the Xiao RP2040, the display and two resistor to a QPAD board that was fabricated by Ivan and Gleb. I soldered pin headers using a soldering mask, straightforward.
Embedded Programming
I used both Micropython and Arduino for embedded programming.
MicroPython-Thonny IDE
I read the official Seeed Studio guide for MicroPython and I followed the following steps:
- Downloaded and flashed the latest MicroPython UF2. This step explains in our group work
- Connected via Thonny → saw successful installation.
- Source code downloaded from here and included in the download files at the end of this page.
LEDs Blinking
I started with LED blinking, from documentation for the Xiao Seeed RP2040 development board, I checked the pin number for the onboard LED:
I tested the LED with 1 second, 500 ms, 200 ms, and 100 ms delays. Here I recorded the blinking with 100 ms delay:
For the RBG colorful, the GPIO pin is 12. I installed WS2812 library in RP2040 Device. In the main code I played with colors number:
And this is the part of the output with 100 ms delay which I recorded for documentation:
Interaction with Display
We did Hello World in group work, but I wanted to try it by myself as well. I started from scratch with a simple Hello World example. The LCD display is connected using the I2C (Inter-Integrated Circuit) communication protocol, which allows the microcontroller to communicate with the display using only two wires: SDA (data) and SCL (clock).
I also downloaded ssd1306.py library and open it in Thonny and save as it in my laptop, and then I started from zero, with Hello World:
In the original code I just changed Hello world to Hello FabLab:

I tried to interaction with a few raws of display and scrolled a text from the top to the bottom of the display:
And I did a few seconds recording for my documentation:
Arduino IDE
What is Arduino? In simple terms, it is a tool that connects input and output electronics. It includes hardware, an IDE, and code. For Arduino testing and playing around, it was a bit challenging. At minimum, on 16.02.2026 I worked on it for 4 hours but still not working. I had plan to follow the instruction as I did for Micropython, from here.
First thing first, I connected the RP2040 to my laptop and recognizing board and port:
LEDs Blinking
I started with example LED Blinking and it was successfully. The source of the code included at the end of this page.
The second program which I was able to program with Arduino is RGB-LED. the source code included as well:
Interaction with Display
To interact with display I had a few challenges, I tried to show Hello world on the display again but I got this error:
Copy paste it and googling it:
Followed above and seems the error solved after getting this message:
But still I was not able to have any interaction with display.
What was above error and how did I manage to fix it? Because I am using a university laptop, I do not have administrator rights to install software or change network settings. When I first tried to use the Arduino IDE, it did not recognize the board’s port. I contacted the university IT administration, and they provided the necessary permissions to use Arduino. After that, the board was recognized correctly, and I was able to configure it and access it on the local network using mDNS, which allows devices to be found by name instead of by IP address.
But but, again I got the below errors:
I tried to fix it by myself but I was not able to. I ask ChatGPT and emphasize not explain to much, what is this error and how to fix it and the mode was on Thinking.
Prompt to ChatGPT:
what is this error:
cc1plus.exe: error: too many filenames given; type 'cc1plus.exe --help' for usage
cc1plus.exe: fatal error: @C:\Windows\TEMP\cccPt8eV: Invalid argument
compilation terminated.
exit status 1
Compilation error: exit status 1?
how to fix it? just step by step tell the solution in details and don't explain a lot.
ChatGPT answer: The error is not caused by those paths. The failure is happening because the response file itself is being parsed incorrectly, not because the include directories are wrong and ...
Anyway it was time consuming, but I was really intense to solve it. I had to see the Hello World on the screen.
I tried these codes here and I was able to have interaction with display via Arduino same as Micropython:
I asked chatGPT to modify the code that the text start moving on the display:
Reflection
- Learned how to efficiently browse microcontroller datasheets (focusing on the introduction, input & output pins, protocol communication).
- Compared toolchains: MicroPython is faster for prototyping, while Arduino provides more low-level control but requires more setup.
- I learned what embedded programming is, using MicroPython and Arduino, and got started with Python code in Thonny and C++ in the Arduino IDE.
- Gained hands-on experience soldering, debugging compiler errors, and managing libraries.
- Understood the importance of I2C as a common wired communication protocol.
- Learned how communication protocols are essential in microcontrollers and other electronic devices.
- Became more aware of the electronic devices I see daily and started thinking about what kind of microcontrollers they use and their possible applications.
- Realized how powerful the RP2040 is (speed, PIO, dual-core architecture).
- I fixed embedding links for videos and files on mkdocs. this is related to week01.
Files I Created
MicroPython codes:
Arduino codes:





















