1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Difference between Start and Restart condition in I2C

Discussion in 'AVR' started by savvej, Jun 23, 2011.

  1. savvej

    savvej Member

    Joined:
    Jul 12, 2008
    Messages:
    153
    Likes:
    0
    Location:
    Bits-Pilani
    I am using PIC uC(as there was no separate entry for PIC ,I posted in AVR)-18f4520
    Language C-using Microchip's C18 Library
    In their C18 Library for I2C communications they have defined two functions :
    Start
    and
    Restart.
    And their description in manual seems to be same.

    The book which I have referred is PIC microcontroller design by John Peatman.
    There the procedure to read is jisted as follows:
    1)Start
    2)Send Device ADD + Write
    3)Send Internal ADD
    4)Stop
    5)Start
    6)Send Device ADD+ Read
    7)Read I2C
    8)NoACK
    9)Stop

    So here in step 5 does it imply Restart or Start?
     
  2. wkrug

    wkrug Active Member

    Joined:
    May 30, 2010
    Messages:
    280
    Likes:
    29
    Location:
    Germany
  3. savvej

    savvej Member

    Joined:
    Jul 12, 2008
    Messages:
    153
    Likes:
    0
    Location:
    Bits-Pilani
    I got it in their manual u posted...They say it as Repeated Start.From a tutorial on i2c by microchip ,it quotes as follows:

    "A restart condition indicates that a device would like
    to transmit more data, but does not wish to release the line. This is done when a
    start must be sent, but a stop has not occurred. It is also a convenient way to send a
    stop followed by a start right after each other. It prevents other devices from
    grabbing the bus between transfers.
    If you are talking to one device, such as a serial EEPROM, you may not want to be
    interrupted when transmitting addresses and gathering data. A restart condition will
    handle this.
    The restart condition is represented by a “R” in this presentation.
    The signaling used for a restart can be seen to be nothing more than a stop condition
    quickly followed by a start condition.
    The PICmicro microcontroller also will handle this. You simply request a restart
    condition be sent, then wait for it to complete."

    Anyways thanks for your interest and documentation of I2C you provided.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    ONLINE

    A restart is just a stop and start done too fast for anything else to grab the bus.

    Mike.
     
  6. John A. Harris

    John A. Harris New Member

    Joined:
    May 15, 2015
    Messages:
    1
    Likes:
    0
    A restart (or repeated start) is not the same as a Stop Start. I found this out the hard way.
    Some devices only read with restart (e.g. ADRF6755), even if there is only one master on the I2C bus.
    The Clock line must be released to do Starts and Stops.
    Stop Start:
    (if the data line is already high) Pull the clock line low, then Pull the data line low.
    Release the clock line. Release the data line for a Stop. Pull the data line low for a Start.
    Restart:
    (if the data line is already low) Pull the clock line low, then Release the data line.
    Release the clock line. Pull the data line low for a restart.
    John
     

Share This Page