I²C - Chapter 5
Q&A section
Q - What is the maximum distance of the bus ? A - This depends on the load of the bus and the speed you run it at. In typical applications a few meters (3 to 4). Better: The maximum capacitive load has been specified (electrical Spec.'s in this FAQ). If you run at a lower clock frequency then you could go further. If you are careful in routing your PCB's and cabling then you can take it further.I once had an application that had a total of about 100 meter cable in it. The entire system was clocked on something like 500 Hz. I used twisted pair cable and twisted SCL with GND and SDA with VCC. No problem.The systems is now up and running for over 2 years. Q - I want to extend it ''by the book''. Is there something like a Buffer for I²C ? A - Yes indeed this exists. Philips manufactures a special chip to buffer the bi-directional lines of the I²C bus. Typically this is a current amplifier. What it does is force current into the wiring (a couple of mA). That way you can overcome the capacitance of long wiring. Type : P82B715 Q - Can I isolate an I²C bus ? (using opto-coupler or whatever) A - This is possible. The circuit is rather complex due to the bi-directional nature of the I²C BUS. However : Here it comes (for once channel). ------------o----------- ---------o------------------- VCC ! ! ! ! VCC ! ! ! ! ! 3K3 ! 270 ! ! 270 ! ! 3K3 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! _______o____ ! !C ! ! ! ! ! ! / o______o_____ ! ! OL1--- ! ! --/ !/ OT1 ! ! ! 1K8 ! ! \ / ! ! /--> B!\ ! ! ! ! ! --- ! ! ! \E !C ! ! ! ! ! ! ! ! / ! ! ! ! !E ! ! o___B!/ NPN ! ! ! 1K8 ! ! / ! ! ! !\ ! ! ! _____o__B!/ ! ! ! ! \ ! ! !\ ! C ! ! !E ! ! SDA ! \ C ! \ !B ! ! ! ! or ! ! OT2 \! \-- ! ! OL2 --- ! SCL PNP ! ! /! <--\ ! ! \ / ! ! C ! E / ! ! ! --- ! ! \ !B ! ! ! E! ! SDA or ! \!____o ! ! \ ! ! SCL ! NPN /! ! ! ! ! PNP \!__o______ ! / ! ! ! ! !1K ! /!B ! E ! ! ! 1K ! ! ! / ! ! ! ! ! ! ! C! ! ! ! ! ! ! GND ! ! ! ! ! ! GND -----------o----o------- -------o------o------------ OT1 and OL1 are part of one opto-coupler. OT2 and OL2 are the other opto-coupler. A couple of remarks. Since the speed of the I²C bus can be rather high it is recommended to use a fast opto-coupler. A 6N139 will do the job in all cases. The 2 PNP and 2 NPN transistors can be any standard type. Like 2N2219 and 2N2222 (USA) or BC547 and BC557 (EUROPE). How does it work ? The problem with bi-directional lines is that a buffer tends to get stuck on a certain level. In the above schematic this has been dealt with. In the following explanation we assume that the left side is transmitting and the right side is receiving.Since the circuit is symmetrical you could do it the other way around too. Suppose you send a logic 1 into the left side. The OL1 will stay dark. Since OT1 does not receive any light it is not turned on. The next transistor does not get driven and the line at the end is being pulled high by the 270 ohm and 1K8 resistor. The PNP transistor will not get driven. OL2 will not light. So OT2 does not get driven.So far so good. Now lets look what will happen if we send a 0. The first transistor will be turned on. Thus OL1 will start emitting light.This results in the fact that OT1 will be turned on. The transistor connected to the Emitter of OT1 will be turned on too. The output line is now being pulled low via the 1K8 resistor. This low level would turn on the PNP transistor . This would result in OL2 to high, OT2 to turn on etc .. The circuit would go into a lockup. But since the NPN transistor is pulling the Anode of the led to ground this will not happen. In this way we have eliminated the deadlock. Q - What if I don't want to emulate the bus by software or if I don't have an I²C interface on my system ? Is there something like an I²C controller ? A - Yes indeed. There is a special chip to do the I²C interfacing. The PCD8584 or PCF8584 incorporate a complete I²C interface. These chips are designed in such way that they can interface to almost any microcontroller or computer around.
Back to the topNext
chapter
Previous chapter
Index