Week 4
Assignment - Embeded Programming
- Group assignment:
- Demonstrate and compare the toolchains and development workflows for available embedded architectures.
- Document your work on the group work page and reflect on your individual page what you learned about characteristics of your printer(s)
- Individual assignment:
- Browse through the datasheet for a microcontroller.
- Write and test a program for an embedded system using a microcontroller to interact (with local input &/or output devices) and communicate (with remote wired or wireless connections).
From Assignment Details.
Assignment 1.1
The toolchain I am going to document in this case is that of the Xiao ESP32-C3. Link to group assignment page.
Move to Group Assignment Page:
- Install Arduino IDE.
- Try install ESP32 Board... first install Board Package Repository.
- Fails on Timeout...(See Fix 2)
- Install
Arduino-CLI, - Edit YAML preferences,
- Retry install Board Package Repository.
- Install Board Package, and select port and Board (XIAO_ESP32C3 in this case)
- Use sample code from Wiki (changed GPIO)

This was a very basic project. A jungle of potential shorts and bad breadboard connections, but it works on the desk. See the sequence sketch in the Files Section below. It is a test of digital outputs, and inputs (still pending).

Reflection, contd.
Documentation for the ESP32-C3 Xiao board from Seeed Studio, is available on the Seeed Studio Wiki.
-
The Breadboard prototype works while on the desk, but has disadvantages in terms of connection quality (physical, and electrical). Disconnection would interrupt protocol-based connections.
-
Fix 1 and Fix 2 below, and certain OS-specific differences remain. I would not be sure I could repeat the same process on Linux or Windows.
-
Considering Fix 1, also, it strikes me that the process of adding board package repositories has not become easier in many versions of the IDE. Just a little strange that there should be two tiers of third-party boards in my opinion.
Assignment 1.2
Datasheet for a microcontroller.
- Read: ESP32-C3 Datasheet
Pinout for ESP32-C3

Pinout Diagram for Xiao ESP32-C3 SoC

Fix 1 (Additional Board Packages)
This is documented in the Getting Started section for this board. However, it is worthwhile noting that a similar step is required for many different boards (Arduino clones, various ESP8266/ESP32's, DFRobot, and others).
For the Xiao ESP32-C3, the board package repository is:
https://jihulab.com/esp-mirror/espressif/arduino-esp32.git
Add this on your Arduino IDE Preferences page (File > Preferences on Windows, and Arduino IDE > Settings on MacOS), as follows:

Then, the Board Manager will be able to install the respective boards as normal.

Fix 2 (Extend Board Manager Timeout)
If your IDE is hanging and timing out while installing boards...


The Custom Boards package is hosted on a CDN that wasn't fast enough. The default timeout seems to be 300s. Based on this post by user @ptillisch, it describes how to extend the timeout and allow more time to complete.
-
You need to additionally install the Arduino CLI. (Even though you have the IDE, settings that are configured for the CLI take precedence over those set in the GUI). [Instructions for installation](https://docs.arduino.cc/arduino-cli/installation/). In MacOS, that was as follows:
brew install arduino-cli -
Locate and edit the config file:
nano ~/.arduinoIDE/arduino-cli.yaml -
Add the following to the yaml, if these lines do not exist:
network: connection_timeout: 1200s