Nothing Special   »   [go: up one dir, main page]

Use of Communication Protocols in Embedded Systems

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

Communication Protocols in Embedded Systems – Types, Advantages & Disadvantages:

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. Analog and
digital communication systems use various communication protocols widely. In addition, each
protocol has its own application area.

Communication Protocols in Embedded Systems:

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.

In this case, the components have to communicate with each other to provide the anticipated
output. Each communicating entity should agree to some protocol to exchange information. Many
different protocols are available for embedded systems and are deployed depending upon the
application area.

In general, the communication protocols is associated with physical layer describing the signals
incorporated, signal strength, hand shaking mechanism, bus arbitration, device addressing, wired
or wireless, data lines etc.

The processes such as system configuration, selection of baud rate and transmitting & receiving
data is associated with application layer.

Types of Communication Protocols in Embedded Systems

Communication protocols are broadly classified into two types:

Inter System Protocol

Intra System Protocol

Inter System Communication Protocols:

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:

Fig. 3 – Inter System Communication Protocols

Types of Inter System Communication Protocols

Inter system protocol can be categorized into:

USB Communication protocols

UART Communication protocols

USART Communication protocols

USB Communication Protocols:

Universal Serial Bus (USB) is a two-wired serial communication protocol. It allows 127 devices to be
connected at any given time. USB supports plug & play functionality.

USB protocol sends and receives the data serially between host and external peripheral devices
through data signal lines D+ and D-. Apart from two data lines, USB has VCC and Ground signals to
power up the device. The USB pin out is shown in Figure 4 below.
USB Pinout:

Fig. 4 – USB Pin Out

Data is transmitted in the form of packets where two devices communicate each other. Data
packets compose of 8 bits (byte) with LSB (Least Significant Bit) transmitted first.

USB associates NRZI (Non Return to Zero Invert) encoding scheme to transmit data with sync field
to synchronize the host system and receiver clock signals.

In USB, data is transferred in three different speeds such as:

Fig. 5 – USB speeds

Advantages of USB Communication Protocol


The advantages of USB Communication Protocol are as follows:

 Fast and simple.


 It is of low cost.
 Plug and Play hardware.

Disadvantages of USB Communication Protocol


The disadvantages of USB Communication Protocol are as follows:

 Needs powerful master device.


 Specific drivers are required.

UART Communication Protocols


Universal Asynchronous Receiver/Transmitter (UART) is not a communication
protocol but just a physical piece of hardware which converts parallel data
into serial data. Its main purpose is to transmit and receive data serially.

UART is also two-wired i.e., the serial data is handled by Tx (Transmitter) and
Rx (Receiver) pins.

UART transmits data asynchronously, which induces that no clock signal is


associated in transmitting and receiving data. Instead of clock signal, UART
embed start and stop bits with actual data bits, which defines the start and
end of data packet.

When receiver end detects the start bit, it starts to read the data bits at
specific baud rate meaning both transmitting and receiving peripherals should
work under same baud rate. UART works under half
duplex communication mode meaning it either transmits or receives at a
time.
Fig. 6 – UART Frame

Example: Emails, SMS

USART Communication Protocol


Universal Synchronous Asynchronous Receiver/Transmitter (USART) is
identical to that of UART with only added functionality synchronous. That is,
the transmitter will generate a clock signal which will be recovered at the
receiver end from the data stream transmitted without knowing baud rate
ahead.

UART works under full duplex communication mode meaning it can transmit


and receive data at same time.

USART encompass the abilities of UART, which enables application of both


depending on the applications area.
Fig. 7 – USART Frame

Example: Telecommunications

Advantages of UART/ USART Communication Protocol


The advantages of UART/ USART Communication Protocol are as follows:

 Clock signal is not required


 Cost effective
 Uses parity bit for error detection
 Requires only 2 wires for data communication

Disadvantages of UART/ USART Communication Protocol


The disadvantages of UART/ USART Communication Protocol are as follows:

 Doesn’t support multiple master slave functionality


 Baud rate of communicating UART should be within 10 percent of
each other
Intra System Communication Protocols:
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.

Increase in components lead to circuit complexity and increase in power


consumption. Intra system protocol promises secure access of data from the
peripherals.

Types of Intra System Communication Protocols


