EMBEDDED PROGRAMMING

This week, I worked on embedded programming, which involves competencies in various aspects such as programming languages, debugging and testing, as well as an understanding of hardware and operating systems.

Group Assignment

As part of the group assignment, Dr. Sujit and I conducted a study that included the following tasks:

Objectives of the Study

Comparison of Toolchains – To analyze and compare different embedded system toolchains based on their functionality, compatibility, and efficiency in various development environments.

Evaluation of Development Workflows –To examine the development workflows for different embedded architectures, assessing factors such as ease of use, debugging capabilities, and optimization techniques.

Identification of Best Practices –To identify best practices for selecting and utilizing toolchains and workflows, ensuring optimal performance, reduced development time, and enhanced reliability in embedded system projects.

Architectures

1. Von Neumann Architecture:

Definition: A computing architecture in which program instructions and data share the same memory space.

Characteristics: This architecture follows a sequential processing model, utilizing a single shared bus for both instructions and data. The CPU retrieves instructions from memory, decodes them, and executes them in sequence.

Bugs/Limitations: A key limitation is the Von Neumann bottleneck, where the shared bus for data and instructions can create a performance constraint, potentially slowing down the CPU and limiting overall system throughput.

Image

2. Harvard Architecture:

Definition: Unlike the Von Neumann architecture, this design features separate memory storage for data and instructions, enabling simultaneous access to both.

Advantages: Enhances performance by eliminating the Von Neumann bottleneck, allowing data and instructions to be fetched concurrently.

Usage: Commonly implemented in embedded systems and specialized processors for improved efficiency and speed.

Image

Von-Neumann Architecture Vs Harvard Architecture

Image

3. RISC (Reduced Instruction Set Computing):

Definition: A CPU architecture that uses a small, highly optimized set of instructions.

Features: Simple, fast instructions, making it suitable for pipelining and improving execution speed.

Examples: ARM, MIPS.

4. CISC (Complex Instruction Set Computing):

Definition: A CPU architecture with a large set of instructions, which can execute complex operations in a single instruction.

Features: More powerful instructions but less efficient due to longer execution cycles.

Examples: x86.

CISC Vs RISC

Image

5. Microprocessor:

Definition: A central processing unit (CPU) on a single integrated circuit (IC), capable of executing a set of instructions and performing computation tasks.

Usage: Used in general-purpose computing like PCs, laptops, servers.

6. Microcontroller:

Definition: A small computer on a single chip, often including a CPU, memory, and I/O peripherals.

Features: Found in embedded systems, IoT devices, robotics, and home appliances. It’s designed for real-time, embedded applications.

Microprocessor Vs Microcontroller

Image

7. Multi-core:

Definition: Refers to processors that have more than one core (processing unit) on a single chip, allowing parallel execution of tasks.

Advantages: Increases performance and multitasking capabilities, reducing latency and power consumption.

8. GPU (Graphics Processing Unit):

Definition: A specialized processor for rendering graphics and handling parallel computing tasks.

Features: Designed for highly parallel tasks, ideal for graphics, machine learning, and scientific computations.

Usage: Used in gaming, deep learning, image processing, etc.

9. Embedded Systems:

An embedded system is a combination of computer hardware and software designed for a specific function. Embedded systems might also function within a larger system. These systems can be programmable or have a fixed functionality.

Definition: Specialized computing systems designed to perform a dedicated function within a larger system.

Characteristics: Often optimized for real-time operations and low power consumption.

Examples: Microcontrollers, IoT devices, automotive systems.

Image

Memory

Image

Peripherals

Image

Word Size

Image

Processor Families

Image

Microcontrollers

A microcontroller is a compact integrated circuit designed to perform specific tasks within an embedded system. It consists of a processor (CPU), memory (RAM, ROM/Flash), and input/output (I/O) peripherals, all integrated into a single chip. Microcontrollers are widely used in automation, control systems, and consumer electronics due to their efficiency, low power consumption, and real-time processing capabilities.

Arduino Uno

Arduino is an open-source microcontroller platform that integrates hardware, software, and programming tools. It is designed with a focus on simplicity, making microcontroller-based development accessible to a wide audience. The platform serves as an excellent educational tool, enabling users to learn and experiment with embedded systems efficiently.

The Arduino® UNO R3 is an ideal development board for beginners to explore electronics and programming. It features the widely used ATmega328P microcontroller along with the ATmega16U2 processor for USB-to-serial communication. This versatile board offers an excellent introduction to the Arduino ecosystem, providing a seamless and user-friendly experience for learning and prototyping.

Image

Technical Specification

Microcontroller : ATmega328

Operating Voltage : 5V

