ELECTRONIC COMMUNICATION
PROTOCOLS
09EC6656 – HIGH SPEED DIGITAL DESIGN
Seminar on
Theoretical Aspects
Prepared & Presented by:
HARIHARAN K
UCC18ECED08,M.Tech Scholar
Dept. of Electronics DesignTechnology,
NIELIT – Calicut.
Guided by:
JAYARAJ U KIDAV
Scientist/Engineer - ‘D’
NIELIT – Calicut.
OUTLINE
 Introduction
 Why we need Protocol?
 SPI, I2C
 UART
30 April 2019 209EC6656 | SEMINAR ON INTERFACES
INTRODUCTION
 Embedded System :
◦ HARDWARE + SOFTWARE to perform a desired application.
 SYSTEM takes INPUT, processes the same, provides
the desired OUTPUT
 COMMUNICATION is happening!
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 3
- Examples: CAN, I2C, I2S, SPI, Serial, USART,
UART, USB, RS-232, RS-485, Bluetooth,Wi-Fi,
ZigBee, LIN, MQTT, RFID, NFC etc.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 4
COMMUNICATION PROTOCOL
- A set of rules and regulations that allow
two electronic devices to connect to exchange
the data with one and another.
- RealWorld Applications:
- Remote Controlled Gadgets
- FileTransfer between PC and Mobile
CATEGORIES
 In terms of communication:
- Serial Communication
- Parallel Communication
 In terms of Peripheral Accessibility:
- Inter System Protocol
Ex: Between a CPU and a Embedded Development board :
USB, UART etc.,
- Intra System Protocol
Ex: Between two devices in a circuit board : SPI, I2C etc.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 5
SERIAL vs. PARALLEL
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 6
Contd.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 7
Internals of Serial Comm.
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 8
Serial Communication is all about Shift Registers!
Shift registers:
Some D-Flip-Flops serially connected while sharing the same
clock line.
How data is sent serially?
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 9
Transmitter: loading data in
parallel to a shift register, and
shifting it out a bit at a time -
Parallel In Serial Out Shift
Register
Receiver: receiving data a single bit at
a time and when all bits are received,
the shift register can be read in
parallel - Serial In Parallel Out Shift
Register
SERIAL IO
 Serial communication is preferred,
because:
 Few number of wires, less space etc.,
 Cost effective for long distances
 No Crosstalk and Clock Skew effects
 SerialTransmission Modes:
 Synchronous Data Transfer
 Asynchronous DataTransfer
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 10
Synchronous Data Transfer
 Generates the Data Clock and sends it to the receiver which
works accordingly in a synchronized manner.
 Faster and Reliable Mechanism
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 11
Asynchronous Data Transfer
 Generates the data clock internally and no incoming serial clock
signal.
 Proper Communication:TX and RX must be using the same baud
rate - rate at which bits are being sent bps (bits per second).
 Uses Start Bit, Stop Bit and Parity Bit for data reliability.
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 12
TERMINOLOGIES
 MSB/LSB : Sounds familiar, but it’s crucial!
◦ Asynchronous : LSB sent First
◦ Synchronous : MSB sent First
 SIMPLEX - HALF DUPLEX - FULL DUPLEX
 BAUDRATE - Number of symbols (group of bits)
transceived per second.
-TX and RX should obey same baud rate value!
 MASTER/SLAVE Concept: Usually Synchronous.Sometimes, Multi
Master/Slave too!
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 13
SPI
 Serial Peripheral Interface by Motorola in mid-1980’s
 Intra System - Full Duplex, Sync. Serial Communication
Protocol
 4 Pins - 4 wire communication protocol
SCK - Serial Clock
MOSI - Master Out, Slave In
MISO - Master In, Slave Out
CS/SS - Chip Select/Slave Select
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 14
SPI - Two key terms
 CPOL - Clock Polarity
 CPHASE - Clock Phase
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 15
SPI - Two key terms
 CPOL - Clock Polarity
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 16
SPI - Two key terms
 CPHASE - Clock Phase
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 17
Contd.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 18
SPI CONFIGURATIONS
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 19
Contd.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 20
Contd.,
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 21
Problem under Multi Slave
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 22
Advantages & Disadvantages
 Advantages:
◦ High Speed Protocol & Full Duplex
Communication
◦ No complexity - Address of the Slave Device
◦ Best Suited for Single Master Single Slave
Configuration
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 23
Advantages & Disadvantages
 Disadvantages:
◦ Pin Count is directly proportional to the
Number of Slave Devices
◦ No Acknowledgement!
◦ Slow speed device determining the speed
Example Devices: LM74 and TMP125
Temperature Sensors with SPI Interface
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 24
I2C
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 25
 Inter Integrated Circuits by Philips in mid-1980’s
 Intra System - Half Duplex Sync. Serial Communication
Protocol
 2 Pins - 2 wire topology
SCK - Serial Clock
SDA - Serial Data
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 26
I2C
I2C - Data Format
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 27
- Register Address + Data
I2C - Advanced Logics
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 28
Advantages:
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 29
Disadvantages:
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 30
I2C Real World Devices:
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 31
I2C vs SPI:
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 32
UART
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 33
Inter System - Async. Serial Communication Protocol
UART - Connection
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 34
UART - Frame
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 35
Advantages
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 36
Disadvantages
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 37
USB vs UART vs USART
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 38
REFERENCES
 “Serial I-O”, Dinesh K. Sharma Electrical Engineering
Department I.I.T. Bombay Mumbai 400 076, (version July 11,
2016)
 https://deepbluembedded.com/uart-pic-microcontroller-
tutorial/
 https://i2c.info/
 https://www.slideshare.net/EmertxeSlides/communication-
protocols-31945098
More References are available in Google andYouTube! Practical
experiments are needed to understand the concepts clearly!
Just search these keywords 
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 39
THANKYOU!
30 April 2019 09EC6656 | SEMINAR ON INTERFACES 40