Intra system protocol can be categorized into:

 I2C Protocol
 SPI Protocol
 CAN Protocol

I2C Communication Protocols


Inter Integrated Circuit (I2C) is a serial communication protocol developed by
Philips Semiconductors. The main purpose of this protocol is to provide
easiness to connect peripheral chips with microcontroller. In embedded
systems, all peripheral devices are connected as memory mapped devices to
the microcontroller.

I2C necessitates two wires SDA (Serial Data Line) and SCL (Serial Clock Line)
to carry information between devices. These two active wires are said to be
bidirectional.

I2C protocol is a master to slave communication protocol. Each slave is been


provided with unique address. In order to establish communication, master
device initially sends the target slave address along with R/W (Read/Write)
flag. The corresponding slave device will move into active mode leaving other
devices in off state.

Once the slave device is ready, communication starts between master and
slave devices. One bit acknowledgment is replied by the receiver if
transmitter transmits 1 byte (8 bits) of data. A stop condition is issued at the
end of communication between devices.
Fig. 8 – Start and Stop Condition of I2C Communication Protocols

Advantages of I2C Communication Protocols


The advantages of I2C Communication Protocols are as follows:

 Provides good communication between onboard devices which are


accessed infrequently
 Addressing mechanism eases master slave communication
 Cost and circuit complexity does not end up on number of devices

Disadvantages of I2C Communication Protocols


The biggest disadvantage of I2C Communication Protocols is its limited
speed.

Serial Peripheral Interface (SPI) Communication Protocols


