Embedded systems are found in various areas of daily life, such as GPS systems and fitness trackers. For these systems to function as intended, embedded engineers need to ensure that communication protocols have been set up within the system and that those protocols are followed.
Today, there is a list of communication protocols in embedded systems that embedded engineers should consider and be aware of, each having its own qualities and application usage. Knowing the functions of each protocol bids for more informed decisions when building embedded systems.
Here we discuss what communication protocols are, why they’re important, as well as the four types of communication protocols embedded engineers should understand. So, let’s jump in!
What is a Communication Protocol?
Communication Protocols are a system of rules and digital message formats enabling the transmission of information between devices.
To explain the process, in short, two-way communication exchange is controlled by a set of rules that enable data to be transferred between devices to send and receive messages.
Why are communication protocols important?
Communication protocols play a significant role in allowing different devices to communicate and transmit information to each other.
In Embedded Systems, Communication Protocols are vital in the function of devices. Like wireless devices, embedded devices need to talk to each other in order to share useful data.
This communication typically follows a Master-Slave protocol exchange, where Masters (Microprocessors) command data transmission to and from Slaves (Sensors).
Types of Communication Protocols
Here, we discuss four types of communication protocols, UART, SPI, I2C and USB, as well as their pros and cons.
1. UART Protocols
UART stands for Universal Asynchronous Receiver Transmitter (UART) and is perhaps the most simplified, oldest and most commonly used form of device-to-device communication.
As the name implies, UART uses asynchronous serial communication, which means that no clock signal is used to synchronise data between the transmitter and receiving devices. So, unlike the majority of protocols, UART data transmission follows TX-RX/Transmitter/receiver pin communication connected through two wires.
UART adds stop and start bits to detect incoming data. Here, device communication speed must follow around the same baud rate configuration in beats per second (bps) to send and receive data transmission packets.
UART can be configured in three distinct ways:
- Simplex: One-way data Communication.
- Half-Duplex: Data transmission in both directions but not at the same time.
- Full-Duplex: Simultaneous data transmission in both directions at the same time.
- Only uses two wires to connect
- Popular and commonly used protocol
- Asynchronous meaning no clock signal is needed
- Simple structure means data packets can be easily changed
- Multiple ways for configuration
- With one master and slave, UART doesn’t support multiple systems
- Baud rate configuration needs to be similar
2. SPI Protocols
SPI refers to Serial Peripheral Interface and is a famous communication protocol within the embedded world. The SPI protocol is used across a range of chipsets, including SD card and RFID card reader modules. Its essential function as an interface Bus is to send/receive data across Microcontrollers (Master) and Peripherals such as sensors and SD cards (Slaves) to assist device communication.
SPI follows a Serial Communication Protocol with a Full-Duplex configuration, meaning data bits can be transmitted continuously in both directions at the same time through Master-Slave-IN/ Master-Slave-Out (MOSI/MISO) exchange.
This holds an advantage over stop/start bit communication, as devices can function without interruption. The overall operation of SPI involves four signals.
- The Serial Clock (SCLK) assists a synchronous interface, allowing faster data transfer.
- The Master node commands Master In Slave Out (MISO) or Maser Out Slave In (MOSI) communication.
- The Slave Select lines (SS) indicate activity; when a line goes low, communication is present between the Master and a Slave Node.
- This enables higher speeds-16Mhz-32Mhz- of data transmission than other Protocols.
Though SPI holds a higher transfer rate than other multi-slave systems, the one Master to multiple-slave nature of SPI means it is not scalable as multiple wire interfaces are needed to establish Master/Slave transmission amongst the Bus. This should be held as a consideration when contemplating the complexity of a system.
- Flexibility for bits transferred
- Can support multi-master-slave systems
- High speed – faster than asynchronous methods
- Continuous transmission of data bits means less interruption
- Not as scalable as other multi-slave systems
- More wires are required for communication
- One master controls all slave communication
3. I2C Protocols
I2C means Intern-Integrated Circuit and was first created by Phillips to power electrical lighting. I2C communication is popular due to its Multi-Master-Multi-Slave structure, otherwise known as an I2C Bus. Such structure is valuable when registering multiple Microcontrollers data to power a device system.
I2C has varying applications, particularly in IC circuits like LCD Modules, Temperatures Sensors, and Data Acquisition, etc., making it a common Protocol used by embedded engineers.
The I2C communication protocol follows a Half-Duplex configuration, which means data can be transferred bit by bit via two-way communication at a single time. This should be taken into consideration when contemplating integration, as data communication happens at a lower rate.
Like SPI and UART, I2C follows a Serial Communication Protocol enabling two-wire interface communication between masters and slaves. Having a less complex pin structure, I2C is attractive to integrate.
In an I2C Bus, Multiple Master and Salve device communication works via Synchronous Communication, where a clock signal controlled by the master is distributed amongst the salve nodes across two-wire interfaces, the Serial Clock Line (SCL) and Serial Data Line (SDA). When integrating I2C use cases need to be evaluated as it is more complex than most other Protocols.
- Cheaper cost to integrate than other communication protocols,
- Flexible- the multi-master-slave design makes I2C much more functional
- Adaptable to integrated circuit types,
- Lower transmission speeds,
- It is considered complex, especially as the number of devices used increases.
4. USB Protocols
USB refers to Universal Serial Bus and follows an Inter-System Protocol, which communicates between two devices. Prominent in the Computer electronic device world, USB has become popular over UART Protocols.
USB follows an Asynchronous Serial Protocol where no clock signal is needed, making it a low-cost device. When the host device is sent communication, data transmission is relayed to a receiving endpoint device via data packets. USB can entail a range of speeds depending on the use case, from 1.5MBS to 10GBS.
- Low cost, low power and smaller in size
- Can support high-capacity of data
- Plug and play means easy implementation
- Limited capability
- Limited messages can be communicated between the host and peripheral
Communication Protocols: Summary
Communication protocols play an important function in embedded systems, allowing different devices to communicate and transfer information with one another. Embedded engineers have various types of communication protocols to choose from.
The four communication protocols most commonly used and essential for any embedded engineer to know include UART, SPI, I2C and USB. To discover more on the latest trends in embedded protocols, check out 5V Tech.