Learning objectives
The course is oriented toward the development of practical skills in the field of embedded systems, understood as dedicated electronic systems in which a microcontroller is integrated within a device to perform specific control, monitoring, and data processing functions in interaction with the physical environment. In this context, theory introduces the fundamental principles, while laboratory activities allow their direct application on real hardware platforms.
At the end of the course, the student will be able to understand the architecture and operation of modern microcontrollers, with reference to the organisation of the core, memory, and main peripherals, and to interpret their role within a complete embedded system. The student will also be able to configure and use the main peripherals of an MCU, including digital inputs/outputs, timers, serial communication interfaces, and analogue-to-digital converters, for the implementation of control and data acquisition systems.
The student will acquire the skills required to develop simple firmware applications using typical embedded engineering approaches based on polling, interrupts, and finite-state machines, and to design systems that interact with sensors, actuators, and external devices. The student will also learn how to use professional development tools for the configuration, programming, debugging, and validation of embedded software, with particular reference to the STM32 platform.
Laboratory activities make a substantial contribution to the development of these skills through exercises and project developments that include applications oriented toward the control of electronic devices, the control of power converters, and the implementation of smart IoT nodes, with verification and validation on real hardware.
Prerequisites
Familiarity with basic computer science disciplines for programming and with the fundamental notions of digital and analogue electronics acquired in degree programmes belonging to class L-8 – Information Engineering is required. Basic knowledge of the C language, number systems, digital logic, and the main concepts related to electronic circuits is useful.
Course unit content
The course addresses the fundamental principles of microcontroller-based embedded systems, with the aim of providing students with both the theoretical foundations and the practical skills required to develop simple control, data acquisition, and communication applications on real hardware platforms.
The course is structured into a first part dedicated to the fundamentals of microcontrollers and embedded systems. In this phase, the architecture of MCUs, the organisation of the core, memory, and integrated peripherals, the methods of interaction between software and hardware, and the main low-level programming models are introduced. The concepts of polling, interrupts, finite-state machines, and basic concurrency and synchronization issues in embedded systems are also covered as fundamental tools for embedded firmware design.
A second part of the course is dedicated to the progressive development of practical laboratory skills. Through guided exercises on the STM32 platform, students learn how to configure, program, test, and validate the main peripherals of an MCU, including digital inputs/outputs, timers, PWM generation, UART, ADC, and serial communication buses. The activities involve the use of STM32CubeIDE and STM32CubeMX tools for microcontroller configuration, firmware development, debugging, and functional verification of applications.
The final part of the course is oriented toward the development of application projects, in which the acquired skills are integrated into the implementation of complete embedded systems. Project activities include the interfacing of sensors, actuators, and external devices, signal acquisition and processing, communication between devices, and validation of system behaviour on real hardware. In this context, applications oriented toward the control of power converters and/or the implementation of smart IoT nodes may be developed.
Full programme
1. Introduction to the course and to embedded systems (1 hour)
Description of the syllabus, learning objectives, teaching methods, and laboratory activities. Introduction to embedded systems and to the role of microcontrollers in control, data acquisition, communication, and automation applications.
2. Microcontrollers and embedded architectures (3 hours)
Overview of embedded electronics and definition of microcontroller. Differences between CPU, microprocessor, and microcontroller. Main MCU families and application areas. Overview of peripherals typically integrated in an MCU. Introduction to ARM microcontrollers, with particular reference to the Cortex-M family.
3. Internal architecture of microcontrollers (3 hours)
Classification of architectures: von Neumann and Harvard. Internal organisation of an MCU: core, memory, bus, and peripherals. Overview of the pipeline and the main aspects of modern microcontroller architectures. Analysis of the architecture of a commercial microcontroller, with reference to ARM Cortex-M7.
4. Low-level programming and peripheral management (2 hours)
Peripheral control and configuration registers. Access to memory-mapped registers. Peripheral initialisation and configuration. Basic concepts of polling, interrupt management, and interaction between firmware and hardware. Introduction to high-efficiency data transfer mechanisms based on Direct Memory Access (DMA), with examples of data exchange between peripherals and memory without direct CPU involvement.
5. Digital I/O (2 hours)
Structure and operation of digital input/output ports. Pin configuration. Reading digital inputs and writing digital outputs. Basic applications with push-buttons, LEDs, and logic signals.
6. Timers, timing, and PWM (3 hours)
Operating principle of a hardware timer. Time base, clock, and prescaler. Use of the auto-reload register. Events, counters, and interrupts associated with timers. Generation of PWM signals. Application examples using timers and digital I/O.
7. Embedded programming patterns (2 hours)
Programming models for reactive embedded systems. Finite-state machines: concepts of state, event, and transition. Blocking and non-blocking polling. Event handling through interrupts. Design examples of simple embedded applications based on finite-state machines. Concurrency issues in embedded systems, including the concept of critical sections, access to shared resources, and potential race conditions, together with basic techniques for their mitigation.
8. UART serial communication (2 hours)
Operating principle of the UART. Peripheral configuration and programming. Transmission and reception of characters. Use of UART in polling mode and with interrupts. Applications for debugging and serial communication with external devices.
9. Analogue-to-digital conversion (2 hours)
Operating principle of an ADC. Sampling and sample-and-hold circuit. Configuration and programming of an ADC converter. Acquisition of signals from sensors. Conversion of physical quantities into digital data, calibration, and interpretation of measurements. Application examples with analogue sensors.
10. Communication peripherals and protocols (3 hours)
Operating principles and use cases of the main serial communication interfaces: I2C and SPI. Connection and management of external peripherals through serial buses. Introduction to the main protocols and application scenarios for IoT.
11. Sensors, actuators, and user interfaces (1 hour)
Interfacing of sensors, actuators, and displays. Data acquisition, processing, and transmission. Basic elements of embedded-node design for monitoring and control.
12. Laboratory activities and project development (24 hours)
Programming exercises on STMicroelectronics STM32 platforms. Use of the STM32CubeIDE/STM32CubeMX environment for configuration, development, debugging, and validation. Implementation of prototype circuits with development boards, sensors, and actuators. Development of applications for the control of power converters and IoT nodes. The exercises will be carried out using a laboratory-based approach, group activities, and practical verification on real hardware.
Bibliography
“Microcontrollers: Hardware and firmware for 8-bit and 32-bit devices” by Franco Zappa, Società Editrice Esculapio, ISBN: 9788893850223
Teaching methods
The course is worth 6 CFU and consists of 48 total hours, organised according to a strongly laboratory-based and experiential teaching approach. Lectures are integrated with guided demonstrations, practical exercises, and applied problem-solving sessions, with the aim of progressively transforming theoretical concepts into practical skills on real hardware.
The course adopts a “learning by doing” approach, in which the student is guided from understanding the operation of microcontrollers and their peripherals to the implementation, debugging, and validation of complete embedded applications. The concepts related to MCU architecture, peripheral configuration, and firmware design are introduced in the classroom and then consolidated in the laboratory through exercises on STM32 development boards from STMicroelectronics and using the STM32CubeIDE and STM32CubeMX environments.
During practical activities, students address progressively more complex problems related to the management of digital I/O, timers, PWM, interrupts, UART, ADC, serial buses, sensors, and actuators. The exercises are designed not only as the application of guided procedures, but also as opportunities to analyse system behaviour, identify errors, modify firmware, interpret experimental results, and validate application operation.
The laboratory component may include individual and group activities, with exercises preferably carried out in small groups of 2–3 students, depending on the availability of workstations. In the final phase of the course, the acquired skills are integrated into the development of application projects oriented toward the control of power converters and/or the implementation of smart IoT nodes. The project represents a moment of synthesis among hardware configuration, firmware development, debugging, measurement, and validation on a real platform.
Attendance is strongly recommended, given the practical nature of the course and the need to use specific hardware and software tools. Participation in laboratory activities is therefore an important element for achieving the learning objectives and acquiring the skills required for the development of embedded systems.
Assessment methods and criteria
The assessment of learning is aimed at verifying both the understanding of the theoretical principles of microcontrollers and the ability to apply this knowledge to the development, configuration, debugging, and validation of embedded applications on a real platform.
The assessment will be structured into the following components:
1) Oral interview on the theoretical part: questions on the topics covered during lectures;
2) Group project: development of a simple embedded application on the STM32 platform, with assessment of the overall result;
3) Technical presentation of the project;
4) Practical laboratory test: individual test involving small modifications to the code, peripheral configuration, use of debugging tools, and validation of system behaviour.
The distinction cum laude may be awarded in the event of achievement of the highest assessment level, accompanied by mastery of technical terminology, autonomy in discussing design choices, and the ability to propose further analyses or improved solutions with respect to the topics covered during the course.
Other information
The course website and teaching materials will be available on the Elly platform. Students are advised to enrol in the course on the platform and, where possible, to obtain a kit with an STM32 Nucleo board and basic accessories in order to practise independently outside laboratory hours as well.
2030 agenda goals for sustainable development
The course has predominantly technical-disciplinary content and is not directly related to the pursuit of a specific Goal of the 2030 Agenda. However, the skills developed in the course may indirectly contribute to the design of more efficient, reliable, and intelligent electronic systems, with possible effects in areas such as monitoring through IoT nodes, control of electronic devices, automation of embedded systems, and efficient management of power converters.
In this sense, while no direct and predominant correlation with a single Goal is identified, the course provides technical skills that are potentially relevant to applications oriented toward energy efficiency, technological innovation, and the development of intelligent electronic infrastructures.