Input Voltage (recommended) : 7-12V

Input Voltage (limits) : 6-20V

Digital I/O Pins : 14 (of which 6 provide PWM output)

Analog Input Pins : 6

DC Current per I/O Pin : 40 mA

DC Current for 3.3V Pin : 50 mA

Flash Memory : 32 KB of which 0.5 KB used by bootloader

SRAM : 2 KB

EEPROM : 1 KB

Clock Speed : 16 MHz

Length : 68.6 mm

Width : 53.4 mm

Weight : 25 g

Connector Pinouts

Image

Analog Pins

Image

Digital Pins

Image

Referances

Image

Arduino Mega

The Arduino Mega 2560 is a powerful microcontroller board designed for complex and large-scale projects that require more I/O pins and processing capability. It is based on the ATmega2560 microcontroller and offers expanded memory, additional communication interfaces, and increased functionality compared to the Arduino Uno.

The Arduino® Mega 2560 Rev3 is a high-performance development board designed for building large-scale applications, offering greater capability compared to other Arduino maker boards. It is powered by the ATmega2560 microcontroller, operating at a 16 MHz clock frequency.

The board features 54 digital input/output pins, 16 analog inputs, 4 UARTs (hardware serial ports), a USB connection, a power jack, an ICSP header, and a reset button, making it ideal for complex projects requiring extensive connectivity and processing power.

Image

Technical Specification

Microcontroller: ATmega2560

Operating Voltage: 5V

Input Voltage (recommended): 7-12V

Input Voltage (limit): 6-20V

Digital I/O Pins: 54 (of which 15 provide PWM output)

Analog Input Pins: 16

DC Current per I/O Pin: 20 mA

DC Current for 3.3V Pin: 50 mA

Flash Memory: 256 KB of which 8 KB used by bootloader

SRAM: 8 KB

EEPROM: 4 KB

Clock Speed: 16 MHz

LED_BUILTIN: 13

Length: 101.52 mm

Width: 53.3 mm

Weight: 37 g

>

Connector Pinouts

Image

Analog Pins

Image

Digital Pins

Image

Referances

Image

ESP WROOM 32

The ESP32-WROOM-32 is a highly versatile Wi-Fi + Bluetooth® + Bluetooth LE MCU module designed for a wide range of applications, from low-power sensor networks to high-performance tasks such as voice encoding, music streaming, and MP3 decoding.

At the core of this module is the ESP32-D0WDQ6 chip, which is designed to be scalable and adaptive. It features dual CPU cores, which can be controlled independently, with a configurable clock frequency ranging from 80 MHz to 240 MHz. Additionally, the chip includes a low-power coprocessor, which can handle peripheral monitoring and other lightweight tasks while conserving power by reducing CPU usage.

The ESP32 also integrates a rich set of peripherals, including capacitive touch sensors, an SD card interface, Ethernet, high-speed SPI, UART, I²S, and I²C, making it a powerful and efficient choice for embedded and IoT applications.

Image

Technical Specification

ESP32-WROOM-32 contains two low-power Xtensa 32-bit LX6 microprocessors

448 KBytes ROM for booting and core functions

520 KBytes on-chip SRAM

8 KBytes SRAM in RTC SLOW

8 KBytes SRAM in RTC FAST

1 Kbit of EFUSE, 256 bits MAC

WiFi: 802.11 b/g/n/d/e/i/k/r (802.11n up to 150 Mbps)

Bluetooth v4.2 BR/EDR and BLE specification

Wi-Fi mode Station/softAP/SoftAP+station/P2P

Security WPA/WPA2/WPA2-Enterprise/WPS

Encryption AES/RSA/ECC/SHA

IPv4, IPv6, SSL, TCP/UDP/HTTP/FTP/MQTT

Interfaces: SD-card, UART,SPI,SDIO,I2C,LED PWM,Motor PWM,I2S ,IR,GPIO, capacitive touch sensor, ADC, DAC, Hall sensor, temperature sensor

Operating temperature -40 + 85C

Operating voltate: 2.2-3.6V

Consumption: 80 mA typ

Dimensions: 18 mm(L) x 25.5 mm(W) x 2.8 mm(H)

Pin pitch:1.27mm

Shielding can height: 2 mm

PCB tickness: 0.8±0.1mm

Connector Pinouts

Image

Pin Description

Image

XIAO ESP32 C3

The Seeed Studio XIAO ESP32C3 is a compact and versatile IoT mini development board based on the Espressif ESP32-C3 Wi-Fi/Bluetooth dual-mode chip. The ESP32-C3 features a 32-bit RISC-V CPU with an integrated Floating Point Unit (FPU), enabling high-performance 32-bit single-precision alculations. It offers excellent radio frequency performance, supporting IEEE 802.11 b/g/n Wi-Fi and Bluetooth 5 (BLE) protocols.

