Learning objectives
Knowledge of 32-bit microcontroller
Prerequisites
Knowledge of digital electronics, programming in 'C' language
Course unit content
Architecture and programming of microcontrollers
Full programme
The advantages in using microcontrollers.
Microcontroller architecture: ALU, Program memory, data memory, peripherals
Internal bus; 8-16-32 bit micro;
The clock generator.
(2 hours)
The most common peripherals: IO lines, timers, AD converters
Some more complex devices: PWM manager, IIC protocol manager, USART
Other devices available on recent microcontrollers.
(2 hours)
POLLING AND INTERRUPTIONS
Polling and interruptions compared.
IO lines and interruptions
IRQ line assignment to an IO line
enabling and replying to IO requests (2 hours)
ENVIRONMENT FOR DEVELOPMENT FOR MICRO STM
Configuration of a project, with choice of micro and programming-debugging software
Use of the C compiler intended for the development environment (2 hours)
CARD STM Nucleo 32F401
Reading the scheme
The STM32f401 CPU, essential features. Assignment in the pinout tab to resources.
Main oscillator and oscillator for the clock
Reset (2 hours)
The projects and the STM environment
Editing and Compilation. Error detection.
Debugging and positioning of break-points.
How to change the C code to answer the interrupt call. Transfer of the code (2 hours)
BUTTONS, ANTI-BOUNCES AND INTERRUPTION
Switches for the user: on board and external Assignment of IRQs for the SW1, SW2 and SW3 buttons;
Interception of the interruptions by button.
Rebound problem
Example of code for the interception of IRQ coming from three different buttons. (2 hours)
TIMERS
Time measurement and event counting: 8-bit and 16-bit timer / counters available on the micro
Prescaler and its use.
Interrupt on overflow.
Example of measurement of distance between two events, for example).
(2 hours)
A/D CONVERTERS
Converting AD to successive approximations
General principles.
Conversion example
Conversion start
End of conversion and generation of signal interruption.(2 hours)
PWM MANAGEMENT
General concepts on the PWM
Analysis of a project able to regulate the PWM output to establish the rotation speed of a DC motor. (2 hours)
Management of elementary communication protocols (2 hours)
Laboratory activity aimed at creating a micro control system (24 hours)
Bibliography
Slide lessons, Data sheet
Teaching methods
Frontal lecture and laboratory exercises
Assessment methods and criteria
Written exam followed by discussion on a project developed
Other information
Creation of a micro check