Datasheet, Embedded devices and Programming languages
For this assignment, I explored different development environments including MicroPython, CircuitPython, Arduino IDE, and MBlock. After testing, I decided to primarily use Thonny IDE for MicroPython development with the Raspberry Pi Pico (RP2040), as it provides a clean interface and direct serial interaction with the board.
To begin, I installed MicroPython firmware on the Raspberry Pi Pico using Thonny’s built-in installer.
The firmware was successfully installed (MicroPython v1.27.0 on RP2040).
After installation, I configured the interpreter inside Thonny:
Once connected, the MicroPython REPL (Shell) becomes active. This allows direct interaction with the microcontroller.
I explored the machine library from MicroPython documentation.
Specifically, I used the Pin class to control GPIO outputs.
Basic LED test on onboard LED (GPIO 25):
from machine import Pin
import time
led = Pin(25, Pin.OUT)
while True:
led.on()
time.sleep(1)
led.off()
time.sleep(1)
To make the program run automatically after reset, I saved the script as main.py directly on the Raspberry Pi Pico.
At this stage, I was able to successfully implement blinking LED and neon light control. Further experimentation with input devices and advanced peripherals will be continued in the next phase.
For this assignment, I explored MicroBlocks as a visual programming environment for the Xiao RP2040 board. MicroBlocks allows real-time interaction with the microcontroller and is useful for rapid testing of input and output devices.
The board was connected via USB. From the top-right menu,
I selected Connect → connect (USB). The device
appeared as Board CDC (COM7), confirming that the
serial communication was working correctly.
After establishing the USB connection, I verified that the selected board was Xiao RP2040. This ensures correct pin mapping and compatibility with the RP2040 architecture.
To control the RGB LED (NeoPixel), I opened the library manager and added the NeoPixel (WS2812) library. This provides blocks for controlling RGB color values.
I created a simple program using block-based logic:
This basic program allowed me to test output control of the NeoPixel LED.
The NeoPixel LED responded correctly to the programmed instructions. This confirms:
Status: Completed ✅
After installing Arduino IDE (v2.3.7), I added the RP2040 board support package using the Additional Boards Manager URL.
File → Preferences → Additional Board Manager URLs
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
After installing the board package, I selected:
Arduino prompted installation of the Raspberry Pi Pico / RP2040 core. The installation was completed successfully.
I wrote a simple program to blink the green LED of the RGB LED.
#define PIN_RED 17
#define PIN_GREEN 16
#define PIN_BLUE 25
void setup() {
pinMode(PIN_RED, OUTPUT);
pinMode(PIN_GREEN, OUTPUT);
pinMode(PIN_BLUE, OUTPUT);
digitalWrite(PIN_RED, HIGH);
digitalWrite(PIN_GREEN, HIGH);
digitalWrite(PIN_BLUE, HIGH);
}
void loop() {
digitalWrite(PIN_GREEN, LOW);
delay(500);
digitalWrite(PIN_GREEN, HIGH);
delay(500);
}
Result: Green LED blinking successfully.
I tested an SSD1306 OLED display using Adafruit libraries and I2C communication.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
Serial.begin(115200);
delay(50);
display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
}
void loop() {
display.clearDisplay();
display.setCursor(28, 25);
display.print("Hello world!");
display.display();
}
Result: OLED successfully displayed "Hello world! (need attention)"
The sketch compiled successfully. Memory usage and flashing process were verified during upload.
| Task | Status |
|---|---|
| Compare different microcontroller toolchains and development workflows (Thonny, Arduino IDE, MicroPython, CircuitPython, mBlock) | In Progress |
| Compare microcontroller architectures | In Progress |
| Read and analyze RP2040 microcontroller datasheet | Completed |
| Program a microcontroller board (RP2040) | Completed (Basic I/O) |
| Experiment with output devices (LED blinking, NeoPixel test) | Completed |
| Experiment with input devices | In Progress |
| Soldering and board preparation | Completed |
| Load external program from Git repository and test functionality | Partially Successful |
| Document development process and testing results | In Progress |
| Extra credit: Make something with wired or wireless connections | Not Started |
| Extra credit: Try different languages and development environments | Partially Completed |