I2C-SPI-UART Basics || Embedded System || Hariharan K

  • 1.
    ELECTRONIC COMMUNICATION PROTOCOLS 09EC6656 –HIGH SPEED DIGITAL DESIGN Seminar on Theoretical Aspects Prepared & Presented by: HARIHARAN K UCC18ECED08,M.Tech Scholar Dept. of Electronics DesignTechnology, NIELIT – Calicut. Guided by: JAYARAJ U KIDAV Scientist/Engineer - ‘D’ NIELIT – Calicut.
  • 2.
    OUTLINE  Introduction  Whywe need Protocol?  SPI, I2C  UART 30 April 2019 209EC6656 | SEMINAR ON INTERFACES
  • 3.
    INTRODUCTION  Embedded System: ◦ HARDWARE + SOFTWARE to perform a desired application.  SYSTEM takes INPUT, processes the same, provides the desired OUTPUT  COMMUNICATION is happening! 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 3
  • 4.
    - Examples: CAN,I2C, I2S, SPI, Serial, USART, UART, USB, RS-232, RS-485, Bluetooth,Wi-Fi, ZigBee, LIN, MQTT, RFID, NFC etc., 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 4 COMMUNICATION PROTOCOL - A set of rules and regulations that allow two electronic devices to connect to exchange the data with one and another. - RealWorld Applications: - Remote Controlled Gadgets - FileTransfer between PC and Mobile
  • 5.
    CATEGORIES  In termsof communication: - Serial Communication - Parallel Communication  In terms of Peripheral Accessibility: - Inter System Protocol Ex: Between a CPU and a Embedded Development board : USB, UART etc., - Intra System Protocol Ex: Between two devices in a circuit board : SPI, I2C etc., 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 5
  • 6.
    SERIAL vs. PARALLEL 30April 2019 09EC6656 | SEMINAR ON INTERFACES 6
  • 7.
    Contd., 30 April 201909EC6656 | SEMINAR ON INTERFACES 7
  • 8.
    Internals of SerialComm. 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 8 Serial Communication is all about Shift Registers! Shift registers: Some D-Flip-Flops serially connected while sharing the same clock line.
  • 9.
    How data issent serially? 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 9 Transmitter: loading data in parallel to a shift register, and shifting it out a bit at a time - Parallel In Serial Out Shift Register Receiver: receiving data a single bit at a time and when all bits are received, the shift register can be read in parallel - Serial In Parallel Out Shift Register
  • 10.
    SERIAL IO  Serialcommunication is preferred, because:  Few number of wires, less space etc.,  Cost effective for long distances  No Crosstalk and Clock Skew effects  SerialTransmission Modes:  Synchronous Data Transfer  Asynchronous DataTransfer 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 10
  • 11.
    Synchronous Data Transfer Generates the Data Clock and sends it to the receiver which works accordingly in a synchronized manner.  Faster and Reliable Mechanism 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 11
  • 12.
    Asynchronous Data Transfer Generates the data clock internally and no incoming serial clock signal.  Proper Communication:TX and RX must be using the same baud rate - rate at which bits are being sent bps (bits per second).  Uses Start Bit, Stop Bit and Parity Bit for data reliability. 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 12
  • 13.
    TERMINOLOGIES  MSB/LSB :Sounds familiar, but it’s crucial! ◦ Asynchronous : LSB sent First ◦ Synchronous : MSB sent First  SIMPLEX - HALF DUPLEX - FULL DUPLEX  BAUDRATE - Number of symbols (group of bits) transceived per second. -TX and RX should obey same baud rate value!  MASTER/SLAVE Concept: Usually Synchronous.Sometimes, Multi Master/Slave too! 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 13
  • 14.
    SPI  Serial PeripheralInterface by Motorola in mid-1980’s  Intra System - Full Duplex, Sync. Serial Communication Protocol  4 Pins - 4 wire communication protocol SCK - Serial Clock MOSI - Master Out, Slave In MISO - Master In, Slave Out CS/SS - Chip Select/Slave Select 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 14
  • 15.
    SPI - Twokey terms  CPOL - Clock Polarity  CPHASE - Clock Phase 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 15
  • 16.
    SPI - Twokey terms  CPOL - Clock Polarity 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 16
  • 17.
    SPI - Twokey terms  CPHASE - Clock Phase 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 17
  • 18.
    Contd., 30 April 201909EC6656 | SEMINAR ON INTERFACES 18
  • 19.
    SPI CONFIGURATIONS 30 April2019 09EC6656 | SEMINAR ON INTERFACES 19
  • 20.
    Contd., 30 April 201909EC6656 | SEMINAR ON INTERFACES 20
  • 21.
    Contd., 30 April 201909EC6656 | SEMINAR ON INTERFACES 21
  • 22.
    Problem under MultiSlave 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 22
  • 23.
    Advantages & Disadvantages Advantages: ◦ High Speed Protocol & Full Duplex Communication ◦ No complexity - Address of the Slave Device ◦ Best Suited for Single Master Single Slave Configuration 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 23
  • 24.
    Advantages & Disadvantages Disadvantages: ◦ Pin Count is directly proportional to the Number of Slave Devices ◦ No Acknowledgement! ◦ Slow speed device determining the speed Example Devices: LM74 and TMP125 Temperature Sensors with SPI Interface 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 24
  • 25.
    I2C 30 April 201909EC6656 | SEMINAR ON INTERFACES 25  Inter Integrated Circuits by Philips in mid-1980’s  Intra System - Half Duplex Sync. Serial Communication Protocol  2 Pins - 2 wire topology SCK - Serial Clock SDA - Serial Data
  • 26.
    30 April 201909EC6656 | SEMINAR ON INTERFACES 26 I2C
  • 27.
    I2C - DataFormat 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 27 - Register Address + Data
  • 28.
    I2C - AdvancedLogics 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 28
  • 29.
    Advantages: 30 April 201909EC6656 | SEMINAR ON INTERFACES 29
  • 30.
    Disadvantages: 30 April 201909EC6656 | SEMINAR ON INTERFACES 30
  • 31.
    I2C Real WorldDevices: 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 31
  • 32.
    I2C vs SPI: 30April 2019 09EC6656 | SEMINAR ON INTERFACES 32
  • 33.
    UART 30 April 201909EC6656 | SEMINAR ON INTERFACES 33 Inter System - Async. Serial Communication Protocol
  • 34.
    UART - Connection 30April 2019 09EC6656 | SEMINAR ON INTERFACES 34
  • 35.
    UART - Frame 30April 2019 09EC6656 | SEMINAR ON INTERFACES 35
  • 36.
    Advantages 30 April 201909EC6656 | SEMINAR ON INTERFACES 36
  • 37.
    Disadvantages 30 April 201909EC6656 | SEMINAR ON INTERFACES 37
  • 38.
    USB vs UARTvs USART 30 April 2019 09EC6656 | SEMINAR ON INTERFACES 38
  • 39.
    REFERENCES  “Serial I-O”,Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai 400 076, (version July 11, 2016)  https://deepbluembedded.com/uart-pic-microcontroller- tutorial/  https://i2c.info/  https://www.slideshare.net/EmertxeSlides/communication- protocols-31945098 More References are available in Google andYouTube! Practical experiments are needed to understand the concepts clearly! Just search these keywords  30 April 2019 09EC6656 | SEMINAR ON INTERFACES 39
  • 40.
    THANKYOU! 30 April 201909EC6656 | SEMINAR ON INTERFACES 40