i2c and long wires

matt t

New Member
hi,

i know youve all seen this knid of thing beforeso ill keep it breif, i think i need to extend the rang of my bus, my srf008 's worked on short wires for testing, have connected them to the vehicle on the full length wires and no joy. I have lloked through all the past posts and found some good links and i think i need to slow down to I2cslow (167 i think since it is a 28x1 and it doesnt work on them?) i already have 2k8 pull ups, how much current will the transistors in the pic handle and what voltage? some will apparently handle 12v and 15mA which increases range a lot what will pic do? Do i need to increase the value and spread them around, putting one next to each device? If i was to use ferrite beads what value do you think would be good? had a look at galvanic isolators and they look a bit serious. Has anybody got any experience with a bus extender/driver?

Thanks

Matt
 

BCJKiwi

Senior Member
Check out the options here;
http://www.i2cchip.com/i2c_connector.html#Bus%20Length

How long a bus are you trying to achieve? - there is a practical limit.

A scope will show you the wave form.
Lower R pull ups are aimed at higher bus speeds - not getting more distance.
What you will see on the scope is that a lower R allows the cap to charge quicker this switches the bus from low to high faster. Normally it takes a little less than half the period for the wave form to steady at the high level.

Cabling is the main issue with distance as propagation delay, RF and interference are the killers.

There is a good discussion on cable issues/options at the link above. There are Cable extenders but they come at a cost.
 
Last edited:

andrewpro

New Member
what kind of cable are you using? a change in that may help you pull this off.

It's the total bus capacitance you have to manage. Category cable is usually about 15pf/foot... I dont remember what the total capacitance allowed on the bus is, but it'll let you go 19 feet at least at 100khz (I've done that).

Personally, I'd use a buffer chip. There are some that will let you stretch the bus capacitance to 1000pf or more. They're not expensive, but using them could be. usually it's only available in surface mount packages, which means you'll need an adapter board or a custom pcb.

If it's accessible, I'd try different cabling after I tried slowing things down. If after that you get no joy, get a buffer chip.

--Andy P
 

matt t

New Member
problem solved!

Hi,

Ive been fidddling today and traced the problem back to a goosed transistor in one of my picaxe chips, remoed it and it works fine, interesting thing is i wired it originally without any thought for the capacitance of the circuit and must have 10 metres of standard 1mm copper wire on it and it works no trouble, surely it shouldnt work at all?!
 

hippy

Ex-Staff (retired)
What theory says and what reality delivers are often two different things. I've seen buses with such bad slewing, distortion and ringing that it's impossible to believe they would work when they do and at the opposite end of things where the smallest imperfection has stopped something working.

A lot depends on transition time between logic levels and I would expect most I2C devices to have been designed to expect the bus signals to be 'horrible' and more resistant to slewing and distortion than other devices may be.

Glad to hear you've located and solved your problem.
 
Top