What is the clock generating diagram I2C protocol while sending Data & Address from mater to slave.

Discussion in 'Embedded Systems and Microcontrollers' started by shetsachin, Sep 20, 2017.

  1. shetsachin

    Thread Starter New Member

    Jul 5, 2017
    16
    0
    I need to communicate between Micro controller & FPGA(frame grabber card) using I2C protocol.
    I want to know if data 5 has been sent from Master (Controller) what will be the clock generation.
    Using clock generation i can set frame grabber card as readable.

    Is this possible or can we determine the I2C clock cycle generated?
     
  2. Papabravo

    Expert

    Feb 24, 2006
    11,637
    2,440
    An I2C master generates any clock that it wants to generate within the specifications of the I2C protocol. An I2C slave MUST handle any clock generated by the I2C master that is within the parameters of the I2C protocol.

    https://www.nxp.com/docs/en/user-guide/UM10204.pdf
     
  3. shetsachin

    Thread Starter New Member

    Jul 5, 2017
    16
    0

    Thanks for reply.

    Can we find clock diagram generated by I2C protocol parameters master to slave.
     
  4. LesJones

    Well-Known Member

    Jan 8, 2017
    1,404
    334
    Last edited: Sep 21, 2017
  5. Papabravo

    Expert

    Feb 24, 2006
    11,637
    2,440
    Did you read the document I provided? For example Fig. 6 on p. 10. Do I really need to hold your hand or can you do this on your own.
     
  6. shetsachin

    Thread Starter New Member

    Jul 5, 2017
    16
    0
    Thank u for links have provided.
     
  7. shetsachin

    Thread Starter New Member

    Jul 5, 2017
    16
    0
    upload_2017-9-21_17-31-35.png
    I know that, the red marked data clock pulse i need to know.
    For ex: If i need to send 5 what will be data clock pulse diagram.
    I tried in several manuals & application note, didn't get.
     
  8. LesJones

    Well-Known Member

    Jan 8, 2017
    1,404
    334
    You need to send a clock for every data bit.

    Les.
     
  9. Papabravo

    Expert

    Feb 24, 2006
    11,637
    2,440
    I understand now. You need to send data in groups of 8 bits because the I2C state machine in the peripheral will send an ACK on the 9th bit. If your data does not require all 8 bits then you pad with zeros on the left. For Example is you want to send 5 = 0b101, the you must send 0b00000101. Do you get the picture?
     
  10. LesJones

    Well-Known Member

    Jan 8, 2017
    1,404
    334
    My understanding of the significance of the 5 bit question is the TS does not realise that the diagram is just saving space by not showing bits 3 to 8 in full. I don't even know if he plans to use a microcontroller with no hardware support for I2C and so all the work is done in software and just use IO port bits. I used a PIC12F1840 which has a master synchronous serial port which does a lot of the work.

    Les.
     
  11. Papabravo

    Expert

    Feb 24, 2006
    11,637
    2,440
    I've got to admit there was not a great deal of useful details in the original post, and it was certainly short on the actual requirements.
     
Loading...