i2c capacitance

What people are working on at the moment
Post Reply
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#1 i2c capacitance

Post by ed »

I'm running a long line(5m) out to an i2c unit using cat5(only cable I've got with 4 wires at the mo). There are a few units on the same i2c bus. Does anybody know if there is a preferred way to use the cat5 for a 4 wire connection that minimises the capacitance?.
There's nowhere you can be that isn't where you're meant to be
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#2 Re: i2c capacitance

Post by Nick »

Off the top of my head I would have thought using one of each pair for each line would be better than using two signals over a pair. I am guessing two of the four are power lines that strictly speaking are not part of the bus, certainly the +ve one isn't, though of course a shared gnd is required (not that that helps).
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#3 Re: i2c capacitance

Post by ed »

mmmm

perhaps I'm over thinking this(as usual). My very first thought/idea was to use each twisted pair as 1 line...very simple and straightforward....then the brain kicked in and said but if you take the white out of the equation and connect all of the whites together and ground them at the processor end then it may behave like a pseudo balanced connection(prosumer method)...and then I thought ...stop thinking, just do it.....

I think I'll go with your suggestion and completely leave the whites out of it....

btw I'm not sure I entirely agree with your proposition about vcc not being part of the bus......won't the pull-up cloud the issue?
There's nowhere you can be that isn't where you're meant to be
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#4 Re: i2c capacitance

Post by Nick »

won't the pull-up cloud the issue?
No, the standard only says the line should be pulled up to 5v, it doesn't say it has to be the same 5v for all pull ups.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#5 Re: i2c capacitance

Post by ed »

This may only interest Nick, and maybe not even he now.....

it seems I wasn't far from somebody's solution in the first place......

I ran the distance test on site and the whole system locked as soon as I connected the long distance(3m) cat5....I took the 3m connection off and the system started working again.....

after more searching I found this:
https://hackaday.com/2017/02/08/taking- ... ong-wires/

seems my idea of grounding the whites at only one end might have some merit as it might mimic the shield as mentioned in the paragraph about 'shielded cable' in the solutions section...

in the mean time I'm going to take the pull-up as low as I dare cos without a booster it seems the only way to fend off the capacitance.

onward....pesky capacitance....it stalks me like a ghoul

edit:
I'm not entirely convinced by the internet details I've found so far because some sources say max cap for an i2c circuit must be 200pf and some say 400pf and then some sources say cat5 is 55pf per mtr and some say otherwise.....well if my 3m of cat5 is 150pf then it's inside all specs I've found so far....and then factor in what is said about the speed you run the line at and all bets are off. I'm running slow, i.e 100khz which should give the most leeway...but waddyaknow, it doesn't....onward onward
There's nowhere you can be that isn't where you're meant to be
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#6 Re: i2c capacitance

Post by Mike H »

I know sweet naff all about I²C except what t'Internet can tell me, but it comes up often that it's a short distance connection between circuit boards. Which makes me think it's not appropriate for what you're trying to do with it. (?)
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#7 Re: i2c capacitance

Post by Nick »

Mike H wrote: Mon Nov 19, 2018 12:34 pm I know sweet naff all about I²C except what t'Internet can tell me, but it comes up often that it's a short distance connection between circuit boards. Which makes me think it's not appropriate for what you're trying to do with it. (?)
No, but its much simpler if he can get it working than the alternatives that are balanced.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#8 Re: i2c capacitance

Post by ed »

I would certainly advise against basing any certain knowledge on what the internet tells you....blimey, it's only one step away from fake news.

The reality of i2c is that many people have reported achieving bullet proof bus lengths in excess of the 3m that I'm trying to achieve.

My take on this is that I'll bodge all the peripherals to take the in-built pull-ups out and try again with one pull-up at the cpu end. The spec does say at 100khz I should be safe at 400pf. With 3m of cat5 at 53pf per mtr that gives me a lot of leeway for stray capacitance in the system.

The trick is getting the pull-ups off the attached devices because all the cheap ebay devices have pull-ups in-built and if you are hanging more than a couple of devices off the bus then it causes problems.

If, after I've done this, I still have a problem then I'll have to put my hand in my pocket and buy a buffer/extender, which is the accepted way of stretching the bus line on i2c. This is valid for well into the hundreds of metres, but serious overkill for 3m.
There's nowhere you can be that isn't where you're meant to be
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#9 Re: i2c capacitance

Post by Mike H »

I'm always very sceptical about what I'm looking at on the net - I was looking at what is the basic I2C specifications, but anyway. YMMV
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#10 Re: i2c capacitance

Post by ed »

I know when I'm licked...

snigger

anyway I've given up with the digital light sensor and put my hand in my pocket(a whole £4.50) and bought an analog sensor. It has the same bandwidth but might require a bit of calibrating to get the same output as the digi version....

compromise is good isn't it?
There's nowhere you can be that isn't where you're meant to be
Post Reply