Communication Network protocols
In an embedded world, communication protocols are vital as they provide a gateway to exchange information among various devices with excellent reliability.
Communication Network protocols
In an embedded world, communication protocols are vital as they provide a gateway to exchange information among various devices with excellent reliability.
Any secure and efficient communication must agree between sender and receiver on a specific set of rules called a protocol. So, a protocol is a collection of rules that governs data communications.
A protocol allows various network-connected devices to communicate together irrespective of their design, structure, and internal processes. Both hardware and software operate during protocol implementation. Sensors share automation system data to the controllers, and the actuators receive the controlled signal. A communication protocol enables such an exchange of data or information. This article discusses some critical protocols in use in the embedded world.

Figure 1: Communication protocol
The communication protocols have different categories.

Figure 2: Types of communication protocols
The intersystem protocol helps to establish communication between two devices. A good example is a computer and a development board via inter bus system.
Intersystem protocols are of three categories:
Universal Serial Bus or USB provides asynchronous serial transmission of data between a host and up to a total of 127 devices. The host consists of two components: the root hub and the host controller. The host controller is a hardware chipset with a software driver layer responsible for the following tasks:
Data is sent serially in packets form consisting of 8 bits. The USB interface uses a non-return-to-zero inverted (NRZI) differential transmission, and a bit stuffing across the twisted pair encodes the NRZI. USB communication occurs through many different signaling states on the D+ and D- lines. The hardware in USB devices manages all the encoding and bit stuffing upon receiving any data and before transmitting any data. The reason for using the differential D+ and D- signal is to reject common-mode noise. The following are the different types of USB connectors available in the market:
(i) USB-A: It is the most popular connector. They are present in flash drives and at the end of hard-wired cables to USB devices like keyboards and mouse.
(ii) USB-B: These are square-shaped and widely used in printers, scanners, portable optical drives, and other external storage devices.
(iii) USB-C: They are small and thin, with an oval appearance and asymmetrical shape. USB C has 24 pin cable that can relay videos and data as quickly as 10 Gbps and power up to 100 watts. USB type C finds wide use in smartwatches, modern cellphones, new generation embedded development boards, etc.
(iv) Micro-USB: The first generation smartphones had Micro-USB. These had an On-the-Go (OTG) function that allowed them to have an adapter connecting other USB connector types. Tablets, game controllers, smartphones, and similar devices have Micro-USB inside them.

Figure 3: Types of USB connectors
The current USB specification defines four speeds for a USB system: Low-Speed, Full-Speed, Hi-Speed, and SuperSpeed. A High-Speed Host can communicate with a Low-Speed device, but a Full-Speed Host cannot communicate with a High-Speed device.
| Speed | Bus Rate | Applications |
|---|---|---|
| Low-Speed | 1.5 Mb/s | keyboards, mice, and game peripherals |
| Full-Speed | 12 Mb/s | phones, audio devices, and compressed video |
| Hi-speed | 480 Mb/s | video, imaging, and storage devices |
| SuperSpeed | 10Gb/s | application media requiring fast and high-capacity transfers |
Table: USB transfer speed
A Universal Asynchronous Receiver/Transmitter (UART) receives serial data and stores it as parallel data, usually one byte. It also takes serial data and transmits it as parallel data. Such serial communication is beneficial when it is necessary to communicate bytes of data between devices separated by long distances or have few I/O pins.

Figure 4: Serial transmission using UART
UART is two-wired, i.e., the Tx (Transmitter) and Rx (Receiver) pins manage the serial data. Two serially connected UARTs must agree on the transmission protocol used to communicate. The UART transmission protocol determines the rate at which bits are sent and received. This rate is called the baud rate. The standard baud rates are 2400, 4800, 9600, and 19.2 k. The protocol also specifies the number of bits of data and the type of parity sent during each transmission. Finally, the protocol defines the minimum number of bits that separates two consecutive data transmissions.

Figure 5: Transmission protocols used by two UART
UART protocol finds use during the interface of PC and FPGA evaluation boards, RFID-based applications, Bluetooth Modules, GSM and GPRS Modems, Wireless Communications, GPS Receivers, etc.
Universal Synchronous Asynchronous Receiver and Transmitter (USART) is a mode of communication between serial devices, i.e., data units. For example, a byte transmits one bit at a time. The USART is unlike parallel modes of transmission where the entire data unit, like a byte, transmits at once. These are fit to change the parallel information in the sequential structure.
A USART is a standard device that can transmit a binary number as a square waveform to a receiver and receive a square waveform. It converts the information to a binary number. It uses asynchronous communications in which a master clock signal transmits to the receiver to coordinate data bit sampling through time. The two endpoints each manage their clock in asynchronous mode. USART transmits and receives the signal in full-duplex mode and uses it to signal when a send and/or receive is complete.

