Serial Communiaction Protocols

download Serial Communiaction Protocols

of 17

Transcript of Serial Communiaction Protocols

  • 8/2/2019 Serial Communiaction Protocols

    1/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    1

    DEVICES AND COMMUNICATION

    BUSES FOR DEVICES NETWORK

    LessonLesson--18:18: SERIAL BUS

    COMMUNICATION PROTOCOLS

    II22CC

  • 8/2/2019 Serial Communiaction Protocols

    2/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    2

    Interconnecting number of device circuits,Interconnecting number of device circuits,

    Assume flash memory, touch screen,

    ICs for measuring temperatures andICs for measuring pressures at anumber of processes in a plant.

    ICs mutually network through acommon synchronous serial bus I2C

    An 'Inter Integrated Circuit' (I2C) bus,a popular bus for these circuits.

  • 8/2/2019 Serial Communiaction Protocols

    3/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    3

    Synchronous Serial Bus Communication forSynchronous Serial Bus Communication for

    networkingnetworking Each specific I/O synchronous serial device

    may be connected to other using specific

    interfaces, for example, with I/O deviceusing I2C controller

    I2C Bus communication use of only

    simplifies the number of connections andprovides a common way (protocol) ofconnecting different or same type of I/O

    devices using synchronous serialcommunication

  • 8/2/2019 Serial Communiaction Protocols

    4/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    4

    IO IIO I22

    C BusC Bus Any device that is compatible with a I2C

    bus can be added to the system

    (assuming an appropriate device driver

    program is available), and a I2C device

    can be integrated into any system thatuses that I2C bus.

  • 8/2/2019 Serial Communiaction Protocols

    5/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    5

    Serial IO I2C bus

    Serial bus controller for I2C in a

    Microcontroller

    IO Device

    Interface

    IO Device

    Interface

    Serial IO bus

    IO Device

    Interface

    IO Device

    Interface

    Processor

    of system D

    Processor of

    system E

    Processor

    of system B

    Processor

    of system C

  • 8/2/2019 Serial Communiaction Protocols

    6/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    6

    Originally developed at PhilipsOriginally developed at Philips

    SemiconductorsSemiconductors

    Synchronous Serial Communication 400

    kbps up to 2 m and 100 kbps forlonger distances

    Three I2

    C standards Industrial 100 kbps I2C,

    100 kbps SM I2C, 400 kbps I2C

  • 8/2/2019 Serial Communiaction Protocols

    7/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    7

    Distributed Systems (ICs) on IDistributed Systems (ICs) on I22C Bus usingC Bus using

    serial data line and clockserial data line and clock

  • 8/2/2019 Serial Communiaction Protocols

    8/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    8

    II22

    CC BusBus The Bus has two lines that carry its

    signals one line is for the clock and

    one is for bi-directional data. There is a standard protocol for the I2C

    bus.

  • 8/2/2019 Serial Communiaction Protocols

    9/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    9

    Device Addresses and Master in the IDevice Addresses and Master in the I22

    C busC bus Each device has a 7-bit address using

    which the data transfers take place.

    Master can address 127 other slaves atan instance.

    Master has at a processing elementfunctioning as bus controller or amicrocontroller with I2C (Inter

    Integrated Circuit) bus interfacecircuit.

  • 8/2/2019 Serial Communiaction Protocols

    10/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    10

    Slaves and Masters in the ISlaves and Masters in the I22

    C busC bus Each slave can also optionally has I2C (Inter

    Integrated Circuit) bus controller and

    processing element. Number of masters can be connected on the

    bus.

    However, at an instance, master is one,which initiates a data transfer on SDA(serial data) line and which transmits theSCL (serial clock) pulses. From master, a

    data frame has fields beginning from startbit

  • 8/2/2019 Serial Communiaction Protocols

    11/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    11

    Bits as per IBits as per I22

    C BusC Bus ProtocolProtocol

  • 8/2/2019 Serial Communiaction Protocols

    12/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    12

    Synchronous Serial Bus Fields and its length

    First field of 1 bitStart bit similar to onein an UART

    Second field of 7 bits

    address field. Itdefines the slave address, which is beingsent the data frame (of many bytes) by the

    master Third field of 1 control bitdefines

    whether a read or write cycle is in progress

    Fourth field of 1 control bit

    defineswhether is the present data is anacknowledgment (from slave)

  • 8/2/2019 Serial Communiaction Protocols

    13/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    13

    Synchronous Serial Bus Fields and its length

    Fifth field of 8 bitsI2C device data byte

    Sixth field of 1-bit

    bit NACK (negativeacknowledgement) from the receiver. If

    active then acknowledgment after a transfer

    is not needed from the slave, elseacknowledgement is expected from the

    slave

    Seventh field of 1 bit

    stop bit like in anUART

  • 8/2/2019 Serial Communiaction Protocols

    14/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    14

    Disadvantage of I2C bus

    Time taken by algorithm in thehardware that analyzes the bits through

    I2C in case the slave hardware does notprovide for the hardware that supportsit.

    Certain ICs support the protocol andcertain do not.

    Open collector drivers at the master

    need a pull-up resistance of 2.2 K oneach line

  • 8/2/2019 Serial Communiaction Protocols

    15/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    15

    SummarySummary

  • 8/2/2019 Serial Communiaction Protocols

    16/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    16

    We learnt I2C is a serial bus for interconnecting

    the ICs. A start bit and a stop bit like in UART.

    It has seven fields for start, 7-bitsaddress, defining a read or write,

    definition of byte as acknowledging

    byte, data byte, NACK and end bit.

  • 8/2/2019 Serial Communiaction Protocols

    17/17

    2008 Chapter-3 L18: "Embedded Systems - " , Raj Kamal,Publs.: McGraw-Hill Education

    17

    End of Lesson 18 of Chapter 3End of Lesson 18 of Chapter 3