
Welcome to Embedded C Programming
1.1 The Beginning of Embedded Programming
Imagine a small electronic device that can measure temperature, detect movement, control a motor, or communicate wirelessly with another device. Behind many of these capabilities is a combination of hardware and software working together.
This is where embedded programming begins.
Unlike software developed primarily for desktop computers, embedded software often interacts directly with electronic components and physical processes. A microcontroller can receive information from sensors, process that information according to programmed instructions, and produce a response through an output device.
A microcontroller typically integrates a processor, memory, and input/output peripherals into a single chip. These components allow the device to perform dedicated tasks and interact with external hardware [1].
In this learning series, we will explore how to create such programs using the C programming language.
Our goal is not simply to teach programming syntax. We want to understand how instructions written by a developer can become firmware that controls a physical electronic system.
This approach follows the educational principles introduced in Embedded Systems: Shape the World by Jonathan W. Valvano and Ramesh Yerraballi, which combines embedded programming, computer architecture, hardware interfaces, and practical experimentation [1, 2].
1.2 Why Learn Embedded C?
C remains an important programming language in embedded systems development because it provides efficient execution, explicit control over data representation, and access to hardware through libraries and low-level programming interfaces.
The Massachusetts Institute of Technology (MIT) recognizes C as an important language for embedded processors and microcontrollers in its Practical Programming in C course [3].
When developing firmware, programmers must often consider constraints that are less noticeable in general-purpose applications, including memory capacity, processing time, power consumption, and the behavior of connected hardware.
Learning C provides a foundation for understanding these engineering decisions.
The Espressif IoT Development Framework (ESP-IDF), which we will use throughout this series, supports C programming through the GCC compiler toolchain. Its development environment allows programmers to create applications that interact with ESP32 hardware and its peripherals [4].
Throughout this series, we will gradually move from simple expressions and program structures to hardware interaction, communication interfaces, timing, and firmware architecture.
In practical terms, Embedded C refers here to the use of C for developing embedded software and firmware. Our lessons will use standard C concepts together with the hardware-specific facilities provided by the development framework.
It is also worth distinguishing this general educational use of the term from ISO/IEC TR 18037, a technical report that formally describes extensions to the C programming language for supporting embedded processors [5].
1.3 Why the Seeed Studio XIAO ESP32-C6?
For hands-on learning, we will use the Seeed Studio XIAO ESP32-C6, a compact development board built around Espressif's ESP32-C6 system-on-chip [6].
The ESP32-C6 includes a high-performance 32-bit RISC-V processor operating at up to 160 MHz and a separate low-power RISC-V processor operating at up to 20 MHz [7, 8].
The XIAO ESP32-C6 provides 512 KB of high-performance SRAM and 4 MB of Flash storage, together with programmable input/output interfaces. The chip also includes additional low-power SRAM for specific low-power functions [6, 8].
It supports several wireless communication technologies:
Wi-Fi 6: 2.4 GHz connectivity based on IEEE 802.11ax, with backward compatibility for supported earlier Wi-Fi standards.
Bluetooth Low Energy: Wireless communication suitable for many connected devices and low-power applications.
IEEE 802.15.4: Radio connectivity used by networking technologies such as Thread and Zigbee.
These capabilities are documented by Seeed Studio and Espressif [6–8].
The board also provides access to hardware interfaces commonly used in embedded programming, including GPIO, ADC, UART, I2C, SPI, and PWM-related functionality, subject to the board's available pin mappings [6].
These features allow us to explore several important areas of embedded engineering using a single development board, from basic digital input and output to connected Internet of Things (IoT) applications.
For now, we will focus on understanding the platform rather than configuring its hardware.
1.4 Who Is This Tutorial For?
This series is designed for students, hobbyists, educators, and aspiring developers who want to understand embedded systems from the ground up.
You do not need previous experience with microcontrollers or embedded firmware.
Some familiarity with computers and basic programming concepts may be helpful, but the introductory lessons explain the essential terminology before moving into more technical material.
The series is also suitable for learners who have experimented with Arduino and now want to explore firmware development using C and Espressif's native development framework.
Seeed Studio provides a dedicated guide for developing XIAO boards using ESP-IDF, demonstrating a practical development path beyond introductory Arduino programming [9].
Our approach is inspired by university-level learning resources, including MIT's Practical Programming in C and the University of Texas at Austin's Embedded Systems: Shape the World. However, the explanations and experiments are adapted specifically for the Seeed Studio XIAO ESP32-C6 [2, 3].
1.5 What Will You Learn?
By the end of Chapter 1, Part 1, you should be able to:
Understand embedded systems: Explain the basic purpose of an embedded system and describe how it interacts with the physical world.
Identify the major components: Recognize the roles of hardware, software, firmware, sensors, processors, memory, and output devices.
Understand Embedded C: Describe why C is widely used in resource-constrained embedded applications.
Explore the XIAO ESP32-C6: Identify the development board and recognize its major hardware and wireless communication capabilities.
Understand microcontroller architecture: Recognize the basic responsibilities of a processor, memory, and input/output interfaces.
Discover ESP-IDF: Recognize Espressif IoT Development Framework as a software development framework used to build firmware for ESP32 microcontrollers.
Understand the firmware development process: Outline the general sequence of creating source code, compiling a program, building firmware, flashing the device, and observing its operation.
The firmware development workflow is introduced in Espressif's official ESP-IDF Programming Guide [10, 11].
You are not expected to master these topics immediately. Each concept will be introduced progressively and reinforced through explanations, diagrams, examples, and practical experiments.
1.6 What Do You Need to Begin?
For this introductory lesson, you only need an interest in understanding how embedded systems work.
To follow the practical programming activities in subsequent lessons, we recommend preparing the following:
Seeed Studio XIAO ESP32-C6: One development board for programming and hardware experiments.
USB-C data cable: A compatible cable that supports both power and data transfer.
Computer: A computer running Windows, Linux, or macOS.
Development environment: ESP-IDF and its associated development tools, which we will configure in the next part.
Seeed Studio provides hardware preparation instructions for the XIAO ESP32-C6, while Espressif maintains operating-system-specific instructions for setting up ESP-IDF [6, 9, 10].
Additional electronic components, such as LEDs, buttons, resistors, sensors, and breadboards, will be introduced when they are required for specific experiments.
There is no need to purchase every component before completing this introductory lesson.
1.7 How This Learning Series Works
Our learning approach combines three essential elements: theory, implementation, and experimentation.
Theory helps us understand the concepts behind embedded systems, including how processors execute instructions, how memory stores information, and how electronic components communicate.
Implementation focuses on translating these concepts into working C programs. We will learn to organize source code, use development tools, and build firmware for the XIAO ESP32-C6.
Experimentation connects our programs to real hardware. Instead of relying entirely on theoretical examples, we will observe the behavior of sensors, outputs, communication interfaces, and complete embedded applications.
This learning approach is consistent with the engineering education philosophy presented in the University of Texas at Austin's embedded systems materials, which emphasize combining conceptual understanding with practical design activities [1, 2, 12].
We will begin by developing a clear conceptual understanding of embedded systems and the C programming language. Next, we will explore how programs are organized, compiled, and executed on a microcontroller. Finally, we will apply this knowledge to hardware experiments and practical projects.
Rather than memorizing code, you will be encouraged to understand why each instruction is necessary and how it contributes to the behavior of the system.
Our software development workflow will follow Espressif's official ESP-IDF documentation, while hardware-related explanations will be based primarily on the Seeed Studio XIAO ESP32-C6 documentation and the ESP32-C6 technical references [6, 8, 10, 13].
In the next section, we will answer a foundational question: What exactly is an embedded system, and how is it different from an ordinary computer?
This is the first step toward understanding how software interacts with hardware and how a small microcontroller can become the foundation of a complete electronic device.
References
[1] J. W. Valvano and R. Yerraballi, "Chapter 1: Introduction to Embedded Systems," Embedded Systems: Shape the World, The University of Texas at Austin.
https://users.ece.utexas.edu/~valvano/Volume1/IntroToEmbSys/Ch1_Introduction.html
[2] J. W. Valvano and R. Yerraballi, Embedded Systems: Shape the World, University of Texas at Austin, Online Educational Resources.
https://users.ece.utexas.edu/~valvano/Volume1/E-Book/
[3] Massachusetts Institute of Technology, "6.087 Practical Programming in C," MIT OpenCourseWare, January IAP 2010.
https://ocw.mit.edu/courses/6-087-practical-programming-in-c-january-iap-2010/
[4] Espressif Systems, "C Support," ESP-IDF Programming Guide for ESP32-C6.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/api-guides/c.html
[5] International Organization for Standardization, ISO/IEC TR 18037:2008 — Programming Languages — C — Extensions to Support Embedded Processors, 2008.
https://www.iso.org/standard/51126.html
[6] Seeed Studio, "Getting Started with Seeed Studio XIAO ESP32C6," Seeed Studio Wiki.
https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/
[7] Espressif Systems, "ESP32-C6: Wi-Fi 6, Bluetooth LE and IEEE 802.15.4 System-on-Chip," Official Product Documentation.
https://www.espressif.com/en/products/socs/esp32-c6
[8] Espressif Systems, ESP32-C6 Series Datasheet, Official Technical Documentation.
https://documentation.espressif.com/esp32-c6_datasheet_en.html
[9] Seeed Studio, "Developed on XIAO Using Espressif ESP-IDF," Seeed Studio Wiki.
https://wiki.seeedstudio.com/xiao_idf/
[10] Espressif Systems, "Get Started," ESP-IDF Programming Guide for ESP32-C6.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/
[11] Espressif Systems, "Build the Project," ESP-IDF Programming Guide for ESP32-C6.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/get-started/start-project.html
[12] J. W. Valvano and R. Yerraballi, "Preface," Embedded Systems: Shape the World, University of Texas at Austin.
https://users.ece.utexas.edu/~valvano/mspm0/ebook/preface.htm
[13] Espressif Systems, ESP32-C6 Technical Reference Manual, Official Hardware Reference.
https://documentation.espressif.com/esp32-c6_technical_reference_manual_en.pdf