This board is equipped with an external antenna to enhance signal strength for wireless applications. Its compact and custom form factor, along with a single-sided surface-mountable layout, makes it ideal for space-constrained projects. The XIAO ESP32C3 provides a rich set of interfaces, including 11 digital I/O pins (PWM capable), 3 analog I/O pins (ADC capable), and four serial interfaces (UART, I²C, and SPI). Additionally, it includes a reset button and a bootloader mode button for ease of development.

The XIAO ESP32C3 is fully compatible with the Grove Shield for Seeeduino XIAO and the Seeeduino XIAO Expansion Board, with the exception of SWD spring contacts, which are incompatible with the expansion board.

With its cost-efficiency, high performance, and low power consumption, the XIAO ESP32C3 is an excellent choice for wireless wearable applications and low-power IoT solutions.

Image

Connector Pinouts

Image

Functional Block Diagram

Image

Pinout and Schematics

Image

Features

Powerful CPU: ESP32-C3, 32­bit RISC­-V single­core processor that operates at up to 160 MHz

Complete Wi­Fi subsystem: Complies with IEEE 802.11b/g/n protocol and supports Station mode, SoftAP mode, SoftAP + Station mode, and promiscuous mode

Bluetooth LE subsystem: Supports features of Bluetooth 5 and Bluetooth mesh

Ultra-Low Power: Deep sleep power consumption is about 43μA

Better RF performance: External RF antenna included

Battery charging chip: Supports lithium battery charge and discharge management

Rich on-chip resources: 400KB of SRAM, and 4MB of on-board flash memory

Ultra small size: As small as a thumb(21x17.8mm) XIAO series classic form-factor for wearable devices and small projects

Reliable security features: Cryptographic hardware accelerators that support AES-128/256, Hash, RSA, HMAC, digital signature and secure boot

Rich interfaces: 1xI2C, 1xSPI, 2xUART, 11xGPIO(PWM), 4xADC, 1xJTAG bonding pad interface

Single-sided components, surface mounting design

XIAO RP2040

The Seeed Studio XIAO RP2040 is a compact yet powerful development board, similar in size to the Seeed Studio XIAO SAMD21, but with significantly enhanced performance. It is powered by the dual-core RP2040 processor, which supports a flexible clock speed of up to 133 MHz, making it an efficient low-power microcontroller.

The board features 264 KB of SRAM and 2 MB of onboard Flash memory, providing ample storage for programs and applications. Despite its compact size, the XIAO RP2040 delivers impressive processing capabilities while maintaining low power consumption, making it ideal for battery-operated and wearable devices.

Measuring only 21 x 17.8 mm—comparable to a thumb—this board is well-suited for wearable electronics, miniaturized projects, and embedded applications.

Image

Features

Powerful MCU: Dual-core ARM Cortex M0+ processor, flexible clock running up to 133 MHz

Rich on-chip resources: 264KB of SRAM, and 2MB of on-board Flash memory

Flexible compatibility: Support Micropython/Arduino/CircuitPython

Easy project operation: Breadboard-friendly & SMD design, no components on the back

Small size: As small as a thumb(21x17.8mm) for wearable devices and small projects.

Multiple interfaces: 11 digital pins, 4 analog pins, 11 PWM Pins,1 I2C interface, 1 UART interface, 1 SPI interface, 1 SWD Bonding pad interface

A system overview of the RP2040 chip

Image

Connection Pin out

Image

Pin Descriptions

Image
Image

Conclusion

Through the study of various microcontrollers, including the Arduino® Uno, Arduino Mega, ESP32-WROOM-32, XIAO ESP32C3, and XIAO RP2040, it is evident that each board offers unique features tailored to different applications.

The Arduino Uno serves as an excellent entry-level microcontroller, providing a user-friendly development platform for beginners.

The Arduino Mega expands on this by offering more I/O pins and memory, making it suitable for complex projects requiring extensive connectivity.

The ESP32-WROOM-32 stands out for its built-in Wi-Fi and Bluetooth capabilities, making it ideal for IoT applications and wireless communication.

The XIAO ESP32C3 further enhances IoT development with a RISC-V architecture, low power consumption, and compact form factor, making it an excellent choice for wearable and embedded applications.

The XIAO RP2040, powered by a dual-core processor, provides efficient performance and low power usage, making it well-suited for miniaturized, high-performance projects.




FAB ACADEMY - Dr. Shantanu Kadam Image