SlideShare a Scribd company logo
6
Most read
8
Most read
9
Most read
Communication Protocols
in Embedded Systems
Communication Protocols
 Introduction
 UART
 SPI
 I2C
Introduction
 Communication between electronics devices is like communication
between humans. Both sides need to speak the same language. In
electronics, these languages are called communications protocols.
Types of communication
 Types of Data communication:
• Parallel: In parallel communication, all the bits of data are transmitted
simultaneously on separate communication lines.
• Serial: In serial communication the data bits are transmitted serially one by
one i.e. bit by bit on single communication line.
Types of Communication
 Serial Communication uses two methods:
• Asynchronous.
• Synchronous.
Asynchronous:
1. Transfers single byte at a time.
2. No need of clock signal
3. Example: UART (universal asynchronous receiver transmitter)
Synchronous:
4. Transfers a block of data (characters) at a time.
5. Requires clock signal
6. Example: SPI (serial peripheral interface), I2C (inter integrated circuit).
UART Communication
 In UART communication, two UARTs communicate directly with each other.
 Only two wires are needed to transmit data between two UARTs. Data
flows from the Tx pin of the transmitting UART to the Rx pin of the receiving
UART:
 Instead of a clock signal, the transmitting UART adds start and stop bits to
the data packet being transferred. These bits define the beginning and
end of the data packet so the receiving UART knows when to start reading
the bits.
How UART works
 After the transmitting UART gets the parallel data from the data bus, it adds a start bit, a
parity bit, and a stop bit, creating the data packet. Next, the data packet is output serially,
bit by bit at the Tx pin. The receiving UART reads the data packet bit by bit at its Rx pin. The
receiving UART then converts the data back into parallel form and removes the start bit,
parity bit, and stop bits.
How UART works
 The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the data frame:
 The entire packet is sent serially from the transmitting UART to the receiving UART.
How UART works
 ADVANTAGES AND DISADVANTAGES OF UARTS
 ADVANTAGES
1. Only uses two wires
2. No clock signal is necessary
3. Has a parity bit to allow for error checking
4. The structure of the data packet can be changed as long as both sides are set up for it
 DISADVANTAGES
1. The size of the data frame is limited to a maximum of 9 bits
2. Doesn’t support multiple slave or multiple master systems
3. The baud rates of each UART must be within 10% of each other
SPI
 Devices communicating via SPI are in a master-slave relationship. The master is the
controlling device (usually a microcontroller), while the slave (usually a sensor, display, or
memory chip) takes instruction from the master. The simplest configuration of SPI is a single
master, single slave system, but one master can control more than one slave
How SPI works
 THE CLOCK
The clock signal synchronizes the output of data bits from the master to the sampling of bits
by the slave. One bit of data is transferred in each clock cycle, so the speed of data transfer
is determined by the frequency of the clock signal.
 SLAVE SELECT
The master can choose which slave it wants to talk to by setting the slave’s CS/SS line to a
low voltage level.
 MULTIPLE SLAVES
SPI can be set up to operate with a single master and a single slave, and it can be set up
with multiple slaves controlled by a single master.
How SPI works
How SPI works
 ADVANTAGES AND DISADVANTAGES OF SPI
 ADVANTAGES
1. No start and stop bits, so the data can be streamed continuously without interruption
2. No complicated slave addressing system like I2C
3. Higher data transfer rate than I2C (almost twice as fast)
4. Separate MISO and MOSI lines, so data can be sent and received at the same time
 DISADVANTAGES
1. Uses four wires (I2C and UARTs use two)
2. No acknowledgement that the data has been successfully received (I2C has this)
3. No form of error checking like the parity bit in UART
4. Only allows for a single master
I2C
 I2C combines the best features of SPI and UARTs. With I2C, you can
connect multiple slaves to a single master (like SPI) and you can have
multiple masters controlling single, or multiple slaves.
How I2C Works
 With I2C, data is transferred in messages. Messages are broken up into frames of data.
Each message has an address frame that contains the binary address of the slave, and
one or more data frames that contain the data being transmitted. The message also
includes start and stop conditions, read/write bits, and ACK/NACK bits between each
data frame:
How I2C works
1. The master sends the start condition to every connected slave by switching the SDA line
from a high voltage level to a low voltage level before switching the SCL line from high to
low.
2. The master sends each slave the 7 or 10 bit address of the slave it wants to communicate
with, along with the read/write bit.
3. Each slave compares the address sent from the master to its own address. If the address
matches, the slave returns an ACK bit by pulling the SDA line low for one bit.
4. After each data frame has been transferred, the receiving device returns another ACK bit
to the sender to acknowledge successful receipt of the frame.
How I2C works
How I2C works
 MULTIPLE MASTERS WITH MULTIPLE SLAVES
Multiple masters can be connected to a single slave or multiple slaves.
I2C
 ADVANTAGES AND DISADVANTAGES OF I2C
 ADVANTAGES
1. Only uses two wires
2. Supports multiple masters and multiple slaves
3. ACK/NACK bit gives confirmation that each frame is transferred successfully
4. Hardware is less complicated than with UARTs
5. Well known and widely used protocol
 DISADVANTAGES
1. Slower data transfer rate than SPI
2. The size of the data frame is limited to 8 bits
3. More complicated hardware needed to implement than SPI
I2S
 The protocol which is used to transmit digital audio data from one device to another
device is known as I2S or Inter-IC Sound protocol. This protocol transmits PCM (pulse-code
modulated) audio data from one IC to another within an electronic device.
 Features
 The I2S protocol features include the following.
1. It has 8 to 32 data bits for each sample.
2. Tx & Rx FIFO interrupts.
3. 16-bit, 32-bit, 48-bit, or 64-bit word select period.
4. Simultaneous bi-directional audio streaming.
5. It has different sample rates.
How I2S works
 The I2S communication protocol is a 3 Wire protocol that simply handles audio data through a 3-line serial bus which
includes SCK (Continuous Serial Clock), WS (Word Select) & SD (Serial Data).
 3-Wire Connection of I2S:
 SCK
The SCK or Serial Clock is the first line of the I2S protocol which is also known as BCLK or bit clock line which is used to
obtain the data on a similar cycle.
 WS
In the I2S communication protocol, the WS or word select is the line which is also known as FS (Frame Select)
wire that separates the right or left channel.
• If WS = 0 then left channel or channel-1 is used.
• If WS = 1 then the right channel or channel-2 is used.
 SD
The Serial Data or SD is the last wire where the payload is transmitted within 2 complements. So, it is very significant
that the MSB is first transferred, because both the transmitter & receiver may include different word lengths. Thus, the
transmitter or the receiver has to recognize how many bits are transmitted.
Communication Protocols in Embedded Systems.pptx

More Related Content

PDF
PA UNIT 4 (FR INFORMATION TECHNOLOGY) SPPU
piyushsborse7
 
PPTX
USART
Islam Samir
 
PDF
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
PPTX
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
PPTX
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
PPTX
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
PDF
communication interfaces-Embedded real time systems
Raghunath reddy
 
PPT
I2C PRESENTATION.PPT
venkatesh405785
 
PA UNIT 4 (FR INFORMATION TECHNOLOGY) SPPU
piyushsborse7
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
embedded system on board communication.pptx
BEVARAVASUDEVAAP1813
 
communication interfaces-Embedded real time systems
Raghunath reddy
 
I2C PRESENTATION.PPT
venkatesh405785
 

Similar to Communication Protocols in Embedded Systems.pptx (20)

PPT
SPI Bus Protocol
Sudhanshu Janwadkar
 
PDF
Embedded Communications Protocols UNIT 3PDF.pdf
kanyaakiran
 
PPTX
spi-180501092933-converted.pptx
sauryakumar3
 
PPTX
UART SPI and I2C serial Interfaces .pptx
rohinitalekar1
 
PPTX
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
PPTX
communication protocols in embedded systems.pptx
NooraldeenAli2
 
PPTX
Serial Communication in 8051
Sudhanshu Janwadkar
 
PPT
6 STM32's USART.ppt
MdRayhanTanvir
 
PPTX
EXIDE PPT TEMPLATE.pptx
NaveenK365392
 
PPT
Introduction to embedded systems
Игорь Медведев
 
PDF
SPI AND UART COMMUNICATION PROTOCOLS
DHIVYA MANI
 
