M Musaed AlKout

Week 4 — Embedded Programming

Documentation covering embedded toolchains, Datasheets.

Instructor

Neil

Focus

Protocols + Toolchains

Target Boards

ESP32-C3

Learning Objectives

  • Implement programming protocols.

📋 Assignments

Individual Assignment

  • Browse the datasheet for a microcontroller

    Identify key specs and constraints relevant to my final project.

  • Write and test an embedded program

    Use a microcontroller to interact with local inputs/outputs and communicate using wired or wireless connections.

Group Assignment

  • Compare toolchains and workflows

    Demonstrate toolchains for different embedded architectures.

  • Document to Group's individual Page

    Publish Group's work and summarize learnings

🛠️ Tools & Materials

Category Items
Software TinkerCAD circuit simulation, Wokwi ESP32 Simulator
Hardware Tools Digital Multimeter

👥 Group Assignment

The objective of the Group Assignment is to understand and compare different toolchains for different microcontrollers. I chose the ESP32-C3, and my partner chose the Raspberry PI3.

What I compared: IDE options, compile/upload workflow, debugging approach, and how code becomes a binary for the target chip.

Next: Add screenshots of each toolchain setup (IDE, board selection, serial monitor, upload success).

What is a Toolchain in an Embedded System?

An embedded system toolchain is a set of software tools—typically a compiler, assembler, linker, and debugger—that converts source code into machine code for a specific target processor.

Key Components

  • Compiler — Translates high-level code into machine code for the MCU Architecture
  • Assembler — Converts Assembly code into machine-readable object code.
  • Linker — Combines Object files, Libraries into one executable binary.
  • Debugger — Helps inspect variables, memory, registers, and step through code to find any bugs or different behavioral than expected!

Toolchain Workflow

Compiler → Assembler → Linker → (Binary) → Flash = Upload to Microcontroller Board.

ESP32-C3 Processing Modes & IDE Choices

By using Arduino IDE and correct libraries we can program and run programs on the ESP32-C3 chip.

Common IDE Options

  • Arduino IDE — ESP32-C3 Libraries

🧪 Process & Workflow (Individual Assignment)

Part 1 — Examine the Datasheet for the board.

Some of the final project elements require Bluetooth, I have chosen to use this board to communicate to another ESP32-C3 board to transmit/receive the data.

I reviewed the Datasheet to understand how these components interact and what limitations I need to consider.

Datasheets

Note: Datasheets are very detailed, so I only focused on the sections that affect power, pins, communication, and constraints.

A. Power Requirements (What I Focused On)

ESP32-S3

  • Operating Voltage: 3.0V to 3.6V → I need a stable 3.3V regulator.
  • Current Spikes: during RF (Bluetooth) transmission, current can spike up to ~355mA → power supply should be rated at least 500mA for safety margin.

Humidity Sensor (DHT11/22)

Draws about 2.5mA to 3mA

MPU-6050

Draws about 3.5 mA to 5.2 mA during active operations.
Key Power Consumption Details:

  • Active Mode: : ~3.9 mA to 5.1 mA (with LED)
  • Sleep Mode: : ~1.4 mA to 33 µA (highly dependent on if the power LED is removed)
  • Operating Voltage: : The module usually operates on 5V, but the IC runs on 3.3V
  • Optimizing Power: : Removing the onboard power LED can significantly reduce power consumption, often dropping it to under 1 mA

Compass Sensor (HMC5883L)

Draws about 2.16V to 3.6V.

OLED Display

Draws about 20mA–25mA when fully illuminated.

B. Pinout

Pinout defines the physical pin locations and their fixed capabilities, while

  • Pinout: physical pins + constraints (power pins, ground pins, dedicated pins)

Next Steps: