Use of Communication Protocols in Embedded Systems
Use of Communication Protocols in Embedded Systems
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.
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.
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:
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:
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.
UART is also two-wired i.e., the serial data is handled by Tx (Transmitter) and
Rx (Receiver) pins.
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: Telecommunications
I2C Protocol
SPI Protocol
CAN Protocol
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.
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
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.
Automotive oriented
Bit complex protocol
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.
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.
Why given the pull-up resistors in I2C SCL and SDA line.
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.
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.
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?
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.
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.
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.
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.
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.