View previous topic :: View next topic |
Author |
Message |
hellmut.kohlsdorf
Joined: 04 Dec 2005 Posts: 9 Location: Mammendorf
|
Posted: Sun Jan 15, 2006 11:41 pm Post subject: Help with use of active termination for i2c |
|
|
I do plan to use the active termination circuitry offered in the help manual of my current 11.8.1 bascom avr to get best possible reliable i2c bus . My question:
Do I only use one active termination anywhere on my i2c bus,
or do i have to make sure that "active termination" is at one physical end of the i2c bus,
or do I have to have one active termination circuitry activated at each end of a physical i2c bus?
As I want to keep the freedom to distribute the i2c bus as required I would have to make the provision to have an active termination circuitry available on every card within my system?
I do see forward for your help
Rgds
Hellmut |
|
Back to top |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Mon Jan 16, 2006 12:52 am Post subject: |
|
|
I guess I would ask why you think you need active termination circuitry? Are you experiencing difficulties with bad data at the moment? Are you using an AVR that doesn't have hardware TWI or are you using alternate pins and, (therefore), Bascom's software I2C? How far (I2C cable length) are you trying to transfer this data? |
|
Back to top |
|
|
hellmut.kohlsdorf
Joined: 04 Dec 2005 Posts: 9 Location: Mammendorf
|
Posted: Tue Jan 17, 2006 6:25 pm Post subject: |
|
|
Hi DToolan
Very justified question, here the explanation:
I am building what I call a "swimming robot", a modell sailboat, 153cm long. This boat will contain 1x rn-control, expected 6x a custom build motorcontrol boards, 1x rn-motor. This number of devices, all interconnected on a single I2C bus of surely quiet a bit more than 2 meter length. All of this will go on top of the usual capacity load tolerated by the I2c bus. Of course, I will be using the hardware TWI of the mostly used device, the mega8. As the reliability is mission critical I have also considered using the I2c bus hub ICīs from Philips. But not to start too heavy I want to see if the active termination implemented with just 2 bc557b transistors and 5 resistors is enough. The option to use the hub IC would still remain open!
So back to my basic question: Is the "active bus termination" circuitry as listed in the bascom help manual required once in a i2c bus or once at each end?
Best regards
Hellmut |
|
Back to top |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Tue Jan 17, 2006 8:56 pm Post subject: |
|
|
Um... now that is a big model boat and 6 1/2 feet of I2C line is a good reason to consider active termination.
I have gone ~ 3 feet (75cm) with the usual I2C termination resistors but began experiencing intermittent data errors at and beyond that length. Termination (active or otherwise) should only be placed at the two farthest points along the bus. One would be at a usual point of origin (master transmitter), the other at the farthest distance away. I could go into the electrical reasoning, mathmatics and particulars behind bus termination but I won't... there is plenty of that on the internet.
I know, (for others who may be reading this), that many pre-built I2C modules have termination resistors on them and stringing a number of these together might pose no problem. I've done this too. For most applications (short line length), the differences this imparts upon the I2C bus displays no ill effect.
The I2c bus hub would work on the same principle as with other communication methods (ethernet, R2485, etc). All of these busses have a line length limitation. If you place an active "re-transmitter" at points along the bus, you overcome the standard limitation. For ethernet, this is every 330', for RS485, this can be every 3000', etc. Receiving and retransmitting the signal back and forth along the bus keeps the "two point / maximum line length" within specs. As you mention, Philips has a number of "bus extender" type chips with working distances up to 50 meters (supposedly).
I've not used the termination example shown in the Bascom help but I notice their "general practice / farthest distance" is 80cm. At one point, I considered the active termination but my problems went away with the use of hardware TWI. In the past, I've read about other "long line" methods of I2C use. As I recall, one application was for some guy's home weather station. That was a long time ago so I can't point you to a reference. Search Google for the word "I2C" and phrase "line length". You should find a lot of applicable threads. Sorry I couldn't be of more help.
Last edited by DToolan on Wed Jan 18, 2006 6:59 pm; edited 1 time in total |
|
Back to top |
|
|
hellmut.kohlsdorf
Joined: 04 Dec 2005 Posts: 9 Location: Mammendorf
|
Posted: Wed Jan 18, 2006 6:52 pm Post subject: |
|
|
Thanks for your advice. I am using a 10 pin connector for the i2c bus to stay compatible to the specs of a forum on robotics called www.roboternetz.de. So I will make a mini board with the active termination circuitry on it and connect it to the last sockets on each end of my i2c bus. This way I can keep my custom hardware design simple.
I got it right, one termination at each end!
Best regards
Hellmut |
|
Back to top |
|
|
sayang
Joined: 05 Jan 2005 Posts: 53
|
Posted: Thu Jan 19, 2006 11:02 am Post subject: |
|
|
I found that using shielded cable (microphone cable) helps as well, my I2C is 1.5m long and works ok with 4K7 resistors at the end of the cable. The shielding is connected on 1 side to the Gnd of the powersupply. I'm using hardware TWI @ 100Khz. |
|
Back to top |
|
|
hellmut.kohlsdorf
Joined: 04 Dec 2005 Posts: 9 Location: Mammendorf
|
Posted: Thu Jan 19, 2006 6:26 pm Post subject: |
|
|
Thanks sayang I will make the arrangements to support a shieded cable as you describe! I guess anything I do to improve the performance is key. |
|
Back to top |
|
|
AndyKron
Joined: 28 Apr 2005 Posts: 32 Location: Wisconsin, USA
|
Posted: Thu Jan 19, 2006 10:22 pm Post subject: Extending I2C |
|
|
If you still have trouble with line length an alternate method would be to use 2 Phillips PCA82C250 CAN controller interface chips connected to a Phillips P82B96 dual bidirectional bus driver on each end. It's more circuitry, but it works. As long as your boat is less than 1 Km long you should be ok. I have a sample schematic if you're interested.
-Andy _________________ If it works the first time you've done something wrong |
|
Back to top |
|
|
hellmut.kohlsdorf
Joined: 04 Dec 2005 Posts: 9 Location: Mammendorf
|
Posted: Fri Jan 20, 2006 9:56 pm Post subject: |
|
|
Hi Andy
Please do so. I will keep your proposal as a fall back safetyback. Philips also offers some devices to improve the length,but the prices of those devices make it prohibitive. I was specially fascinated about their i2c hub device. Building up a star topology froma center boat placement would secure that bus length could be controlled to keep trouble out. I see this as another fallback position as it could be added at a later time with only some effort to implement the "bus switching on the hub.
Best regards
Hellmut |
|
Back to top |
|
|
|