SPI (Serial Peripheral Interface) is one of the serial communication protocol
developed by Motorola. It is a 4-wire protocol namely MOSI
(Master Out Slave In), MISO (Master In Slave Out, SS (Slave Select), and
SCLK (Serial Clock).

As I2C protocol, SPI is also a master to slave communication protocol. In SPI,


the master device first configures the clock at a particular frequency.
Furthermore the SS line is used to select the appropriate slave by pulling the
SS line low where it is normally held high.

The communication is established between the selected slave and the master
device as soon as appropriate slave device is selected.
SPI is a full duplex communication protocol. SPI doesn’t limit data transfer to
8 bit words.

Fig. 9 – SPI Communication Protocols

Advantages of SPI Communication Protocols


The advantages of SPI Communication Protocol are as follows:

 Faster than asynchronous serial communication protocol.


 Support multiple slaves connectivity.
 Universally accepted protocol and low cost.

Disadvantages of SPI Communication Protocol


The disadvantages of SPI Communication Protocol are as follows:

 Requires more wires than other communication protocols.


 Master device should control all slave communications (slave-slave
communication is impossible).
 Numerous slave devices leads to circuit complexity.
Controller Area Network (CAN) Communication Protocol
CAN (Controller Area Network) is a serial communication protocol developed
by the Robert Bosch for intra vehicular communication. It requires two wires
CAN High (H+) and CAN low (H-) for data transmission.

CAN protocol is based on a message oriented communication protocol.

Advantages of CAN Communication Protocols


The advantages of CAN Communication Protocols are as follows:

 Low cost and reliable


 Shows robust performance
 Secured and fast protocol

Disadvantages of CAN Communication Protocol


The disadvantages of CAN Communication Protocol are as follows:

 Automotive oriented
 Bit complex protocol

 Inter System Protocol


 Intra System Protocol
Inter System Protocol
The inter-system protocol using to communicate the two different devices.
Like communication between computer to microcontroller kit. The
communication is done through an inter bus system.

Inter Bus System Protocols


The different categories of intersystem protocol mainly include the following.

 UART Protocol
 USART Protocol
 USB Protocol
UART Protocol
UART stands for a universal asynchronous transmitter and receiver. UART
Protocols is a serial communication with two wired protocols. The data
cable signal lines are labeled as Rx and Tx. Serial communication is
commonly used for transmitting and receiving the signal. It is transferred
and receives the data serially bit by bit without class pulses. The UART
takes bytes of data and sends the individual bits in a sequential manner.

UART is a half-duplex protocol. Half-duplex means transferring and


receiving the data but not at the same time. Most of the controllers have
hardware UART on board. It uses a single data line for transmitting and
receiving the data. It has one start bit, 8-bit data and a one-stop bit mean
the 8-bit data transfer one’s signal is high to low.

Ex: Emails, SMS, Walkie-talkie.

USART Protocol
USART stands for a universal synchronous and asynchronous transmitter
and receiver. It is a serial communication of a two-wire protocol. The data
cable signal lines are labeled as Rx and TX. This protocol is used to
transmitting and receiving the data byte by byte along with the clock pulses.
It is a full-duplex protocol that means transmitting and receiving data
simultaneously to different board rates. Different devices communicate with
microcontroller to this protocol.

Ex:-Telecommunications.

USB Protocol
USB stands for universal serial bus. Again it is a serial communication of
two-wire protocol. The data cable signal lines are labeled D+ and D-. This
protocol is used to communicate with the system peripherals.USB protocol
is used to send and receive the data serially to the host and peripheral
devices.USB communication requires driver software that is based on the
functionality of the system.USB devices can transfer data on the bus
without any request on the host computer.

Now a day’s most devices are using this technique for communicating with
USB protocol. Like a computer to communicate with an ARM controller
using USB. USB transfer the data to different modes .first one is slow speed
mode 10kbps to 100 kbps; the second one is full speed mode 500kbps to
10mbps, high-speed mode 25mbps to 400 Mbps.USB maximum cable
length of 4 meters.

Ex: Mouse, Keyboard, Hubs, switches, pen drive.

Differences Between the Inter System Protocols


The intersystem protocols mainly include UART, USART, and USB

UART USART USB


The term USART stands for
The term UART stands for Universal Synchronous and
Universal Asynchronous Asynchronous Data The term USB stands for
Transmitter and Receiver Transmitter and Receiver Universal Serial Bus
UART mainly includes two USART is a two-wire
wire-based protocols like protocol like Transmitter and USB is a two-wire protocol
transmitter and receiver Receiver like D+ & D-
It transmits as well as It transmits and receives a
receives pockets of data by block of data through It transmits and receives the
byte without classes pulse classes pulses data through clock pulses
UART is a half-duplex USART is a full-duplex USB is also full-duplex
communication communication communication
UART is slow as compared USART is slow as compared It is fast as compared to
to USART to USB USART and UART
Intra System Protocol
The Intra system protocol is used to communicate the two devices within
the circuit board. While using these intra system protocols, without going to
intrasystem protocols we will expand the peripherals of the microcontroller.
The circuit complexity and power consumption will be increased by using
the intrasystem protocol. Using intra system protocols circuit complexity and
power consumption, the cost is decreased and it is very secure to
accessing the data.

Intra System Protocols


The different categories of intrasystem protocol mainly include the following.
 I2C Protocol
 SPI Protocol
 CAN Protocol
I2C Protocol
I2C stands for the inter-integrated circuit and it requires only two wires
connecting all peripherals to the microcontroller. I2C requires two wires
SDA (serial data line) and SCL (serial clock line) to carry information
between devices. It is a master to a slave communication protocol. Each
slave has a unique address. The master device sends the address of the
target slave device and reads/writes the flag. The address matches any
slave device that the device is ON, the remaining slave devices are
disabled mode.
Once the address is match communication proceed between the master
and that slave device and transmitting and receiving the data. The
transmitter sends 8-bit data, the receiver replies 1-bit of acknowledgment.
When the communication is completed master issues the stop condition.
The I2C bus was developed by Philips Semiconductors. Its original purpose
is to provide an easy way to connect CPU to peripherals chips.

Peripheral devices in embedded systems are often connected to the


microcontroller as memory-mapped devices. I2C requires only two wires for
connecting all the peripherals to the microcontroller. These active wires,
called SDA and SCL, are both bidirectional. SDA line is a serial data line
and the SCA line is a serial clock line.

I2C Pull-up Resistors

Why given the pull-up resistors in I2C SCL and SDA line.

 Both SDA and SCL lines are open-drain drivers.


 It can drive output low canot driver it high.
 For the lines to be able to go high you must provide pull-up
resistors
SPI Protocol
SPI stands for the serial peripheral interface. It is one of the serial
communication protocol developed by Motorola. Sometimes SPI protocol is
also called a 4-wire protocol. It requires four wires MOSI, MISO, SS, and
SCLK.SPI protocol used to communicate the master and slave devices.
The master first configures the clock using a frequency.

The master then selects the particular slave device for communication by
pulling the chip select button. That particular device is selected and starts
the communication between the master and that particular slave. The
master selects only one slave at a time. It is a full-duplex communication
protocol. Not limited to 8-bit words in the case of bit transferring.

CAN Protocol
CAN stands for the controller area network. It is a serial communication
protocol. It requires two wires CAN High (H+) and CAN low (H-).  It was
developed by the Robert bosh company in 1985 for in-vehicle networks. It is
based on a message-oriented transmission protocol.

Differences Between the Intra System Protocols


The intra system protocols mainly include I2C, SPI, and CAN

I2C SPI CAN


SPI stands for serial peripheral The CAN stands for controller
I2C is an inter-integrated circuit interface area network
It is implemented by Philips SPI is developed by Motorola CAN is developed by Bosch
I2C is a half-duplex protocol SPI is a full-duplex protocol CAN is a full-duplex protocol
Synchronization Synchronization Synchronization
It is a two-wire protocol like SCL It is a four-wire protocol like It is a two-wire protocol like
& SDL SCL, MISO, MOSI & SS CANH+ and CAN H-
It is a multi-master protocol It is a single master protocol It is a multi-master protocol
It is used in the circuit board It is used in the circuit board It is used in two circuit board
Communication Protocols in IoT
The IoT based devices are more susceptible to threats. So these security
loopholes can be reduced by using the correct protocols. Communication
protocols in IoT are types of communication that ensure the finest security
toward the data being exchanged among the IoT connected devices.

The connection of these devices can be done through an IP network


otherwise a non IP network but, there is a disparity within their power, range
& memory used. The connection throughout IP networks is difficult & takes
huge memory as well as power from these devices as the range is not a
trouble. Alternatively, Bluetooth which is known as non-IP networks needs
low power and memory however they have a limitation in the range.
The main benefits of IoT communication protocols are high quality,
credibility, interoperability, innovation flexibility & global scalability. IoT
protocols are available in two types mainly IoT network protocols and IoT
data protocols.
The list of Top 10 IoT Communication Protocols includes the following.
 WiFi
 SigFox
 Bluetooth
 LoRaWAN
 NFC (Near Field Communication)
 Z wave
 Zigbee
 OPC- UA
 Cellular
 MQTT
Data Communication Protocols
Data communication protocols are very significant for communication
because they are used for understanding the networks or computers or
devices to each other.

These types of protocols use typical rules as well as methods like a


common language to interact with computers or networks to each other. For
instance, if a user wants to send an e-mail to another, then the user will
create the e-mail on his personal computer by including the details along
with the message and attachments.
Once the user sends the e-mail, then immediately multiple actions can take
place so that the receiver gets the email. The message moves over the
network and reaches the recipient. These protocols provide the information
on how the note will be enclosed so that it can move over the system, how
the receiver computer can verify for errors, etc

PLC Communication Protocols


The following primary communication protocols are used for the PLC as
well as other connections of the network which supports through different
PLC software products. These protocols mainly depend on the basic three
parts like baud rate, length of network & the number of nodes. The list of
PLC communication protocols includes the following.

 Profibus
 Interbus
 ControlNet
 ProfiNet
 CompoNet
 DirectNet
 Modbus
 MelsecNet
 EtherCAT
 DF-1 Protocol
 Optomux
 Host Link Protocol
 RAPIENet
 therNet/IP
 Mechatrolink
 PPI- Point to Point
 Ethernet Powerlink
 Multi-Point Interface (MPI)
 Data Highway (DH)
 Actuator Sensor Interface (ASI)
 DeviceNet
 Highway Addressable Remote Transducer Protocol (HART)
 Ethernet Global Data (EGD)
 Factory Interface Network Service Protocol (FINS)
 Open Smart Grid Protocol (OSGP)
 Recommended Standard (RS-232, RS- 422, and RS-485)
Protocols
 Bristol Standard Asynchronous Protocol (BSAP)
 Distributed Network Protocol (DNP3)
 Service Request Transport Protocol (SRTP)
 Smart Distributed System Protocol (SDS)
 Process Image Exchange Protocol (PIEP)
Characteristics of PLC Communication Protocols
The standard protocols are used once PLC modules are connected over
the network. The different types these protocols mainly supports different
speed, distance & the number of connecting devices.

 Ethernet protocol baud rate is 100 Mb/s, length is Few Km and 255
nodes.
 RS-485 baud rate is 10 Kb/s, the length is 1.2 Km, and 32 nodes
 Profibus protocol baud rate is 5-12 Mb/s, the length is 15 Km and
127 nodes.
 RS-232 baud rate is 19.2 Kb/s, the length is 10m and 1 node
 MPI protocol baud rate is 19.2- 38.4 Kb/s, the length is 50 m and
32 nodes.
 PC Adapter baud rate is 9600 Kb/s, length is 15 m, and 1 node
 PPI protocol baud rate is 187.5 Kb/s, the length is 500 m, and 1
node.
 USB Adapter baud rate is 57.6 Kb/s, the length is 10 m and 1sec
 DH protocol baud rate is 230.4 Kb/s, the length is 3.048 Km, and
64 nodes
 Device Net protocol braud rate is 500 Kb/s, the length is 0.487, and
64 nodes
 Control Net protocol baud rate is5 Mb/s, the length is 30 Km
Communication Protocols in Cloud Computing
The cloud supports two communication protocols for communication as well
as connection like MQTT and HTTP. The communication of these devices
can be done through Cloud IoT Core across a bridge either the HTTP or the
MQTT. These bridges are central components in Cloud IoT Core. Once you
create a registry of a device, then you can choose protocols to allow HTTP,
MQTT, etc. The standard protocol like MQTT is used frequently and it is
supported through embedded devices. This protocol is common in the
interactions of the machine to machine.

HTTP is a connectionless protocol, so devices do not maintain a connection


to the cloud IoT core. As an alternative, they send requests as well as get
responses. The protocols of cloud computing are a set of rules that permit
two electronic elements to unite as well as exchange the data with each
other. It is mainly used for communication, storage, encryption, networks,
decryption, security, management of user login, etc. Some cloud computing
protocols include

 Gossip Protocol
 MTP (Media Transfer Protocol)
 CLNP (Connection Less Network Protocol)
 CEE (Coverage Enhanced Ethernet Protocol)
 SRP (State Routing Protocol)
 SSHP (Secure Shell Protocol)
 IGMP (Internet Group Management Protocol)
Thus, this is all about an overview of communication protocols, types,
differences between inter-system protocol and intrasystem protocol. Here is
a question for you, what are Arduino communication protocols?

Popular communication protocols in


Embedded systems – Part I
In Embedded systems, communication protocols holds a special place as it opens up ways to
efficiently exchange data between devices. There are lot of protocols exists in embedded world
but out of all we will come across few protocols more often than the others. We conducted a poll
across Embedded engineers/ enthusiast communities across internet and compiled a list of seven
communication protocols that are so popular and worth to be aware of. 
1. SPI(Serial Peripheral Interface) Protocol:
The SPI is a full duplex protocol which uses master slave configuration to establish
communication. Motorola invented this protocol in 1980. SPI is used in microcontrollers with
interfaces like EEPROM, LCD displays, etc.
SPI protocol comprises of four pins:
 SCLK: Serial Clock ( Clock source for data transmission )
 MOSI: Master Output Slave Input  (Output data from Master)
 MISO: Master Input Slave Output  (Output data from Slave)
 SS: Slave Select ( Slave selection from multiple slaves by Master)
Additional SS pins are necessary when master device needs to control more than one slaves.
One master can control multiple slaves. SPI protocol supports high speed data transfer with  bus
speed typically stand around 50Mhz therefore the data transmission speed can be go up to
50Mbps.
Data Transmission:
The master device has to select the slave to which the data needs to be sent using the Slave
Select pin by activating a low input signal. Then the clock pulse from SCLK pin will be sent to
slave to synchronize the transmission. The data from Master pin goes through MOSI pin and from
slave to master comes through MISO pin.

Popular communication protocols in


Embedded systems – Part I
In Embedded systems, communication protocols holds a special place as it opens up ways to
efficiently exchange data between devices. There are lot of protocols exists in embedded world
but out of all we will come across few protocols more often than the others. We conducted a poll
across Embedded engineers/ enthusiast communities across internet and compiled a list of seven
communication protocols that are so popular and worth to be aware of. 
1. SPI(Serial Peripheral Interface) Protocol:
The SPI is a full duplex protocol which uses master slave configuration to establish
communication. Motorola invented this protocol in 1980. SPI is used in microcontrollers with
interfaces like EEPROM, LCD displays, etc.
SPI protocol comprises of four pins:
 SCLK: Serial Clock ( Clock source for data transmission )
 MOSI: Master Output Slave Input  (Output data from Master)
 MISO: Master Input Slave Output  (Output data from Slave)
 SS: Slave Select ( Slave selection from multiple slaves by Master)
Additional SS pins are necessary when master device needs to control more than one slaves.
One master can control multiple slaves. SPI protocol supports high speed data transfer with  bus
speed typically stand around 50Mhz therefore the data transmission speed can be go up to
50Mbps.
Data Transmission:
The master device has to select the slave to which the data needs to be sent using the Slave
Select pin by activating a low input signal. Then the clock pulse from SCLK pin will be sent to
slave to synchronize the transmission. The data from Master pin goes through MOSI pin and from
slave to master comes through MISO pin.
2. I2C(Inter-Integrated Circuit) Protocol:
I2C is a two wire serial bus communication protocol invented in 1982 by Philips Semiconductors.
It is a  two-wire communication interface and commonly used to connect low-speed devices like
microcontrollers, A/D and D/A converters, I/O devices and other peripherals in embedded
systems.
I2C uses two pins to establish communication:
 SDA: Serial Data Line
 SCL: Serial Clock Line

I2C protocol supports different data speed based on their mode of operation. Data transfer speed
100kbit/s when operating in standard mode and 400 kbit/s when operating in full speed mode.
Data Transmission:
In I2C protocol each device is given a specific address. When a master wishes to transfer data to
a slave, it sends the address of slave device through SDA pin for which the message is intended
to. It is followed by Data frame and only the slave with the specified address will accept this
incoming data.
3.USART(UniversalSynchronous/Asynchronous
Receiver/Transmitter) Protocol:
USART is a serial communication protocol developed by Digital Equipment Corporation in 1960’s.
It supports Full duplex, Half duplex and simplex communication. This is one of the most popular
protocol and will be in almost all microcontrollers
The communication in UART takes place through two pins.
 RX: Receive the incoming data
 TX: Transmits the outgoing data
Data transmission in USART takes place by means of data packets which usually consists of 8
data bits, start bits and parity bit to perform error correction.

Data Transmission:
As mentioned above Data in USART will be sent in the form of data packets or data frame. The
data frame starts with a start bit, followed by data bits and then by parity and stop bit. Most
microcontrollers provide ways to configure the number of data bits and composition of the data
frame.

4. CAN(Control Area Network) Protocol:


Controller Area Network or CAN protocol is designed to share data among multiple interfaces to
reduce the complexity of connectivity and wiring. This was first developed and used in
automobiles to establish communication between different parts of the automobile like engine,
bakes, air conditioner etc while reducing the wiring in it. The unique feature about CAN protocol is
that a data transmitted from one CAN device or node will be available to all the devices
connected in the CAN bus.
This protocol uses two wires for communication with other CAN devices
 CAN HIGH
 CAN LOW
There are two types of CAN protocols: Standard CAN and Extended CAN.

Data Transmission:
In standard CAN any node can transmit data through the bus to any node. CAN data frame starts
with a start bit followed by a 11 bit identifier which sets the priority of the message. Message with
higher priority gains access to the CAN bus when two devices attempt to send message at the
same time. RTR bit indicates if the data is being requested from a particular node. IDE bit marks
whether it is a standard or extended CAN frame. Data length code bits follows IDE which
indicates the length of data. Then comes the message itself. Cyclic redundancy check and ACK
bits follows then and are used to error check to ensure proper transmission of data. A 7 bit end of
frame which marks the end of the message.

5. USB(Universal Serial Bus) Protocol:


USB is one of the well developed and most used communication protocol. Despite having
different standards and hardware types, it is considered to be versatile and effective in embedded
systems. USB communication takes place by means of polling where the host device initiates the
data transfer. When a device connects to the host it assigns address to the and uses it to perform
data transfer.
USB protocol uses below pins to function
 VCC – For power supply
 GND – To close the circuit
 D+ – Data transfer differential line
 D-  – Data receive differential line
Data Transmission:
Every data transfer in a USB communication is done by means of data packets, Generally there
are three components in a data packet : a token packet which carries information such as data
type, device address. Next the datapacket which holds the actual data to be transferred and EOP
to indicate the data packet is ended.

6. ETHERNET Protocol
Ethernet is most popular networking protocol used to establish connections right from LAN to
WAN. With the growth in IOT, this protocol has become indispensable in Embedded systems.
This communication protocol has undergone series of revisions over the years to enhance its
connectivity and speed. Mostly Ethernet controller chips like WZ1500 will be used with regular
microcontrollers to enable the Ethernet connectivity. However some high end Microcontrollers like
STM32 will have some degree of inbuilt Ethernet protocol support within. Such microcontrollers
use MII or RMII protocol to transmit and receive data within network. Read more about Ethernet
protocol.
Data Transmission:
Transmission of data in Ethernet protocol takes the form of data frames. This data frame
constitutes of senders address, receiver address, actual data and bits for error correction.

7. RS-485 Protocol:
RS-485 is yet another protocol popular for connecting microcontrollers with external peripherals.
This protocol comes in very handy when the data need to be transmitted for over hundreds of
meters. Similar to Ethernet protocol most microcontrollers uses external chips like MAX485 to use
this protocol. Using this protocol several devices can use the same interface and perform data
exchange. More about RS-485 protocol here. These are the pins involved in RS-485 protocol.
 TX+
 TX-
 RX+
 RX- 
Data Transmission:
A typical data frame of RS-485 comprises of start bits, receiver address, data bits and stop bits to
indicate the end of transmission.

Hope this was informative to you. We will publish part II of this popular communication protocols
series soon. If you have any feedback, comments or suggestions do use the comment box below.

communication protocols for an embedded


engineer to know
What is a communication Protocol?
Forming the basis of device interaction, Communication Protocols are the foundation
to consistent connectivity. A Two-way communication exchange is controlled by a
system of rules that enable data to be transmitted between devices to send and
receive messages.

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.  The functionality of such communication typically follows Master-Slave
exchange, where Microprocessors (Masters) command data transmission to and
from the sensor/ (Slaves).

Today, there are a range of Protocols that Embedded Engineers can consider
integrating to assist device-to-device communications. From basic to specialised,
each has its own merits and Application usage. Knowing the functions of each
Protocol calls for more informed decisions when building Embedded Systems.

UART
Universal Asynchronous Receiver Transmitter (UART) is perhaps the most simplified
and oldest form of device communication.  They are considered more of a physical
circuit (IC) than Protocol, typically integrated Microcontroller chips (Inter-System).
Following Serial Communication, UARTs core principle is to transmit and receive data
through the use of two-wire interaction.  This makes UART easy to implement at
reduced costs.

Unlike the majority of protocols, data transmission follows TX-RX pin communication
connected through GND common ground.  So, UART operates Asynchronous
transmission where no clock signal is needed for the receiver to synchronise data.
This means that data interruptions may manifest, a consideration when integrating.

Instead, UART aids stop and start bits to detect incoming data.  Here device
communication speed must follow the same baud rate configuration (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
SPI
Famous within the Embedded world, Serial Peripheral Interface (SPI) is a highly used
Protocol across a range of chipsets.  Its essential function as an interface Bus is to
send/receive data across Microcontrollers (Master) and Peripherals- like sensors,
SDs (Slaves) to assist device communication.
Following a Serial Communication Protocol with a Full-Duplex configuration, data bits
can be transmitted continuously in both directions at the same time through Master-
Slave 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.

 I2C
Created by Phillips, to power electrical lightening, Intern- Integrated Circuit (I2C)
communication is popular due to its Multi-Master- Multi-Slave structure- known as an
I2C Bus.  Such structure is valuable when registering multiple Micro-Controllers data
to power a device system.  I2C has varying use case Applications, particularly in IC
circuits like LCD Modules, Temperatures Sensors, and Data Acquisition, etc. making
it a common Protocol among the Embedded landscape

Following a Half-Duplex configuration, data can be transferred bit by bit via two-way
communication at a single time.  This is a consideration when considering
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 case needs to be
evaluated as it is more complex than most other Protocols.

USB
USB refers to Universal Serial Bus, following an Inter-System Protocol USB
communicates between two devices. Prominent in the Computer electronic device
world, USB has become prominent 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.

You might also like