Shop OBEX P1 Docs P2 Docs Learn Events
I need advice from propeller/i2c experts :) — Parallax Forums

I need advice from propeller/i2c experts :)

FireHopperFireHopper Posts: 180
edited 2010-05-29 17:13 in Propeller 1
I have a propeller circut I am working on using the propeller serial servo controller. I have my custom firmware almost all written. but not tested. all my items have arrived. but my question is this.. I am using 4 blinkm devices, and they will be daisy chained off the same data/clock lines. do I need a pull up on each one. or just where it exits the propeller board?

the chain will be a total of about 2-3 feet long.. with perhaps 2 blinkm's at the 1 foot and then 2 foot mark..

please advise [noparse]:)[/noparse]

Comments

  • RaymanRayman Posts: 15,003
    edited 2010-05-28 18:41
    You only want 10k pullup on each line. No more, no less. (not that I'm an expert)

    2-3 feet is about the longest you'd want to run an I2C bus...
    It's really not meant to go out on cables, but a couple feet would probably be OK.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • T ChapT Chap Posts: 4,224
    edited 2010-05-28 19:40
    Not to contradict the I2C standard, but I routinely use lengths up to 30 feet and have never experienced a problem.
  • RaymanRayman Posts: 15,003
    edited 2010-05-28 20:10
    I think it's just an RC time question... The more things you put on the bus and the longer the connections,
    the more capacitance you have and that slows down the rise/fall times through the 10k pullups...

    There are a couple different I2C communication speeds and probably the slow speed would work with long cables...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • TubularTubular Posts: 4,726
    edited 2010-05-28 20:47
    I think you're allowed 400 pF of bus capacitance according to the spec. That may be at 100 kHz.
    So you should be able to get 5 ft out of it without too much trouble

    Although a single 10k ohm is normally used, I've seen designs down to about 2k ohm for the pullup. I can't see why distributed resistances wouldn't work if you needed to improve noise robustness
  • Brian RileyBrian Riley Posts: 626
    edited 2010-05-28 20:57
    Rayman said...
    You only want 10k pullup on each line. No more, no less. (not that I'm an expert)

    2-3 feet is about the longest you'd want to run an I2C bus...
    It's really not meant to go out on cables, but a couple feet would probably be OK.

    In the Arduino world (5 volt) they are pretty fond of 4.7K instead of 10K. I have used both values and see no difference. But one each on the SDA and SCL is all that is needed.

    2-3 feet is "by the book" .. I was on an OOPIC forum where guys there regularly approached 10 feet, but it had to in an electricly VERY quiet environment withe carefully selected cables. @todd ... 30 feet !!?? you must be in an electricly DEAD ZONE! wink.gif

    cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
    www.wulfden.org/TheShoppe/prop/ - Propeller Products
    www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
  • T ChapT Chap Posts: 4,224
    edited 2010-05-28 21:13
    I have used several 25' runs off the same lines, with 24vdc and mosfets driving a BLCD motor running. I would think there would be some noise from the motor switching, but haven't seen a miscommunication yet. I never use less than 10', and have quite a few systems of the same systems running. I bought some i2C extender IC's but never bothered when I saw that things worked find without. I have used both flat unshielded ribbon cable and unshielded CAT5E cables with the same results. The devices range between PCF8575, 8574, Qprox 1081, 10160. All typical residential buildings. Using minimal I2C driver.

    Post Edited (Todd Chapman) : 5/28/2010 9:20:19 PM GMT
  • localrogerlocalroger Posts: 3,452
    edited 2010-05-28 22:17
    There are two ways to get longer distances:

    1. Reduce the clock rate. Since the Prop I2C stack is in software this is trivial and if you don't need the bandwidth, neatly solves the problem.

    2. Run each high frequency line as half of a twisted pair, twisted around a ground wire. This cancels out most EMI. CAT5 works nicely for this. Under no circumstance ever run two high frequency signals on the two wires of a single twisted pair. For even better performance, use individually shielded instrumentation cable such as Belden 8723.

    There are also schemes afloat for optically isolating and buffering the signal, but there you're getting into a lot of work.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-05-29 00:09
    @Brian riley.... I use 1.5k resistors and have not noticed any problems. And yeah 2-3 feet is usually the max recommended length. You could also slow the clock speed down
  • FireHopperFireHopper Posts: 180
    edited 2010-05-29 10:04
    since the blinkms are most used with ardunos the manual spec's 4.7K pull ups, thanks for the interesting reading. I'm going to be using a spare usb cable to provide power and i2c to the units [noparse]:)[/noparse]

    Brian Riley said...
    In the Arduino world (5 volt) they are pretty fond of 4.7K instead of 10K. I have used both values and see no difference. But one each on the SDA and SCL is all that is needed.

    2-3 feet is "by the book" .. I was on an OOPIC forum where guys there regularly approached 10 feet, but it had to in an electricly VERY quiet environment withe carefully selected cables. @todd ... 30 feet !!?? you must be in an electricly DEAD ZONE! wink.gif

    cheers ... BBR
  • RaymanRayman Posts: 15,003
    edited 2010-05-29 17:13
    I suppose smaller pullup resistances would work fine, maybe even better, provided all the chips on the bus are rated to sink the increased current...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
Sign In or Register to comment.