PDA

View Full Version : I need advice from propeller/i2c experts :)



FireHopper
05-29-2010, 02:34 AM
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 :)

Rayman
05-29-2010, 02:41 AM
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 Chap
05-29-2010, 03:40 AM
Not to contradict the I2C standard, but I routinely use lengths up to 30 feet and have never experienced a problem.

Rayman
05-29-2010, 04:10 AM
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

Tubular
05-29-2010, 04:47 AM
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 Riley
05-29-2010, 04:57 AM
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! http://forums.parallax.com/images/smilies/wink.gif

cheers ... BBR

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/ (http://www.wulfden.org/TheShoppe/)
www.wulfden.org/TheShoppe/prop/ (http://www.wulfden.org/TheShoppe/prop/) - Propeller Products
www.wulfden.org/TheShoppe/k107/ (http://www.wulfden.org/TheShoppe/k107/) - Serial LCD Display Gear

T Chap
05-29-2010, 05:13 AM
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

localroger
05-29-2010, 06:17 AM
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.

Ravenkallen
05-29-2010, 08:09 AM
@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

FireHopper
05-29-2010, 06:04 PM
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 :)



Brian Riley said...

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! http://forums.parallax.com/images/smilies/wink.gif

cheers ... BBR

Rayman
05-30-2010, 01:13 AM
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