Open-collector VS bipolar lines on I2C devices


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597

    Default Open-collector VS bipolar lines on I2C devices

    Hi,

    The manual mentions that the Clock and Data lines for I2C devices can be made either open-collector or bipolar. Open-collector requires a 4.7K pull-up resistor on the Clock and Data lines, and bipolar requires DEFINE I2C_SCLOUT 1.

    What is the difference between each option?

    Is there a performance difference?

    Can you mix open-collector and bipolar on the same mcu?

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Demon, If you use bipolar drive then the acknowlege bit sent from the slave component on the bus will be driving onto an active output, It really needs to be an open collector drive as the master w/pullups to be compatable with the I2C bus specification. As far as I know this option was put into place for devices that do not send an acknownege bit which there are few.

    Dave Purola,
    N8NTA
    Last edited by Demon; - 4th October 2016 at 18:05.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default

    Ah! Thanks Dave!

    So, what happens when you have more than 1 I2C device?

    Do you have only one pair of pull-ups on the mcu, or one pair on each device?

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Demon, Thats the beauty of an open collector buses is there can be an unlimited number of devices connected. Any device can respond to a command and any device can be the master. Over current collisions are avoided by there only being 1 set of pullup resistors that source the current to the bus. If 2 devices try to talk at the same time there is no excessive current drawn. Therefore there needs to be a standard protocol that is used in the communications scheme. I have had more than 32 devices on a single bus in the past without any problem. The resistors are sized by the time constant to clear the ground condition produced by the device that is talking on the bus. Therefore to talk at higher speeds the pullups need to be smaller in size to enable more source current to the bus to clear the ground condition.

    Dave Purola,
    N8NTA
    Last edited by Demon; - 4th October 2016 at 18:05.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default

    Okaaaay...

    So that begs the question, how do we calculate the resistor size?

    The manual says 4.7K resistors, but I suspect that is an 'average'.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Demon, What you need to do is use an oscilloscope and look at the SDA line as well as the SCK line. However the SDA line is of more importance due to the fact that any device on the bus can drive it. Usually there is only 1 master and it generates the clock for the slaves. With the maxumum devices on the bus and the longest bus lines, opertaing at your maximum speed, make sure that the SCL and SDA lines are not distorting the waveform. If the waveform is rounded then decrease the resistance in 100 ohm increments until the waveform edges look pretty square. Be carefull not to go below about 1K ohm as that would be 5 ma. of current draw. Some devices out there can't pull down much mode than that.

    Dave Purola,
    N8NTA
    Last edited by Demon; - 4th October 2016 at 18:05.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. I2C slave
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th March 2008, 03:46
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts