Skip to content

In this lab we design microcontroller-based embedded systems for various applications. Topics covered include interfacing to sensors and actuators from both hardware and software perspectives, assembly and C programming for embedded systems I/O, real-time design, and interrupts. In addition, we implement and evaluate a complete embedded system.

Notifications You must be signed in to change notification settings

MONO-1223/AURAK-CENG432-EmbeddedSystemDesignLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded System Design Lab

The TM4C123G LaunchPad evaluation kit is an affordable platform designed for development with Arm Cortex-M4F-based microcontrollers (MCUs). Powered by the 80-MHz 32-bit Arm Cortex-M4F CPU, the kit features the TM4C123GH6PM MCU, which offers 256KB of flash memory, 32KB of SRAM, and 2KB of EEPROM. This MCU is equipped with a range of communication capabilities, including USB 2.0 support for host, device, and on-the-go (OTG) operations, as well as two 12-bit analog-to-digital converter modules. It also provides various serial communication interfaces such as UART, SPI, I2C, and CAN, enabling flexible connectivity for different applications. Notable features of the TM4C123G LaunchPad include its hibernation and PWM modules, which enhance its power management and motion control capabilities. The EK-TM4C123GXL kit also comes with programmable user buttons, an RGB LED, and stackable headers that allow easy connection to BoosterPack™ plug-in modules, enabling users to expand the functionality of the platform via the Texas Instruments BoosterPack ecosystem. To streamline development, the TivaWare SDK, provided by Texas Instruments, includes drivers for all onboard peripherals and example code for a wide range of applications. The TM4C123G LaunchPad is a versatile evaluation platform for embedded systems, offering a high-performance MCU and comprehensive development tools. The Tiva 4C development board includes an onboard debugger for debugging programs in Keil MDK. However, to establish a communication link between Keil and the development board, your PC requires the installation of In-Circuit Debug Interface (ICDI) drivers.

Keil µVision Tutorials

Keil µVision is an integrated development environment (IDE) designed for embedded systems programming, primarily targeting ARM-based microcontrollers. It provides a comprehensive suite of tools, including a code editor, compiler, debugger, and simulator, to streamline firmware development. With built-in support for ARM Cortex-M, Cortex-R, and legacy ARM7/ARM9 architectures, Keil µVision enables developers to write, compile, and debug code efficiently. The IDE integrates seamlessly with the Keil RTX real-time operating system and includes performance analysis tools to optimize execution. Its user-friendly interface, extensive device support, and robust debugging features make it a popular choice for engineers working on embedded applications from IoT devices to industrial automation.

Opening.an.Existing.Project.From.Keil.and.File.Explorer.and.Building.and.Uploading.It.to.The.Tiva.Board.mp4
Using.The.Logic.Analyzer.Texas.LaunchPad.Simulator.in.Debug.Mode.mp4
Interacting.With.The.LaunchPad.and.Using.The.Logic.Analyzer.Cursors.mp4

To run the codes on your board, download and extract the RAR file from each experiment's subdirectory, then open the .uvprojx file in Keil uVision5. Additionally, when using Keil uVision, it's important to keep file paths short to prevent unexpected errors. If a project is stored in a deeply nested directory or has excessively long file names, Keil may fail to load it properly, displaying the XML file contents instead of the project interface. This can cause confusion and make accessing design files difficult. To avoid this, store your project in a shorter directory path and minimize unnecessary subfolders.


FAQ

1. What's the difference between a microprocessor and a microcontroller?
A microprocessor is the central processing unit (CPU) of a computer system, designed primarily for executing instructions and performing computations, but it requires external components like memory, input/output interfaces, and peripherals to function. In contrast, a microcontroller is a compact, self-contained system that includes a microprocessor, memory (RAM and ROM), and peripherals (such as timers, I/O ports, and communication interfaces) all integrated into a single chip, making it ideal for embedded applications. While microprocessors are used in high-performance computing systems like desktops and servers, microcontrollers are optimized for specific control tasks in embedded systems like appliances, automotive control units, and IoT devices.

2. What's the difference between C and Embedded C?
C and Embedded C share the same fundamental syntax, structure, and principles, but they differ in their application and constraints. Standard C is a general-purpose programming language used for developing software that runs on computers, operating systems, and various applications. It provides features like file handling, dynamic memory allocation, and standard input/output operations, making it suitable for high-level software development. On the other hand, Embedded C is a specialized extension of C tailored for programming microcontrollers and embedded systems, where hardware interaction is crucial. Unlike standard C, Embedded C often requires direct access to hardware registers, bit manipulation, and precise timing control. It typically lacks standard library functions like malloc() or printf() due to memory and performance limitations in embedded devices. Additionally, Embedded C includes hardware-specific optimizations and often involves writing code that interacts with peripherals like GPIO, timers, and interrupts. While both languages follow similar syntax, Embedded C is designed to run on resource-constrained environments, making efficiency and real-time execution a priority.

