Communications protocols in embedded software development

Tobias Aguiar
6 min readJan 18, 2023

--

Photo by Onur Binay on Unsplash

Whether you know about embedded systems or not, they are a crucial part of modern technology, and communication is a vital aspect of their functionnality. That’s because in all embedded application there isn’t a device acting alone on a specific task, but rather a system with different devices that needs to communicate with each other in order to make the whole functionnal.

Humans are not the only ones who needs to communicate among themselves

Usually when building embedded systems you use specilized devices for different tasks, and you usually need to interface two different worlds : the analog and digital one.

As the processor itself, although it has a vital role on this mechanism, it can’t aquire data from the real world, so it needs to communicate with some device which does that. Once this becomes possible, the processor can manage different different interfaces and data so the communication can be well delivered, in a timely manner, where it’s due...

In this article, you will get an introduction on the various methods and protocols used for communication in embedded systems, including serial communication, parallel communication, and wireless communication. We’ll also highlight some of their advantages and incovinients, as well as explore some factors to take into consideration when selecting your communication protocol.

Types of communications protocols and methods

Serial communications

This is the most commonly used in small embedded application and they are the first ones we learn when we get on the embedded system field. Used when using short-distance communication between devices, protocols such as UART, I2C, and SPI are commonly used in different applications domains.

Some characteristics which make the use of such communication type on embedded systems so popular are :

  1. Simple and eficient : You usually don’t need lots of wires. In a context where cost and space are limited as the embedded systems one, this communication system makes a widely popular choice for projects.
  2. Versatile : It is versatile because you can connect a different variety of devices. From simple sensors, memory devices until other processors, which opens possibility to a rich varieties of devices, for complex embedded applications.
  3. Error handling : in general such communications have methods which allows the software to recognize errors from different natures. One good example is the use of the parity bit from the UART protocol.

The UART (Universal Asynchronous Receiver Transmitter) communication, is one example of serial communication, commonly used for serial debugging when testing application.

The SPI (Serial Peripheral Interface) is a commonly master-slave clock driven system usually used in embedded applications. With a slightly more important dara rate, it is used in applications as audio/communication ones. It is more commnly used when fewer devices are present, due to lack of space (more the devices, more wires recquired).

The I2C (Inter Integrated circuits) is another master-slave, clock-driven communication method widely used in embedded system development. Sharing the same bus, this protocol is a good fit when you are dealing with more devices, and you don’t need a higher data rate.

Parallel communications

This communication type is not as common as the serial communication in embedded systems, firstly because it’s faster, it recquires more resources than the serial communication ones.

The most common use is the AHB (Advanced High-performance Bus), widely used in applications such as the aerospace field and the industrial automation, applications where high perfomance and low latency is recquired, due to their critical-real-time nature.

It’s architecure allows multiple devices to communicate simultaneously, providing a high data transfer rate. Being a multilayer bus protocol, it also supports multiple master and slave devices.

Wireless communications

Another use case of communication in embedded systems is the wireless communications, widely used to connect systems or connect systems to a network to manage data transfer without using wires.

It provides you flexibility, which can be really interesting if you are in an application context which recquires mobility freedom, a case where the wired communication is very limited.

It also has some limitations. The advantage of providing more freedom and mobility, it comes with a tradeoff : lack of security. In comparison to wired communications, wireless ones can be less secure in data transfer.

Some common wireless communication are : Bluetooth Low Energy (BLE), Wi-Fi and Zigbee.

The BLE is a wireless communication making use of UHV (Ultra High Waves) radio waves for exchanging data in short distances on a PAN (Personal Area Network), having some application target such as smart home and IoT. It’s designed for devices that need to communicate frequently but with low data rates.

Zigbee is a high level, wireless mesh networking technology. It allows devices on a PAN to connect each other with small, low power and low cost technology, which fits very well for applications as smart home devices, because it supports a large number of devices.

The Wi-fi protocol, also known by the IEEE standard as 802.11, is the most daily used communication protocol. It’s the main bridge between you and the internet. Probably it’s because you are using Wi-fi that you are able to read this article. It allows for high-speed data transfer and can connect devices over a wide range, making it suitable for applications such as streaming video, online gaming, and file transfers.

How can you select your communication protocol?

Selecting the appropriate communication protocol for an embedded system is an important task, although not an easy one, that can have a significant impact on the performance and reliability of the system.

When selecting your communication protocol, you should consider some factors:

  1. Distance : the range of the communication protocol is one of the first things to be taken into consideration. For short-range distances, you have some wired options (I2C, SPI, UART) and wireless options (BLE). For long range you also can have some wired options (Ethernet) and wiereless options (Wi-fi). Usually, only distance itself is not enough to choose a communication protocol.
  2. Data rate : Different applications fields recquire different data rates. Some protocols, such as SPI, have higher data rates than others, making them more suitable for high-speed data transfer applications.
  3. Cost : In terms of hardware and software, every protocol has cost. Some of them use lots of wire, and others are implemented with lots of layers on the software level. So it should be taken into consideration.
  4. Resource constraints : In different applications you will have different resource constraints, such as memory, CPU load and power consumption. Some protocols, such as Ethernet, require more resources than others, such as UART.
  5. Security : For applications that require secure communication, protocols such as Bluetooth and Zigbee, which include built-in security features, should be considered.

Final thoughts

Despite a quite important criteria to analyse, it is a very wide domain. With different options to evaluate what fits best to your project, it turns out that choosing a communication protocol that fits your necessity is not always as simple as it seems to be.

Whatever the communication protocol you pick for your project, the goal of the video is to show you how revolutionary they were to some applications fields :

  • Industrial Automation: The use of communication protocols such as Ethernet/IP have greatly improved the efficiency and reliability of industrial automation systems, allowing for real-time monitoring and control of industrial processes.
  • Medical Devices: The use of communication protocols such as Zigbee and Bluetooth low energy (BLE) has led to the development of more advanced and efficient medical devices, such as wireless patient monitoring systems and remote patient monitoring devices.
  • Retail: The use of communication protocols such as RFID and NFC have led to the development of smart retail systems, allowing for real-time inventory management and product tracking.

The list goes on. As technology continues to evolve, it’s likely that we will see even more advances in those fields, leading to even greater changes and improvements in society.

I hope this article were useful for you somehow. Thank you for taking the time! Happy reading/coding!

Other articles

  1. Maximizing your potential as an embedded Software Developer: consider these factors before setting goals in 2023
  2. Topics you should learn in embedded software development

--

--

Tobias Aguiar

Software developer | Trying to make complex concepts look easy | Want help or discuss about embedded software development? Email me! tobi.aguiar01@gmail.com