Figure 6: USART to convert Parallel data into serial data
USART protocols are popular in industrial and control applications. They operate in multi-drop networks where a master USART can communicate with a particular slave USART. They are also for Infrared (IR), Bluetooth communications, and USART modules used with other RF communication purposes – AM, FM, QPSK, PSK, FSK, Wi-Fi, etc.
The Intra system protocol establishes communication between components within the circuit board. In embedded systems, intra-system protocol increases the population of components connected to the controllers. An increase in components led to circuit complexity and increased power consumption. Intra system protocol promises secure access to data from the peripherals.
The categories of Intersystem protocols are:
Philips invented the Inter-Integrated Circuits protocol (IIC or I2C) in 1982. The I2C protocol connects multiple slaves to a single master or various slaves to multiple masters. The I2C protocol operates when two microcontrollers send data to the same memory or send identical data to the LCD with many other applications. The I2C serial communication protocol has two signals: Serial Data (SDA) and Serial Clock (SCL). The master and slave receive data through the SDA line, and SCL is the clock signal line. The I2C protocol supports, depending upon the modes of operation, different data speeds ranging from 100kbit/s in standard mode to 3.4 Mbps in full speed mode.

Figure 7: Single master and slave in the I2C protocol
I2C protocols use data from hardware sensors, communicate with multiple microcontrollers, display control of cellphones, change color settings of the monitor color, assess ADCs and DACs, circuits, and read specific memory ICs. They also operate in control applications like controlling and transmitting user-directed actions and switching on/off the power supply of the internal components.
Serial Peripheral Interface (SPI) is a four-wire serial data bus. A single node, called the master, manages activity on the bus. Other nodes called slaves respond to the master. The four wires on the bus perform the following functions:
SPI can simultaneously transfer data in both the directions on the MISO and MOSI lines, making it a full-duplex communication standard. One master can control multiple slaves, but additional SS pins are required. SPI protocol can support transfer data up to 50Mbps over short distances.

Figure 8: Architecture of SPI
The SPI communicates with different peripherals like sensors, analog to digital converter, digital to analog converter, etc. They interface LCDs, LEDs, MMC or SD cards, including SDIO variants, and communicate with FLASH and EEPROM memories.
Robert Bosch developed the Controller Area Network (CAN) protocol in the 1980s. A CAN bus system in a vehicle makes it possible to network electronic modules such as control units or intelligent sensors. The CAN bus is independent of the vehicle's electronics systems and functions as a data line to swap information among control units.
The system's design and construction enable it to work with a high degree of intrinsic safety. If faults still occur, they are mainly stored in the fault memory of the related control unit and are accessible by the Diagnostic Testing and Information System.
The basic system consists of several control units. Transceivers connect them parallel to the bus line, which implies that identical conditions apply to all stations. In simple words, the management of all control units is equal, and none are preferred. In this context, this is called multi-master architecture. There is a serial exchange of information.

Figure 9: A CAN bus in automobile
The CAN bus system divides into three unique systems due to the different requirements regarding signal repetition rate and the large data volume:
The CAN data bus uses twisted-pair wiring with differential data transfer to achieve top-notch security during data transfer. CAN high and CAN low are the wire names.
Both wires have the same default setting regarding the signal level in the rest state. For example, this setting of the drivetrain CAN data bus is about. 2.5V. The recessive state is also known as rest state setting. This is because as any control unit connected in the network can change it. The voltage increases in dominant state to match the CAN high wire. This is a predetermined value (on the drivetrain CAN data bus, this is at least 1V). The CAN low wire voltage drops by the same increment (a minimum of 1V on the drivetrain CAN data bus). The voltage thus rises by a minimum 3.5V ((2.5V + 1V = 3.5V) inactive state on the CAN high wire from the drivetrain CAN data bus. The voltage in the CAN low wire then drops to a maximum of 1.5V (2.5V - 1V = 1.5V). Therefore, the voltage difference between CAN high and CAN low in a recessive state is 0V, and in a dominant state, at least 2V.

Figure 10: Differential data transfer on CAN data bus
CAN protocol finds use for networking of components in automobiles. Besides automotive, CAN also finds applications in aircraft for in-flight analysis and networking of components such as fuel systems, pumps, and more. CANopen is popular in embedded control applications like industrial automation.