3. What does GPIO mean?
GPIO (General-Purpose Input/Output) is a type of digital pin found on microcontrollers, microprocessors, and embedded systems that can be configured as either an input or an output. Unlike dedicated communication or power pins, GPIO pins are highly versatile and can be programmed to perform various functions, such as reading sensor data, controlling LEDs, or interfacing with external components like motors and displays. When set as an input, a GPIO pin can detect signals from buttons, switches, or sensors, allowing the system to respond accordingly. When configured as an output, it can send signals to activate devices such as relays, buzzers, or actuators. GPIO pins often support additional features like internal pull-up or pull-down resistors and can be controlled through programming languages such as C, Python, or VHDL, depending on the platform. They are widely used in embedded systems, IoT applications, and hardware prototyping with development boards like Raspberry Pi, Arduino, and STM32.

4. What's the difference between a port, a pin, a register, and a bit?
A port is a group of pins that serves as an interface for communication between a processor and external devices, allowing data transfer as input or output. A pin is a single physical connection point on a microcontroller, FPGA, or processor that can carry input, output, or bidirectional signals, often as part of a port. A register is an internal storage unit within a processor or digital circuit that temporarily holds data, addresses, or control signals for processing. A bit is the smallest unit of digital data, representing either 0 or 1, and is the fundamental building block of registers, ports, and memory, determining how information is stored, processed, and transmitted. While ports and pins handle external communication, registers manage internal data, and bits form the foundation of all digital operations.

5. What is a peripheral?
A peripheral is a device that connects to a computer or microcontroller to extend its functionality without being part of the core processing unit. Peripherals can be categorized based on their role: input devices, such as keyboards, mice, and scanners, allow users to send data to a system, while output devices, like monitors, printers, and speakers, display or process information from the computer. Storage peripherals, including USB drives and external hard disks, provide additional memory for data storage, whereas communication peripherals, such as network adapters and Bluetooth modules, enable data exchange between systems. In embedded systems, peripherals can be built-in or externally connected components like sensors, actuators, LCD screens, or communication interfaces such as UART, SPI, and I2C. These peripherals play a crucial role in enhancing the capabilities of both general-purpose and embedded computing devices.

6. What's the difference between Intel DE2-115, STM32L476, and Tiva TM4C123G?
They represent different platforms with distinct strengths, designed for various embedded applications. Each offers unique features suited to specific tasks, ranging from high-performance computing to low-power embedded control. While the FPGA and microcontrollers serve different roles, they can complement each other in hybrid designs. FPGAs, like the DE2-115, are ideal for handling high-speed, parallel processing tasks, such as custom hardware modules for signal or image processing. Microcontrollers, like the STM32L476 or TM4C123G, excel in managing system control, communication, and low-speed tasks. For instance, in a robotics system, the FPGA might be used to process vision data in real time, while the microcontroller handles motor control, sensor interfaces, and higher-level decision-making. Both platforms can interface with external peripherals like sensors, displays, and communication modules, but they do so in different ways. The FPGA might handle real-time, parallel data acquisition, while the microcontroller processes and configures the peripherals. The Intel DE2-115 FPGA is typically placed at the heart of high-performance computing systems or subsystems that require high customization and parallelism, excelling in tasks like cryptography, video processing, or AI acceleration. It is often integrated with microcontrollers or CPUs through buses or memory-mapped interfaces. In contrast, the STM32L476 microcontroller is better suited for low-power, real-time control tasks, commonly used in IoT devices, wearables, and portable instrumentation. It interfaces with sensors, handles communication protocols, and controls actuators while conserving energy. Meanwhile, the Tiva TM4C123G microcontroller offers a reliable and cost-effective solution for general-purpose embedded tasks, such as in educational setups or small robotics, providing effective control and logic management. However, it is less optimized for low-power applications than the STM32L476 or high-performance tasks compared to the DE2-115 FPGA.

About

In this lab we design microcontroller-based embedded systems for various applications. Topics covered include interfacing to sensors and actuators from both hardware and software perspectives, assembly and C programming for embedded systems I/O, real-time design, and interrupts. In addition, we implement and evaluate a complete embedded system.

Topics

Resources

Stars

Watchers

Forks