Article are the best way to explore the topics covered on PLAY Embedded. You will find detailed texts, videos, explanatory images, schematics, code examples, ready to use projects and much more. Pick one and read, and if you like it don’t forget to Share the knowledge!

Wide box Tiny box List
Ascent Descent

Using STM32 I2C with ChibiOS

How to drive a HD44780 with I2C backpack with a STM32

The Inter-Integrated Circuit (often shored as I2C or I2C bus pronounced I-squared-C or alternatively I-two-C) is a widely used synchronous serial communication peripheral which communicates in half duplex mode using a multi-master-multi-slave architecture.

Like the SPI, the I2C is a Synchronous Serial bus, and the clock signal is generated by one of the endpoint and provided to the others through a specific Serial Clock Line often shorted as SCL by a party which is named Master.

In half-duplex buses, the communication happens on the same line no matter the direction. The continue reading...

Using STM32 SPI with ChibiOS

The Serial Peripheral Interface (often shored as SPI bus) is a widely used synchronous serial communication peripheral which communicates in full duplex mode using a master-slave architecture with a single master.

As the SPI is a Synchronous Serial bus, a clock signal is generated by one of the endpoints and provided to the others through a specific Serial Clock Line often shorted as SCL or CLK. The communication party which generates the clock is named Master while other Slaves.

In full-duplex buses, the communication is simultaneously bi-directional, i.e. data can flow continue reading...

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 bitstreams 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 work with analog signals like potentiometers, analog microphones or sensors.

Some examples?

Analog sensors which produce 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...