Embedded systems are the unsung heroes of modern technology, quietly powering a vast array of devices and systems that we interact with every day. From smartwatches and digital cameras to industrial machinery and autonomous vehicles, these systems play a critical role in shaping our world. At the heart of every embedded system lies the intricate web of communication protocols, enabling seamless data exchange between components. Whether it’s transferring sensor data in IoT devices or controlling peripherals in automotive systems, understanding communication protocols is vital for embedded system engineers. In this article, we delve into the realm of embedded system communication protocols, exploring their types, applications, and future trends.
Understanding Embedded Systems
Embedded systems are electronic systems or devices that combine hardware and software to perform specific functions. These systems typically consist of a processor or controller, various peripherals such as sensors and actuators, and specialized software to manage and control them. The components within an embedded system must communicate effectively to achieve the desired functionality.
Understanding Communication Protocols
Communication protocols are a standardized set of rules governing data exchange between two or more systems. These rules dictate aspects such as data format, transmission speed, error checking, and synchronization. Protocols can be implemented in hardware, software, or a combination of both, depending on the specific requirements of the system.
In embedded systems, communication protocols are essential for enabling seamless interaction between components, facilitating tasks such as sensor data acquisition, actuator control, and system monitoring.
They define a set of rules – the syntax and semantics – that govern how data is transmitted and received. These rules encompass:
- Physical Layer: Defines the electrical characteristics of the signal, such as voltage levels, timing, and data encoding schemes. Think of it as the way words are pronounced – the sound waves themselves.
- Synchronization: Ensures both communicating devices are in sync during data exchange. Imagine taking turns speaking in a conversation to avoid talking over each other.
- Bus Arbitration: Manages how multiple devices share a single communication bus, preventing collisions and ensuring orderly data flow. Think of a traffic light system at an intersection, ensuring cars take turns.
- Device Addressing: Enables specific devices on the network to be identified and targeted for communication. Imagine addressing a specific person by name in a conversation.
Types of Communication Protocols
Embedded System is an electronic system or device which employs both hardware and software. A processor or controller takes input from the physical world peripherals like sensors, actuators etc., processes the same through appropriate software and provides the desired output. The various components have to communicate with each other to provide the anticipated output.
Many embedded system based solutions being offered these days require interconnecting many individual embedded systems. An automobile system as such has in it many embedded systems which individually deals with controlling breaks, doors, mirrors, rare and front object indicators, engine temperature, wheel speed, tyre pressure, DVD control etc. Establishing communication among various microcontroller based systems is essential to implement a distributed embedded application.
1. Inter-System Protocols
Inter-system protocols facilitate communication between different devices or systems. They are used to establish connections between devices like microcontrollers, sensors, and PCs. Common examples include:
- USB (Universal Serial Bus): A versatile protocol used for connecting peripherals to computers and other devices. USB supports high-speed data transfer and is widely used in consumer electronics.
- UART (Universal Asynchronous Receiver-Transmitter): UART is a popular asynchronous serial communication protocol used for short-range data exchange between devices. It is commonly found in embedded systems for tasks like debugging and firmware updates.
- USART (Universal Synchronous Asynchronous Receiver-Transmitter): Similar to UART, USART supports both synchronous and asynchronous communication modes. It offers enhanced features like hardware flow control and can achieve higher data transfer rates.
2. Intra-System Protocols
Intra-system protocols facilitate communication between components within a single circuit board or embedded system. These protocols are essential for coordinating the operation of various modules and peripherals. Some common examples include:
- I2C (Inter-Integrated Circuit): I2C is a two-wire serial communication protocol developed by Philips (now NXP). It is widely used for connecting components like sensors, EEPROMs, and LCD displays over short distances.
- SPI (Serial Peripheral Interface): SPI is a synchronous serial communication protocol commonly used for interfacing with peripheral devices such as sensors, memory chips, and display controllers. It offers high-speed data transfer and supports full-duplex communication.
- CAN (Controller Area Network): CAN is a robust serial communication protocol used primarily in automotive and industrial applications. It is designed for real-time, high-reliability communication between nodes in a network, making it suitable for tasks like vehicle diagnostics, engine control, and industrial automation.
SPI protocol
In 1980, Motorola, a pioneering electronics manufacturer, sought to devise a communication protocol tailored for its microcontroller-operated embedded systems, aiming for full-duplex synchronous serial communication between master and slave devices on the bus. This initiative culminated in the creation of the Serial Peripheral Interface (SPI) protocol, heralding a significant breakthrough in embedded systems programming. Over time, SPI has evolved into a ubiquitous de facto standard for facilitating short-distance communication in embedded systems. Typically characterized as a four-wire serial bus, an SPI configuration comprises an SPI master device and an SPI slave device interconnected by four wires. Two of these wires serve as signal lines for bidirectional data transmission between the master and slave, while another wire functions as the clock line, synchronizing data transfer. The fourth wire designates the target slave device for communication. In an SPI setup, master devices dictate the clock frequency and configure clock polarity and phase, ensuring precise synchronization between communicating devices. With its support for fast data transmission speeds, full-duplex communication, and versatile applications across various embedded systems, the SPI protocol embodies a simple, intuitive, and efficient design, making it a preferred choice for developers in embedded systems development.
Comparison of I2C with SPI
For engineers navigating the realm of embedded systems, selecting the most suitable communication protocol is pivotal, and among the array of options available, two standout choices are the SPI and I2C protocols, conceived respectively by Motorola and Philips semiconductor divisions. While I2C supports multi-master communication and is cost-effective to implement, offering robustness against noise interference, SPI distinguishes itself with its unparalleled speed and versatility, making it a preferred option for short-distance communication. SPI’s ascendancy in embedded systems is attributed to its high-speed capabilities, efficient power consumption, and compact design, rendering it indispensable for a myriad of applications including digital signal processing and telecommunications. Unlike I2C, which was initially tailored for slower data transfer speeds, SPI facilitates rapid data transmission, boasting speeds surpassing 10+ MHz. This stark contrast in speed stems from the inherent complexity of the I2C bus protocol, which imposes limitations on data rates and supports multiple masters on the bus, whereas SPI’s streamlined architecture minimizes bus overhead and affords unrestricted communication speeds, aligning with the demand for swift and responsive user experiences in embedded system design.
SPI Supports Full Duplex Communication
SPI devices offer a distinct advantage over I2C counterparts with their inherent support for full duplex communication, a feature that significantly enhances data transfer efficiency. In contrast, I2C devices operate in half-duplex mode by default, restricting data flow to unidirectional transmission at any given moment. This discrepancy in communication capability arises from the fundamental design variances between the two protocols. In an I2C bus system, a solitary bi-directional line serves as the conduit for data exchange between the master and slave devices. Consequently, while the master device dispatches data to the slave, the latter is confined to receiving information, establishing a unidirectional flow of data. Conversely, SPI systems boast dedicated MISO (Master In Slave Out) and MOSI (Master Out Slave In) lines, enabling simultaneous bidirectional communication between the master and slave devices. This parallel data transmission capability empowers SPI devices to exchange data in both directions concurrently, enhancing throughput and responsiveness in embedded system applications.
Controller Area Network (CAN)
The Controller Area Network (CAN) stands as a pivotal message-based protocol facilitating seamless internal communication among systems sans the need for a central computer. Renowned for its versatility, CAN technology finds application across diverse sectors including agriculture, robotics, industrial automation, and medical systems, though it’s most notably associated with automotive engineering. In contemporary connected vehicles, the CAN bus serves as the linchpin, enabling communication among microcontrollers (MCUs) within Unmanned Ground Vehicles (UGVs) along a comprehensive vehicle bus, all without relying on a central computing unit.
For instance, the cruise control system swiftly interacts with the anti-lock braking system, ensuring prompt disengagement during emergency braking maneuvers. As vehicle complexity burgeons, with an increasing array of interconnected MCUs necessitating seamless information exchange, the reliability of the vehicle bus assumes paramount importance. CAN technology, with its robustness and efficiency, emerges as a key enabler, particularly in streamlining the physical layer of vehicular architecture. Historically, the proliferation of automotive features was stymied by spatial constraints imposed by intricate wiring systems. However, CAN ushers in a paradigm shift, fostering leaner, more interconnected vehicle networks that not only underpin modern connected vehicles but also pave the way for the drive-by-wire functionality integral to the autonomous vehicles of tomorrow.
What Sensors Are Attached to the CAN Bus?
In the realm of autonomous driving, a gamut of cutting-edge sensors is harnessed to furnish vehicles with the perceptual capabilities requisite for navigating complex environments. These sensors, pivotal for creating a holistic understanding of the vehicle’s surroundings, encompass a diverse array of technologies. Foremost among them is Light Detection and Ranging (LiDAR) technology, which generates intricate 3D maps of the road ahead, facilitating precise localization and obstacle detection. Additionally, color cameras play a pivotal role in discerning changes in road position and identifying obstacles in the vehicle’s path. Augmenting this visual perception is the integration of infrared cameras, which add an extra layer of complexity to obstacle detection by enabling the identification of heat signatures. Furthermore, Global Positioning System (GPS) technology assumes significance, enabling accurate navigation and the creation of a comprehensive contextual map that the vehicle can reference for informed decision-making. These sensors collectively empower autonomous vehicles with the perceptual acuity necessary for safe and reliable operation in a variety of driving conditions.
Drones and Autonomous Vehicles
With autonomous vehicles, and especially autonomous tactical vehicles, the in-vehicle networks supporting the advanced vision and sensing technologies require a higher bandwidth connection like those provided by Ethernet or FlexRay. But these connections can combine with CAN or CAN FD (CAN with flexible data rate) to create a robust network that is flexible when performing tasks that require high-data throughput, and that is quick and reliable when performing more simplified communication tasks.
The use of the CAN bus isn’t just limited to UGVs. Unmanned aircraft systems (UASs) have also adopted CAN technology for its low-latency, reliable communication capabilities. In fact, there’s even a UAVCAN protocol designed for aerospace and robotic applications. The CAN bus allows for communication between embedded systems within a UAV, as well as the transfer of information between a UAV and the remote operator.
For instance, the CAN bus can allow the flight controller to manage the throttle on the electronic speed controller (ESC), but it also allows the ESC to return hard real-time data to the flight controller, including temperature, amperage, voltage, warning signals, etc. via live telemetry. The real-time data, transferred within microseconds, allows remote pilots to react immediately, making for much safer and more reliable UAV flight operations.
MilCAN
CAN bus has been the communication standard for embedded systems in vehicles for decades, and even huge leaps in vehicle technology like electric and autonomous vehicles have continued to utilize the CAN bus due to its flexibility and reliability. These same features make CAN an ideal component for autonomous military and defense vehicles, including UGVs and unmanned aerial vehicles (UAVs), or drones.
In addition to its functionality, CAN’s inherent ruggedness is a clear draw, performing just as consistently in extreme heat and cold as it does in arid and dusty climates and extremely wet conditions.
Commercial autonomous vehicles must have highly attuned sensors when navigating city streets – able to sense changing road conditions, other vehicles and pedestrians. Tactical military vehicles, on the other hand, must be prepared for off-road conditions in every kind of hostile environment. The obstacles are greater and the consequences are higher stakes. That means that a higher priority must be placed on sensors and algorithms that can calculate and make split-second decisions; and the need for near-instantaneous, error-free communication is critical. CAN enables all of these complex systems to communicate with the clarity and speed that are necessary when lives are on the line.
Many military vehicles make use of the CAN bus to log and transfer periodic operational data that are reviewed by maintenance personnel (or, more likely, computer algorithms) for predictive maintenance – in other words, analyzing operational data to look for potential vehicle maintenance issues so that they can be addressed before they become critical.
To account for the many issues specific to military vehicles, a working group of the International High Speed Data Bus-Users Group (IHSDB-UG) developed the MilCAN higher layer protocol in 1999, with the goal of creating a standard interface for utilizing CAN bus in military vehicle development. There are two versions of MilCAN: Mil-CAN A and MilCAN B.
Widely used in armored vehicles, MilCAN A uses 29-bit identifiers and uses a similar frame format to SAE-J1939. Mission-critical in mind, Mil-CAN A prioritizes message transmission, and defines 1-Mbit, 500-Kbps, and 250-Kbit communication rates.
MilCAN B is actually an extension of the CANopen application layer, using 11-bit identifiers and only periodically allowing data to be transmitted via the bus. MilCAN B supports data rates from 10 kbps to 1 Mbps.
Both protocols were developed to specialize the use of CAN around deterministic data transfer, so the specifications can also be used for non-military applications.
Automotive Ethernet
Despite its longstanding presence spanning over two decades, Ethernet had been largely excluded from automotive applications due to several limitations. Initially, Ethernet failed to meet Original Equipment Manufacturer (OEM) Electromagnetic Interference (EMI) and Radio-Frequency Interference (RFI) requirements critical for the automotive market. Moreover, Ethernet’s high-speed variants, operating at 100Mbps and above, were plagued by excessive RF noise and susceptibility to interference from other devices within the vehicle. Additionally, Ethernet struggled to ensure latency down to the low microsecond range, a prerequisite for swiftly reacting to sensor and control inputs. Furthermore, it lacked mechanisms for synchronizing time between devices and enabling simultaneous data sampling across multiple devices.
Today, Ethernet has found a niche in automotive applications primarily for diagnostics and firmware updates, employing the 100Base-Tx standard. Although this standard falls short of meeting automotive EMI requirements, its usage is typically confined to diagnostic scenarios when the vehicle is stationary. Cars equipped with Ethernet for diagnostics typically feature an RJ45 connector facilitating connection to an external computer running diagnostic software. Firmware updates for select automotive systems are also facilitated through this interface owing to its significantly higher speed.
Within the automotive domain, multiple proprietary communication standards coexist, encompassing analog signals on wires, CAN, FlexRay, MOST, and LVDS. Each vehicle component imposes unique wiring and communication requirements, contributing to the complexity and cost of automotive wiring harnesses. These harnesses, being the third highest cost component in a car, constitute a substantial portion of labor costs and contribute significantly to vehicle weight. However, advancements such as employing unshielded twisted pair (UTP) cables for data transmission at speeds of 100Mbps, coupled with compact connectors, have the potential to substantially reduce connectivity costs and cabling weight.
Automotive Ethernet has emerged as a dedicated physical network tailored to meet the stringent requirements of the automotive industry, encompassing EMI/RFI emissions and susceptibility, bandwidth, latency, synchronization, and network management. This shift heralds a transition from heterogeneous networks reliant on proprietary protocols to hierarchical, homogeneous automotive Ethernet networks. In this new paradigm, switched 1GE automotive Ethernet acts as the linchpin, interconnecting various domains within the vehicle and facilitating seamless communication between disparate systems. This transformation not only promises cost and weight reductions but also fosters enhanced cooperation among vehicle systems and external entities.
To align with automotive requirements, extensive efforts are underway, encompassing the development and revision of specifications within the IEEE 802.3 and 802.1 groups, ensuring that automotive Ethernet evolves to meet the evolving needs of the automotive industry.
New protocols
In addition to the well-established protocols , here are some of the latest and important communication protocols gaining traction in the realm of embedded systems:
1. Bluetooth Low Energy (BLE): Building upon the foundation of classic Bluetooth, BLE offers significant advantages for embedded systems. It boasts lower power consumption, improved security features, and faster connection times. This makes it ideal for battery-powered wearables, wireless sensors, and other IoT devices that require efficient data exchange.
- Technical Features:
- Uses radio frequencies similar to classic Bluetooth but with lower transmit power.
- Employs connectionless and connection-oriented data transfer modes.
- Offers improved security features like encryption and authentication compared to classic Bluetooth.
- Advantages for Embedded Systems:
- Ultra-low power consumption, ideal for battery-powered devices.
- Faster connection setup times compared to classic Bluetooth.
- Suitable for small data transfers between devices.
- Well-established ecosystem with readily available development tools.
2. UWB (Ultra-Wideband): UWB offers exceptional capabilities for short-range, high-bandwidth communication. Its unique ability to transmit data over a wide range of frequencies minimizes interference and enables high data rates. This protocol is particularly attractive for applications like short-distance video transmission, secure device pairing, and high-speed data transfer within a single system.
- Technical Features:
- Transmits data over a wide range of frequencies (3.1 – 10 GHz) to minimize interference.
- Offers high data rates (up to several Gbps) suitable for multimedia applications.
- Employs time-based localization techniques for accurate positioning.
- Advantages for Embedded Systems:
- Enables high-bandwidth communication for short-range applications like video transmission.
- Secure due to the wide frequency spectrum used for data transmission.
- Can be used for precise indoor positioning of devices.
3. NFC (Near Field Communication): Widely used in contactless payments, NFC is making its way into embedded systems for secure data exchange over short distances. Its low power consumption and tap-to-connect functionality make it suitable for applications like device configuration, data sharing between devices, and secure authentication.
- Technical Features:
- Operates at close proximity (typically a few centimeters) for secure data exchange.
- Uses inductive coupling to transfer data between devices.
- Offers passive and active modes for different use cases.
- Advantages for Embedded Systems:
- Low power consumption, making it suitable for battery-powered devices.
- Simple and secure tap-to-connect functionality for data exchange.
- Commonly used for device configuration and secure authentication.
4. DDS (Data Distribution Service): This protocol is a middleware technology that facilitates reliable data exchange between publishers and subscribers in a distributed network. DDS is particularly advantageous for real-time systems where data needs to be delivered with minimal latency and high reliability. Applications include industrial automation, robotics, and autonomous vehicles where timely data exchange is critical.
- Technical Features:
- Middleware technology facilitating reliable data exchange in distributed systems.
- Uses a publish-subscribe model where publishers share data and subscribers receive relevant information.
- Offers Quality-of-Service (QoS) options for guaranteed data delivery and real-time performance.
- Advantages for Embedded Systems:
- Enables reliable and scalable data exchange in complex systems like industrial automation.
- Supports real-time data delivery with minimal latency, crucial for time-sensitive applications.
- Provides data filtering and routing functionalities for efficient data management.
5. MQTT (Message Queuing Telemetry Transport): An application layer protocol designed for constrained environments, MQTT is ideal for resource-limited embedded devices. It uses a publish-subscribe model for asynchronous data exchange, making it efficient for scenarios where devices might have intermittent connectivity or need to communicate with a central hub. This protocol is prevalent in IoT applications where data from numerous sensors needs to be collected and delivered to a central server.
- Technical Features:
- Publish-subscribe protocol designed for constrained environments with limited resources.
- Offers asynchronous data exchange, allowing devices to communicate even with intermittent connectivity.
- Uses a lightweight messaging format for efficient data transfer.
- Advantages for Embedded Systems:
- Ideal for resource-limited devices due to its low footprint and efficient message format.
- Well-suited for scenarios with unreliable network connections.
- Popular choice for collecting data from numerous sensors in IoT applications.
6. 802.11ax (Wi-Fi 6): The latest iteration of the Wi-Fi standard, 802.11ax, offers significant improvements in speed, capacity, and efficiency compared to previous versions. While not exclusively for embedded systems, Wi-Fi 6’s ability to handle more devices simultaneously and improved power management make it an attractive option for applications where embedded devices need to connect to a wireless network with increased efficiency and lower latency.
- Technical Features:
- Latest Wi-Fi standard offering significant improvements over previous versions.
- Employs techniques like Orthogonal Frequency-Division Multiple Access (OFDMA) for efficient data transmission to multiple devices simultaneously.
- Improves power efficiency and reduces latency compared to earlier Wi-Fi standards.
- Advantages for Embedded Systems:
- Increased network capacity allows for more devices to connect simultaneously.
- Improved power management benefits battery-powered embedded devices.
- Lower latency makes Wi-Fi 6 suitable for real-time applications where responsiveness is critical.
These are just a few examples, and the landscape of communication protocols is constantly evolving. As embedded systems become more sophisticated and the need for efficient, reliable data exchange grows, we can expect further advancements and adoption of these newer protocols alongside the established ones.
Choosing the Right Protocol
Selecting the optimal communication protocol depends on several factors:
- Data Rate Requirements: How much data needs to be transferred? High-speed protocols like USB are ideal for large data volumes.
- Number of Devices: How many devices need to communicate? I2C is suitable for connecting multiple low-power devices.
- Power Consumption: For battery-powered systems, low-power protocols like I2C are preferred.
- Physical Constraints: Consider the physical layout of the system and cable limitations.
Applications and Use Cases
Embedded system communication protocols find applications across various industries and domains:
- IoT (Internet of Things): In IoT devices, communication protocols like MQTT (Message Queuing Telemetry Transport) and CoAP (Constrained Application Protocol) are used for transmitting sensor data to cloud servers and other devices.
- Automotive Systems: CAN bus is extensively used in automotive systems for tasks like vehicle diagnostics, engine control, and communication between electronic control units (ECUs).
- Industrial Automation: Protocols like Modbus, PROFIBUS, and Ethernet/IP are commonly used in industrial automation systems for monitoring and controlling machinery, PLCs (Programmable Logic Controllers), and other equipment.
- Consumer Electronics: USB, UART, and SPI are widely used in consumer electronics devices such as smartphones, tablets, and gaming consoles for connecting peripherals and accessories.
Future trends in embedded systems will likely focus on emerging technologies such as embedded security, real-time data visualization, network connectivity, and deep learning capabilities. These advancements will further enhance the capabilities and functionalities of embedded systems, paving the way for new applications and innovations.
Conclusion
Communication protocols play a crucial role in enabling efficient data exchange in embedded systems. By understanding the different types of protocols and their applications, embedded system engineers can design robust and reliable systems for a wide range of applications. Whether it’s ensuring seamless connectivity in IoT devices or enabling real-time communication in automotive systems, choosing the right communication protocol is essential for the success of any embedded system project.
Embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, and largely complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure. Future trends in embedded systems will include revolutionary technologies such as embedded security, real-time data visualization, network connectivity, and the IoT, and deep learning capabilities.
Communication Protocols are a set of rules that allow two or more communication systems to communicate data via any physical medium. The rules, regulations, synchronization between communication systems, syntax to be followed and semantics are all defined by the term protocol. Protocols can be implemented by both hardware and software or combination of both.
Networking of embedded systems can be achieved in many ways using protocols such SPI, FireWire, USB, CAN, I2C, PCI, and ESA etc. The communication protocols associated with physical layer describe the signals incorporated, signal strength, hand shaking mechanism, bus arbitration, device addressing, wired or wireless, data lines etc.
Communication protocols are broadly classified into two types, Inter System Protocol and Intra System Protocol. Inter system protocols establish communication between two communicating devices i.e. between PC and microprocessor kit, developmental boards, etc. In this case, the communication is achieved through inter bus system.
Inter system protocol can be categorized into, USB Communication protocols UART Communication protocols and USART Communication protocols. Asynchronous serial is used UART chip for the communication. There is no specific limit defined for asynchronous communication but most of the serial devices support up to the maximum baud rate of 230400.
The Intra system protocol establishes communication between components within the circuit board. In embedded systems, intra system protocol increases the number of components connected to the controller. Intra system protocol can be categorized into, I2C Protocol, SPI Protocol and CAN protocol.
I2C and SPI are both bus protocol to allow the user for short-distance, serial data transfer. I2C is two wire communication which made by the Philips (Nowadays NXP) and SPI is made by the Motorola.
References and resources also include:
https://electricalfundablog.com/communication-protocols-embedded-systems/
https://www.aerodefensetech.com/component/content/article/adt/features/articles/34343