Welcome on PLAY Embedded

On PLAY Embedded you can find useful resources to get started with embedded systems: media, examples and accurate descriptions are also provided. Come on, learn by doing!

Wide box Tiny box List
Ascent Descent

PWM in hardware with STM32 Timer and ChibiOS

The Pulse Width Modulation (also known as PWM) is a digital modulation technique which uses duty-cycle of square waves to encode information. In communication field PWM surrendered to more advanced communication technique which uses more complex waveforms showing better noise rejection ratio and less transmission errors at highest data rate. Nevertheless, PWM is still used in infrared communication where data rate is very low but transmitter and receiver are cheap.

Anyway low rate communication is not the most relevant use case of PWM which is widely used in many fields continue reading...

Using STM32 ADC with ChibiOS ADC Driver

A microcontroller is a system which works on bits and bit streams more than analog signals, anyway those signals are still widely used in many fields especially in audio and power applications. An Analog to Digital Converter (or ADC) is a system that converts such kind of signals in a sequence of discrete values directly interpretable by the microcontroller. Such kind of converter is widely used in embedded systems to deal with those peripherals which works with analog signals like potentiometers, analog microphones or sensors.

Some examples?

Analog sensors which continue reading...

ChibiOS/HAL design: an object-oriented approach

The C programming language is clearly an imperative programming language not designed to be object-oriented. Anyway, the object-oriented approach remains something much more related to the design and mindset more than to syntax. The ChibiOS/HAL is an Hardware Abstraction Layer which design could be considered very object-oriented. We encountered it in almost every article related to ChibiOS but we often ignored its design as it comes with a series of demos which allow to use it easily without a deep knowledge of its internal mechanisms.

This article is dedicated to people continue reading...

Using STM32 USART with ChibiOS Serial Driver

The serial communication in asynchronous mode is one of the simplest and most used methods to exchange data between a microcontroller and other devices. Such kind of communication can be achieved through a Universal Synchronous/Asynchronous Receiver Transmitter (or USART) as well as UART peripheral which actually is a subset of USART. Each STM32 microcontroller is equipped with multiple instances of these peripherals (from 2 up to 8) depending on the microcontroller model.

In this article, we are going to take an overview of serial communication protocols and peripherals continue reading...

Using STM32 GPIO with ChibiOS PAL Driver

The STM32 is equipped with an extremely flexible General Purpose Input Output (or GPIO) peripheral allowing to configure each Input/Output independently. The IO is the simplest interface between the STM32 and the outside world.

As we said in the article “From 0 to STM32“, there are many versions of the same peripherals across the various STM32’s sub-families and this is way each sub-family usually has its own Reference Manual. In this document it is possible to find all the functional information about GPIO and reading many RM we can notice that GPIO peripheral has three continue reading...