I've got my NANO based project working on a breadboard - its a simple reed switch and oLED display like this one:
and I've used two 4.7K pullup resistors across Vcc of the oLED and SDA and SCL. All working OK, but when I extend the oLED display cable to about 2m the screen becomes scrambled. I've checked the supply voltage and its 3.3v at the oLED so I think it must be something to do with the value of the pullups. Ive tried 10k but no joy and Im worried about damaging it.
So questions:
Is I2C distance limited?
What end of the cable should I put the pullups?
How to I calculate the best resistor value?
Also I'd like to eventually move this to a 3.3v based system (using an Ardulog) using the same cabling - how do I calculate what value pullup resistors to use?
There are lots of different transmission protocols than Serial, SPI, and I2C. Twisted pair cable is perfect for a differential signaling method, so you might want to look into RS-485.
For high speed long distance data transmission you have to move to using some sort of transmission line(*)
or use wireless.
(*) this means a cable with well defined characteristic impedance and proper termination, such as used
in wired ethernet, RS485, USB, RF coax, LVDS and probably many more schemes. You can also consider
waveguide and optic fibre as transmission lines of a more general kind too. This is an area where you can
no longer ignore Maxwell's equations to understand electronics - the lumped-component model doesn't work.
The pioneer behind transmission lines was Oliver Heaviside, who used his insights to make undersea
telegraph cables work at usable speeds (the same problem on a very different scale).
Standard I2C (100kHz) works well here 24/7 with more than 5meters of cat-6 in between.
Combined pull up resistance can be as low as ~1k8 (3mA) for standard I2C.
Clock and data must be separated (different pairs).
Leo..
Wawa:
Standard I2C (100kHz) works well here 24/7 with more than 5meters of cat-6 in between.
Combined pull up resistance can be as low as ~1k8 (3mA) for standard I2C.
Clock and data must be separated (different pairs).
Leo..
That's interesting - I stuck them in same twisted pair.
Yes, for long distance you'd assume anti-phase differential signalling with no net DC bias.
For instance ethernet does this with a 10/8 coding scheme (remove DC bias). The point is to
eliminate any common mode signal and to allow passage through transformers (which block
DC)
The problem with twisted pairs for I2C is that they have a much higher capacatance per foot than ribbon wire and it is the capacatance that ultimately limits the I2C distance.
Grumpy_Mike:
The problem with twisted pairs for I2C is that they have a much higher capacatance per foot than ribbon wire and it is the capacatance that ultimately limits the I2C distance.
Agreed (for short unterminated cables).
But cat-6 is only 53pF/meter, cheap, and maybe easier to get than 6-ribbon cable.
Standard I2C should stay under 400pF/3mA.
Leo..
2 feet? I'm using an OLED without pullups at a distance of around 5 feet. I'm using (and don't laugh) keyboard cable, which is highly shielded. I've tried cat5 and too much interference.
Yes that's right you don't know. Just because you have something that functions does not mean you have something that is correct and will work under all circumstances and is repeatable.
Have you examined the signal's clock edges rise and fall times?
Have you tested it over a range of temperatures?
Have you made more than one?
I suspect the answer to all question is no.
Two feet is what the standard was designed to cope with, for god sake look at the name, Inter Intergrated Circuit - does that not suggest on the same circuit board, not a remote bus?
I've sent 1Mbaud signals over >1km using audio screened balanced pairs - using the old Texas 75n108/110 drivers/ receivers - similar to RS485. Appropriately sourced and sunk in 120 ohms ( the characteristic impedance ) it worked fine.
Note : the characteristic impedance of a line is sqrt(L/C) - the L and C being per unit length.
And apart from resistive and dielectric losses, could be of infinite length.
Grumpy_Mike:
Two feet is what the standard was designed to cope with, for god sake look at the name, Inter Intergrated Circuit - does that not suggest on the same circuit board, not a remote bus?
Don't know where you got that "two feet" from. Never seen that in an I2C datasheet.
AFAIK 400pF/3mA is the basic standard.
That might well be two feet on a circuit board with ground planes and a dozen connected chips.
But that doesn't mean that you can't send signals more than two feet over a low capacitance cable.
Leo..