'Microcontroller programming' course is developed for second year students. Duration of the course is 2 semesters. Classes are held once a week during 4 academic hours.

Academic load - 60 hours/semester.


STM32F429 microcontrollers are used for the practical part of the course. The final task of the first semester and the course work can be done using other STM32 microcontrollers or TI Stellaris and TI Tiva devices. 



Syllabus (1 semester)

Basic part

Section 1. Introduction. Microcontroller programming on C.

Theory. Microcontrollers. Functions and applications of microcontrollers. The main parameters of microcontrollers. Architectures of microcontrollers. Families of ARM controllers. Structure of microcontrollers. The Cortex-M0/M3/M4F cores. Peripherals. General purpose input output, clocking, timers, interrupts.

Programming on C for microcontrollers. C for ARM. Differences of the microcontroller programming in comparison with PC. Input and output. Addressing. Binary and hexadecimal notations. IAR programming environment. Debug capability.

Practice. Creating and configuring project in IAR embedded workbench. Writing the firmware that works with GPIO. Working with documentation (search for register addresses, working with schematic).

Section 2. Interrupts

Theory. Interrupts. Types of interrupts. Nested vector interrupt controller (NVIC) in Cortex-M cores. Interrupt vectors. Priorities. Interrupt flags in STM microcontrollers. Recommendations for interrupt handling.

Practice. Writing the firmware for asynchronous input and output. Working with NVIC documentation. General purpose IO interrupts configuration.

Section 3. Timers

Theory. Timers. Types of timers. Modes of their operation. Short time intervals measurements. Microcontroller clocking system and its configuration.

Practice. Writing the firmaware for periodic signal output using timer and prescaler for obtaining required frequency.

Section 4. Pulse-width modulation

Theory. Pulse-width modulation (PWM). Applications of PWM for control of electronic devices. Features of microcontroller PWM implementation. Signal smoothing. Advanced timer modes.

Practice. Development of the firmware for PWM generation with specified parameters.

Section 5. Digital-to-analog and analog-to-digital conversions

Theory. DAC and ADC. Sampling rate and resolution. The main types of ADCs (direct-conversion ADC, successive-approximation ADC, sigma-delta ADC) and their characteristics. ADC triggering modes. Differential measurements. Averaging algorithms: moving average, exponential moving average. The HAL Driver peripheral library.

Practice. Writing the firmware for external analog signal measurements using ADC.

Section 6. Data exchange

Theory. Serial and parallel interfaces. UART. Operation principle of the UART bus, data transfer protocol. UART block events on STM32 microcontrollers. SPI and I2C protocols and their operation.

Practice. Firmware development for data exchange using UART. Working with virtual COM-ports on PC.

Section 7. Flash memory

Theory. Flash memory cell operation principle (floating-gate transistor, reading and writing data). NOR and NAND constructions of flash memory. Multi-level cells. Features of working with the flash memory from user applications.

Practice. Writing the firmware for pulse counting using the flash memory to store counter value.

Extended part

Section e1. Device displays

Theory. Types of displays. Cathode ray tubes (operation principle, raster scan). Liquid crystal displays (operation principle, LCD cell, addressing, display construction). Color models and resolution. Applications of displays. LED displays. Projectors (3LCD, LCoS, DLP). Resistive and capacitive touchscreens. Promissing types of displays (OLED, IMOD, SED, PixelSense).

Practice. Writing the application for geometric primitives and text output on LCD display. Working with high level peripheral libraries and board support packages.

Section e2. Microcontroller clocking system

Theory. Classification and operation principle of clocking generators. Quartz and RC oscillators. Phase-locked loop, clock dividers and multipliers. Clocking frequencies for microcontroller buses аnd peripheral devices.

Practice. Microcontroller clocking system configuration, clocking signal output. Investigation of clocking signal waveform dependency on the clocking frequency.

Section e3. USB

Theory. A brief history of the introduction the USB. Physical layer (cables, connectors, bus states, line code). Packet layer (structure and types of packets). Transaction layer (addresses, endpoints). Logical layer (transfer types, frames and priority). Descriptors and device classes. A brief overview of USB specifications.

Practice. Data transfer from PC to MCU and back using CDC class.

Section e4. Real time operating systems

Theory. Hard and soft real-time operating systems and their features. Scheduling and synchronization. The FreeRTOS operating system. Some functions for task management in the Free RTOS.

Practice. FreeRTOS configuration. Writing multitask program for LED operation management.

Four lessons at the end of the first semester are allotted for individual tasks.

Examples of individual tasks:

  • PWM signal frequency measurements with LCD display results output.  
  • Generation of PWM-signal with tunable frequency and duty cycle.
  • Capacity measurements by analysis of RC circuit response. 
  • Inductance measurements using by analysis of RL circuit response. 
  • Harmonic signal generation using pulse-frequency modulation.
  • Estimation of the distance by measuring the delay between emission and registration of sound pulses.
  • RC circuit output voltage stabilizing using feedback signal. 

Syllabus (2 semester)

  • Featured lectures
  • Additional chapters of microcontroller programming
  • Work on course project

In the second semester students do the coursework (individual project).

In agreement with scientific advisors the coursework in programming can be combined with coursework in physics. For doing this the coursework should be dedicated to experiment automation or other tasks related to microcontroller programming.


First semester 

  • Labs – 40%
  • Individual task – 40%
  • Presentation of the individual task – 20%

Second semester 

  • Coursework 


  • Kernighan, Brian W.Ritchie, Dennis M. The C programming language.
  • Martin M. Insiders guide on STM32
  • Mayorov, S.A., Kirillov, V.V., Pribluda, A.A. Introduction to Micro-ECM.
  • Trevor Martin. STMicroelectronics Microcontrollers on Cortex-M3 core. STM32 Series.
  • Frunze, A.V. Microcontrollers Are Easy. (Volumes 1-3)
  • Hamacher, C., Vranesic, Z., Zaky S. Computer Organization
  • Paul Scherz. Practical electronics for inventors.