Week 04-Embedded Programming

Assignment items

Group assignment

Individual assignment




Fab Academy Rubric — Have you?
The criteria evaluators look for this week.





Tools

The process

This week is exciting and an area I wanted to learn more about in detail. I usually used microcontrollers for educational use — ones already built to make robotics and coding easy for K-12 children, who are our main stakeholders in the robotics education domain.

Microcontroller Comparison:


I am very new in this, so I asked FabGPT to help me in comparing between the list provided and the selection process

HTTP link

01 | I asked for help to compare and select a few to compare

Personal Access Token

02| Asked for table with basic comparison before opening the data sheets

MCU CPU / Class Clock Memory (on-chip) Big “why”
AVR128DB32 8-bit AVR 24 MHz 128KB Flash, 16KB SRAM Best practical 8-bit mixed-signal + 5V friendliness
RP2040 Dual-core Cortex-M0+ up to 133 MHz 264KB SRAM Best for timing + learning 32-bit MCU structure
ESP32-C3 RISC-V + Wi-Fi/BLE up to 160 MHz ~400KB SRAM (family) Best entry to IoT + wireless MCU datasheets
ESP32-C6 RISC-V + Wi-Fi 6/BLE/802.15.4 up to 160 MHz 512KB SRAM (noted by vendor) Best for modern multiprotocol (Thread/Zigbee)
I agree
  • Feedback: I was interested to learn more about Raspberry Pi and ESP


Task 01: RP2040


New file in Photoshop

01 | I opened the datasheet from this link

Tools used for drawing

02| One main piece of information I saw: "Code may be executed directly from external memory" / "Debug is available via the SWD interface"

raster image zoom in

03| This diagram shows the pins available for connecting the other elements and devices

raster image zoom in

04| This sentence is in English but I did not understand what it means: "The four bus masters can access any four different crossbar ports simultaneously, the bus fabric does not add wait states to any AHB-Lite slave access."

raster image zoom in

05| I looked on YouTube for a simple explanation and found this video

raster image zoom in

06| As I have limited time to allocate to this task, I searched for some explanation videos to make sure I understand the main concepts and that I'm ready for the next assignment from this link

raster image zoom in

07| I also shared the datasheet with FabGPT to create a one-pager highlighting important information for a user with no experience

raster image zoom in

08| Functional diagram

raster image zoom in

09| and I asked to reference pages and section from the datasheet against each important information

raster image zoom in

10| I looked in to Power Supply Schemes, Im still not sure how will this effect my desecion building the circuit

raster image zoom in

11| I looked into the different kinds of memories and tried to understand the differences

raster image zoom in

12| Processor Controlled Boot Sequence

raster image zoom in

13| Logic and structure of the GPIO

raster image zoom in

14| I found this block diagram, and the explanation on page 443 was a good summary of everything I read in this datasheet

I liked RP2040
  • Feedback: I learned a lot and I think RP2040 would be a good choice for a more complicated project than the shoulder-guided posture fixture
  • Challenge: It was not easy to understand the datasheet because I did not know many of the concepts and references mentioned

Programing Microcontroller:


Option 01: Building simple circuit


HTTP link

01 | I will be using the ESP32-C3 SuperMini for this task, as we have more pieces of this in our lab, and for my project I will need two microprocessors communicating

HTTP link

02 | It is small and I have enough GPIOs for my project

HTTP link

03 | I used AI Gemini to learn more about the microcontroller

HTTP link

04 | I read the ESP32-C3 SuperMini datasheet to get more details

A dedicated token

05| I connected the microcontroller to a breadboard and made sure I do not connect two pins on the same pin line to avoid short circuits. I also added a 4-leg button

Token scope should be API

06| Then I added a LED light bulb and a 10K resistor.

Token scope should be API

07| Then I used wire jumpers to connect my circuit.
Pin7 → LED → Resistor → GND
Pin9 → Button → GND. And as I'm documenting, I realized a huge mistake — the resistor should be connected before the LED, not after

Token scope should be API

08| Then I connected the MC to the computer to start programming

Token scope should be API

09| I used this code from a previous project in Arduino and downloaded the program to the MC

Token scope should be API

10| When pressing the button, the LED lights ON.

Not bad at all
  • Feedback: This was a simple circuit created fast to fulfill this assignment.
  • Challenge: I misconnected the resistor and LED and came to know about the mistake while I was documenting. This showed the value of documentation in re-evaluating projects, as well as the importance of rechecking connections. Misplacing a resistor may result in damaging some parts.

Option 02: MicroPython


Token scope should be API

01| My first trial was with ESP IDE it include a blocks coding and python interface with USB and bloothoth pairing

Token scope should be API

02| I tried to connecte ESP32 C3 XIAO to it but the device was not connecting, I trying to trouble shoot that using Gemeni AI but couldnt get it to work

Token scope should be API

03| I moved to the second IDE which is VIPER I tryied to also connect my ESP32 C3 XIAO but had deficulties

Token scope should be API

04| Then I tried Thonny I first downloaded the App

Token scope should be API

05| setting up Thonny with ESP32 C3 setup and making sure its selectingt he correct ports

Token scope should be API

06| I found that I needed to download microPhython frameworks to the microcontroler before sending any code

Token scope should be API

07| The interpretaion has to also change to MicroPython

Token scope should be API

08| I tried a code for blinking LED and It worked


# LED light blinking 

from machine import Pin
import time

# Replace 'X' with the GPIO number from your PCB design
led = Pin(X, Pin.OUT)

while True:
    led.value(0)  # Logic 0 = LED ON (Common Anode)
    print("LED is ON")
    time.sleep(0.5)
    
    led.value(1)  # Logic 1 = LED OFF
    print("LED is OFF")
    time.sleep(0.5)
					
Didn't have the time!
  • Feedback: it was not easy to get an online platfrom connecte with XIAO but I found that sometimes its and issue with the microcontroller and a local IDE will be better to code. I also foucnd that Microphyton is and easier programing laguage but I feel C++ is more detailed and stronger for bigger projects
  • Challenge: I dont have a lot of time to learn a new language so I will continue with Microphython and will try to learn as I continue

Reflection

What worked
  • Using FabGPT to build a comparison table made choosing between the AVR, RP2040, and ESP32 families much faster.
  • Building a simple LED + button circuit on a breadboard was a low-stakes way to get the ESP32-C3 programmed and running.
  • Documenting as I went caught a real wiring mistake — the resistor was on the wrong side of the LED.
What didn't
  • The datasheet was hard to follow — a lot of terms and references I didn't know yet.
  • I misconnected the resistor and LED and only caught it while writing up the steps.
  • I ran out of time to try the Python / MicroPython path as a second environment.
What I'd do differently
  • Sketch the circuit on paper and check component order before wiring the breadboard.
  • Read the datasheet with a glossary open, instead of trying to parse every term cold.
  • Leave time to try a second toolchain (MicroPython) for the extra-credit comparison.
Key learnings
  • The ESP32-C3 SuperMini fits my final project — small, enough GPIO, and wireless built in.
  • Component order matters: a resistor before vs. after the LED is not the same circuit.
  • Documentation isn't just recording — the act of writing it up exposes mistakes.