Skip to content

4. Embedded Programming

Group Assignment

  • Demonstrate and compare the toolchains and development workflows for available embedded architectures
  • Document your work to the group work page and reflect on your individual page what you learned

Embedded Program Toolchain & Workflow Comparison

We went through the following 6 toolchains to write programs to boards.

Toolchain Language Processor Chip Protocol Programming Chain Ref.
Arduino IDE + ISP C/C++ (Arduino) AVR ATtiny44, ATmega328P ISP ArduinoUno(ArduinoISP) > t44Board Arduino ISP
FA2018
Arduino IDE + UPDI C/C++ (Arduino) AVR 1-series ATtiny412, 1614, 3216 UPDI USBSerialCable > UPDI > t412Board FA2021
Arduino IDE + SWD C/C++ (Arduino) ARM SAMD11C JTAG/SWD XiaoSAMD21(Daplink) > SAMD11Board Bali Fest2022
Arduino IDE + FTDI C/C++ (Arduino) Xtensa ESP32 FTDI / USB-Serial USBSerialCable > BrduinoBoard Barduino
FA2020
PlatformIO + FTDI C/C++ Xtensa ESP32 FTDI / USB-Serial USBSerialCable > BrduinoBoard Barduino
FA2020
Thonny / MicroPython MicroPython RP-series RP2040 USB (UF2) USB-C Cable → Xiao RP2040 Raspberry Pi

Arduino IDE + ISP

Result: Unsuccessful ❌

ISP (In-System Programming) is one of the oldest methods for programming AVR microcontrollers. An Arduino board (e.g., Arduino Uno) is used as a programmer by loading the “ArduinoISP” sketch onto it. It then communicates with the target chip (ATtiny44, ATmega328P) over the SPI protocol using 6 lines (MISO, MOSI, SCK, RESET, VCC, GND). The code is written in C/C++ using the Arduino IDE. This time, we used Arduino Uno as the programmer and the target chip was ATmega328P on Arduino Nano.

Arduino IDE + ISP

We followed the steps outlined in the official Arduino site and previous Kannai documents.

  1. Connect Arduino Uno to PC by USB
  2. Select Board: Arduino UNO
  3. Upload ArduinoISP from sample sketch: File > Examples > 11. ArduinoISP > ArduinoISP
  4. Write the sketch to UNO
  5. Connect Arduino Uno(ISP) to Arduino Nano(Target)
  6. Open a sketch for Arduino Nano
  7. Select programmer : Arduino as ISP
  8. Write the sketch from programmer

However, the operation was not successful. Arduino IDE + ISP, failure

Arduino IDE + UPDI

Result: Success ✅

UPDI (Unified Program and Debug Interface) is a newer single-wire programming interface for the AVR 1-series chips (ATtiny412, 1614, 3216). Unlike ISP which requires multiple pins, UPDI only needs one data line plus power and ground. A simple USB-Serial adapter with a resistor can serve as a UPDI programmer. The Arduino IDE supports these chips through the megaTinyCore board package.

Arduino IDE + UPDI

We went through the following simple steps.

  1. Connect USB-Serial adapter to PC
  2. On Arduino IDE: Tools > Programmer: ‘Serial Port and 4.7k (pyupdi style)’

Select serial port We wrote the echo.ino program and it worked perfectly! Echo

Arduino IDE + SWD

Result: Unsuccessful ❌

SWD (Serial Wire Debug) is the standard programming and debugging interface for ARM-based microcontrollers like the SAMD11C. It uses two wires (SWDIO and SWCLK) and allows not only programming but also real-time debugging. Here, a Xiao SAMD21 board running DAPLink firmware acts as the programmer/debugger for the target SAMD11C board.

Arduino IDE + SWD

We went through the following steps.

  1. Upload DAPLink firmware to Xiao, see details
  2. Burn Bootloader to SAMD11C board

However, while loading Board Manager, the operation timed out and was unsuccessful. Timeout

Arduino IDE + FTDI

Result: Unsuccessful ❌

FTDI / USB-Serial is a method for uploading programs to boards that already have a bootloader installed (like the ESP32). A USB-to-Serial adapter sends the compiled binary over a serial connection (TX/RX). The bootloader on the ESP32 receives the data and writes it to flash memory. No special programmer hardware is needed beyond the serial cable.

Barduino + FTDI

However, again we experienced a timeout.

PlatformIO + FTDI

Result: Success ✅

PlatformIO is an alternative development environment to Arduino IDE that runs as a VSCode extension. It uses the same FTDI/USB-Serial upload method for the ESP32, but offers features like dependency management, a built-in library manager, and support for multiple frameworks. The code is written in C/C++ and the upload process is the same as with Arduino IDE, but with some more flexibility.

In the end, we succeeded in rewriting the LED blinking program. See the video for the flickering speed change.

Here are the steps to use PlatformIO as a Visual Studio Code plugin.

  1. Open VSCode and go to the Extensions panel (Ctrl+Shift+X)
  2. Search for “PlatformIO IDE” and click Install PlatformIO extension in VSCode marketplace
  3. After installation, click the PlatformIO icon in the sidebar and select “New Project” PlatformIO Home screen
  4. Choose your board (e.g., Seeduino, ESP32) and framework, then click Finish Editing main.cpp
  5. Edit src/main.cpp with your code (e.g., LED blink)
  6. Click the Upload button (→ arrow) in the status bar to build and flash Upload button in status bar

Thonny / MicroPython

Thonny is a beginner-friendly Python IDE designed for MicroPython development. The RP2040 chip supports UF2 (USB Flashing Format) — when you hold the BOOTSEL button and plug in USB, the board appears as a USB drive. You drag the MicroPython firmware (.uf2 file) onto it to install. After that, Thonny connects over USB-Serial to run Python scripts interactively on the board, with no compilation step needed.

Disclaimer

I used Claude Code to draft the description of toolchains.

Resources