PPTX
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 
PDF
An Implementation of I2C Slave Interface using Verilog HDL
IJMER
 
PPTX
I2C Protocol
Sudhanshu Janwadkar
 
PPTX
Universal Serial Communication Interface
Sandesh Agrawal
 
PPT
Serial Communication In Atmega 16
Suren Kumar
 
PPTX
Deepu Kumar Shah.pptx
DeepuShah
 
PPTX
8251 USART
ShivamSood22
 
PPTX
8251 USART.pptx
MeenaAnusha1
 
SPI Bus Protocol
Sudhanshu Janwadkar
 
Embedded Communications Protocols UNIT 3PDF.pdf
kanyaakiran
 
spi-180501092933-converted.pptx
sauryakumar3
 
UART SPI and I2C serial Interfaces .pptx
rohinitalekar1
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
communication protocols in embedded systems.pptx
NooraldeenAli2
 
Serial Communication in 8051
Sudhanshu Janwadkar
 
6 STM32's USART.ppt
MdRayhanTanvir
 
EXIDE PPT TEMPLATE.pptx
NaveenK365392
 
Introduction to embedded systems
Игорь Медведев
 
SPI AND UART COMMUNICATION PROTOCOLS
DHIVYA MANI
 
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 
An Implementation of I2C Slave Interface using Verilog HDL
IJMER
 
I2C Protocol
Sudhanshu Janwadkar
 
Universal Serial Communication Interface
Sandesh Agrawal
 
Serial Communication In Atmega 16
Suren Kumar
 
Deepu Kumar Shah.pptx
DeepuShah
 
8251 USART
ShivamSood22
 
8251 USART.pptx
MeenaAnusha1
 
Ad

Recently uploaded (20)

PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPTX
Online Cab Booking and Management System.pptx
diptipaneri80
 
PPT
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
Online Cab Booking and Management System.pptx
diptipaneri80
 
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Information Retrieval and Extraction - Module 7
premSankar19
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Ad

