Embedded Programming
Group assignment:
- 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
Individual assignment:
- Browse through the datasheet for your microcontroller
- Write a program for a microcontroller and simulate its operation to interact (with local input and/or output devices) and communicate (with remote wired or wireless connection)
Important informations
This week I started by researching more about embedded programming and embedded systems using ChatGPT and some YouTube videos for more understanding on this week 4.
Embedded programming is the process of writing software for embedded systems, which are small computers built into larger devices to perform specific tasks. This type of programming focuses on efficiency, real-time performance, and direct control of hardware.
link
- An embedded system is a specialized computer inside a device, designed to perform a dedicated function. It includes a microcontroller or microprocessor, memory, input/output interfaces, and software to control its operations. These systems are found in everyday technology, such as smart appliances, medical devices, and industrial machines, helping automate tasks and improve efficiency with limited power and resources.
link
- A microcontroller is a compact chip with a CPU, memory, and peripherals, designed for specific tasks like controlling devices or sensors. It executes instructions stored in its built-in memory, processes inputs from sensors, and directly manages hardware using GPIOs, timers, and communication interfaces.
- A microprocessor is a standalone CPU that requires external memory and peripherals, used in general-purpose computing. It processes data by fetching instructions from external storage, performing complex computations, and communicating with other components via system buses, making it more powerful but hardware-dependent.
Embedded Architecture refers to the design and structure of an embedded system's hardware and software components. It includes the microcontroller/microprocessor, memory, input/output interfaces, and the software stack that runs on the hardware.
- A Toolchain is a set of programming tools used to create software applications for a specific platform. In the context of embedded systems, a toolchain typically includes a compiler, linker, assembler, and debugger. These tools work together to convert human-readable code into machine code that can be executed by the embedded device.
- Compiler: Converts code into machine language (e.g., ARM GCC, AVR-GCC).
- Debugger: Assists in testing and debugging (e.g., J-Link, AVR Dragon).
- IDE: Integrated Development Environment for code development (e.g., Keil uVision, Arduino IDE).
- A development workflow is a series of steps followed by developers to create, test, and deploy software. In embedded systems, this workflow usually involves writing code, compiling it into machine code, flashing it onto the microcontroller, and debugging any issues that arise.
- Requirements Analysis: Define the task and system requirements.
- System Design: Plan the hardware and software architecture.
- Code Development: Write code in languages like C/C++.
- Compilation: Use a compiler to convert code into machine language.
- Flashing: Upload the compiled code to the microcontroller.
- Testing and Debugging: Verify functionality and fix issues.
- Deployment: Integrate the embedded system into the final product.
#.Individual assignment
This week's assignment was to browse through the datasheet for our microcontroller, and I chose to use Arduino Uno R3.
I went through the ATmega328P datasheet, which is the microcontroller used in the Arduino Uno R3, and here’s what I found.
A datasheet is basically a technical guide that explains everything about a component—its specifications, how it works, and how to use it properly in a circuit.
For the ATmega328P, the datasheet provides details on its 8-bit AVR architecture, operating voltage (1.8V–5.5V), and clock speed (16 MHz). It also outlines the memory structure, which includes 32 KB of Flash, 2 KB of SRAM, and 1 KB of EEPROM.

The datasheet also has a pin configuration section, which describes all 28 pins and their functions, like GPIOs, ADC, UART, SPI, I2C, and PWM.

I got these imformation on link
Program a microcontroller
To program a microcontroller and simulate its operation, I started by exploring WOKWI. In the wokwi I needed to blink an LED and rotate a servo motor.



The Seeed Studio XIAO ESP32C3 is a really small but powerful microcontroller that comes with Wi-Fi and Bluetooth 5 (BLE) built-in. It has 11 GPIO pins, which means you can connect it to sensors, LEDs, and other components using PWM, ADC, I2C, UART, or SPI. It runs on 3.3V and has a USB-C port, making it easy to program and power. Because of its tiny size (21 x 17.5 mm) and low power usage, it’s perfect for small and energy-efficient projects.

You can use this board for things like IoT projects, wearable devices, robotics, and DIY electronics. If you want to build a smart home system, wireless sensors, or a remote-controlled device, this board is a great choice. Since it has built-in Wi-Fi and Bluetooth, it’s perfect for projects that need wireless communication. Plus, it has a deep sleep mode, which helps save battery life, making it ideal for portable gadgets.

#.Group assignment:
link
