Tutorial for Microcontroller Development
The aim of this web page is to provide to the student the basics
of microntroler programming. This example base contains both an
explanation document and functional codes for each peripheral of a
mircocontroller.
All these examples use the STM32Fxx
component, the CubeMX software
and either with MDK-ARM or Atollic True Studio framework.
Here the aim is to use a GPIO in order to Set or Reset the pin
configured in output mode in function of the state of another pin
configured in input mode. It is useful to turn off or on a led for
instance. Here we use also a timer in order to generate a sampling
period.
Keyword:
GPIO, Input/output mode, Timer, Interrupt
Here the
aim is to use an ADC in order to realize the acquisition of an analog
data and in function of the value of a state variable the sample is
written on the DAC output. This kind of application is often used in
audio filtering application for instance. Here the filtering part is
not addressed. A timer is used too in order to generate the sampling
period
Keyword:
ADC, DAC, Timer, Interrupt
Here
the
aim is to use an ADC in order to realize the acquisition of an analog
data at each sampling period. This kind of application is often used
in data acquisition of an analog sensor. A timer is used too in
order to generate the sampling
period
Keyword:
ADC, Timer, Interrupt
Here
the
aim is to use an ADC in scan mode in order to realize the acquisition
of two analog
data at each sampling period. This kind of application is often used
in when several analog sensor are used in a system and when you can use
one ADC instead of use several (pay attention to the sampling period).
A timer is used too in
order to generate the sampling
period
Keyword:
ADC in scan mode, Timer, Interrupt
Here
the
aim is to use an Timer in PWM mode in order to pilot a continous
current motor or a servo motor. This kind of application is often used
in robotic or industrial applications.
Keyword: PWM
Here
the
aim is to use the I²C communication protocol in order to read data from
3-axis accelerometer. This kind of communication is often used so it's
important to know how uses it. Here I use also a timer to generate a
sampling frequency to read the data regularly.
Keyword:
I²C, 3-axis Accelerometer, Timer
Here
the
aim is to use the UART communication protocol in order to read data
from GPS. This kind of communication is often used so it's
important to know how uses it. Here I use also the GPS PPS (Pulse Per
Second) signal to generate a
sampling frequency to read the data regularly.
Keyword:
UART, GPS, External Interrupt, Callback function
- UART
Communication between 2 boards
Here
the
aim is to use the UART communication with hardware flow control in
order to transmit data from one board to another one. This kind of
communication is often used so it's
important to know how uses it.
Keyword:
UART, 2 boards, Hardware flow control (RTS/CTS), Callback function
Here
the
aim is to use the SPI communication between the microcontroler and a
sensor. This kind of
communication is often used so it's
important to know how uses it.
Keyword:
SPI, Barometric sensor, Data formatting
Here
the
aim is to use the USB communication as a virtual port between the microcontroler and a PC. This kind of
communication is often used so it's
important to know how uses it.
Keyword: USB, Virtual Com
- USB in Mass Storage (USB Key)
Here
the
aim is to use the USB for mass storage. In this tutorial, we use a USB Key in order to store a file.
Keyword: USB, USB key, FATFS library
Here
the
aim is to use the mailbox of FreeRTOS in order to send data from a
producer task to a consumer task. In producer task, we use a
humidity/temperature sensor with I²C communication and in the consumer
task we switch on a board led and a vibration motir in function of the
sensor values.
Keyword:
Mailbox, FreeRTOS, I²C, Humidity/Temperature sensor, Vibration motor
Here
the
aim is to present how use the CMSIS libraries with the STM32CubeIDE
framework. These libraries are often use in order to optimize the
performances of applications.
Keyword:
CMSIS Library, STM32CubeIDE (v1.1.0)