Communication Protocols in Embedded Systems.pptx

  • 3. Introduction  Communication between electronics devices is like communication between humans. Both sides need to speak the same language. In electronics, these languages are called communications protocols.
  • 4. Types of communication  Types of Data communication: • Parallel: In parallel communication, all the bits of data are transmitted simultaneously on separate communication lines. • Serial: In serial communication the data bits are transmitted serially one by one i.e. bit by bit on single communication line.
  • 5. Types of Communication  Serial Communication uses two methods: • Asynchronous. • Synchronous. Asynchronous: 1. Transfers single byte at a time. 2. No need of clock signal 3. Example: UART (universal asynchronous receiver transmitter) Synchronous: 4. Transfers a block of data (characters) at a time. 5. Requires clock signal 6. Example: SPI (serial peripheral interface), I2C (inter integrated circuit).
  • 6. UART Communication  In UART communication, two UARTs communicate directly with each other.  Only two wires are needed to transmit data between two UARTs. Data flows from the Tx pin of the transmitting UART to the Rx pin of the receiving UART:  Instead of a clock signal, the transmitting UART adds start and stop bits to the data packet being transferred. These bits define the beginning and end of the data packet so the receiving UART knows when to start reading the bits.
  • 7. How UART works  After the transmitting UART gets the parallel data from the data bus, it adds a start bit, a parity bit, and a stop bit, creating the data packet. Next, the data packet is output serially, bit by bit at the Tx pin. The receiving UART reads the data packet bit by bit at its Rx pin. The receiving UART then converts the data back into parallel form and removes the start bit, parity bit, and stop bits.
  • 8. How UART works  The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the data frame:  The entire packet is sent serially from the transmitting UART to the receiving UART.
  • 9. How UART works  ADVANTAGES AND DISADVANTAGES OF UARTS  ADVANTAGES 1. Only uses two wires 2. No clock signal is necessary 3. Has a parity bit to allow for error checking 4. The structure of the data packet can be changed as long as both sides are set up for it  DISADVANTAGES 1. The size of the data frame is limited to a maximum of 9 bits 2. Doesn’t support multiple slave or multiple master systems 3. The baud rates of each UART must be within 10% of each other
  • 10. SPI  Devices communicating via SPI are in a master-slave relationship. The master is the controlling device (usually a microcontroller), while the slave (usually a sensor, display, or memory chip) takes instruction from the master. The simplest configuration of SPI is a single master, single slave system, but one master can control more than one slave
  • 11. How SPI works  THE CLOCK The clock signal synchronizes the output of data bits from the master to the sampling of bits by the slave. One bit of data is transferred in each clock cycle, so the speed of data transfer is determined by the frequency of the clock signal.  SLAVE SELECT The master can choose which slave it wants to talk to by setting the slave’s CS/SS line to a low voltage level.  MULTIPLE SLAVES SPI can be set up to operate with a single master and a single slave, and it can be set up with multiple slaves controlled by a single master.
  • 13. How SPI works  ADVANTAGES AND DISADVANTAGES OF SPI  ADVANTAGES 1. No start and stop bits, so the data can be streamed continuously without interruption 2. No complicated slave addressing system like I2C 3. Higher data transfer rate than I2C (almost twice as fast) 4. Separate MISO and MOSI lines, so data can be sent and received at the same time  DISADVANTAGES 1. Uses four wires (I2C and UARTs use two) 2. No acknowledgement that the data has been successfully received (I2C has this) 3. No form of error checking like the parity bit in UART 4. Only allows for a single master
  • 14. I2C  I2C combines the best features of SPI and UARTs. With I2C, you can connect multiple slaves to a single master (like SPI) and you can have multiple masters controlling single, or multiple slaves.
  • 15. How I2C Works  With I2C, data is transferred in messages. Messages are broken up into frames of data. Each message has an address frame that contains the binary address of the slave, and one or more data frames that contain the data being transmitted. The message also includes start and stop conditions, read/write bits, and ACK/NACK bits between each data frame:
  • 16. How I2C works 1. The master sends the start condition to every connected slave by switching the SDA line from a high voltage level to a low voltage level before switching the SCL line from high to low. 2. The master sends each slave the 7 or 10 bit address of the slave it wants to communicate with, along with the read/write bit. 3. Each slave compares the address sent from the master to its own address. If the address matches, the slave returns an ACK bit by pulling the SDA line low for one bit. 4. After each data frame has been transferred, the receiving device returns another ACK bit to the sender to acknowledge successful receipt of the frame.
  • 18. How I2C works  MULTIPLE MASTERS WITH MULTIPLE SLAVES Multiple masters can be connected to a single slave or multiple slaves.
  • 19. I2C  ADVANTAGES AND DISADVANTAGES OF I2C  ADVANTAGES 1. Only uses two wires 2. Supports multiple masters and multiple slaves 3. ACK/NACK bit gives confirmation that each frame is transferred successfully 4. Hardware is less complicated than with UARTs 5. Well known and widely used protocol  DISADVANTAGES 1. Slower data transfer rate than SPI 2. The size of the data frame is limited to 8 bits 3. More complicated hardware needed to implement than SPI
  • 20. I2S  The protocol which is used to transmit digital audio data from one device to another device is known as I2S or Inter-IC Sound protocol. This protocol transmits PCM (pulse-code modulated) audio data from one IC to another within an electronic device.  Features  The I2S protocol features include the following. 1. It has 8 to 32 data bits for each sample. 2. Tx & Rx FIFO interrupts. 3. 16-bit, 32-bit, 48-bit, or 64-bit word select period. 4. Simultaneous bi-directional audio streaming. 5. It has different sample rates.
  • 21. How I2S works  The I2S communication protocol is a 3 Wire protocol that simply handles audio data through a 3-line serial bus which includes SCK (Continuous Serial Clock), WS (Word Select) & SD (Serial Data).  3-Wire Connection of I2S:  SCK The SCK or Serial Clock is the first line of the I2S protocol which is also known as BCLK or bit clock line which is used to obtain the data on a similar cycle.  WS In the I2S communication protocol, the WS or word select is the line which is also known as FS (Frame Select) wire that separates the right or left channel. • If WS = 0 then left channel or channel-1 is used. • If WS = 1 then the right channel or channel-2 is used.  SD The Serial Data or SD is the last wire where the payload is transmitted within 2 complements. So, it is very significant that the MSB is first transferred, because both the transmitter & receiver may include different word lengths. Thus, the transmitter or the receiver has to recognize how many bits are transmitted.