OUTPUT DRIVER CIRCUIT WITH CURRENT DETECTION

Abstract: The present invention provides an output driver circuit that can be used to determine whether a repeater buffer is the only device driving a bus low. According to the invention, the current through the output driver circuit (30) of the repeater buffer is compared with a reference current. If that current is greater than the reference current, then the output driver circuit (30) (i.e., the repeater buffer) is the only output driving the bus low. On the other hand, if that current is less than the reference current, then the output driver circuit (30) (and thus the repeater buffer) is not the only device driving the bus low. This information can be used in an I<2>C repeater to determine the proper response of the repeater and prevent a latch condition.

Description: Output driver circuit with current detection This invention relates to the field of electronics, and in particular to a device that facilitates the interconnection of devices using an I C interface. The Inter Integrated Circuit (I 2 C) bus is an industry standard bus interface developed by Philips Corporation, which allows integrated circuits to communicate directly with each other via a simple bi-directional 2-wire bus. Interfacing devices in an I 2 C based system can be achieved by directly connecting them to the two bus lines: a serial data line (SDA) for the communication of data, and a serial clock line (SCL) for the control and synchronization of the communication of data between the devices. Fig. 1 shows a block diagram of an I 2 C repeater 1 having one channel (SDA or SCL). In a typical I 2 C bus, another identical circuit as that in Fig. 1 is used for the other channel (SCL or SDA as the case may be). Repeater 1 is a device that allows separation of two I 2 C bus segments, segments A and B, by electrically isolating the two segments and repeating signals from one segment to the other. Each segment is of a wired-OR type. All devices on the bus are open-collector/open-drain devices and are only capable of driving the bus to a low state (about 0 volts). An external pull-up resistor pulls the bus high (about Vdd) when no device is driving it low. A main drawback with this type of repeater is that it can latch into a low state. For example, if segment A is driven low, repeater 1 will drive segment B low through buffer 10. This low on segment B caused by buffer 10 must not cause buffer 20 to drive segment A low; otherwise a latch condition will occur. Also, buffer 20 cannot be turned off because any device on segment B can drive segment B low, in which case buffer 20 must drive segment A low. Therefore, there is a need for a scheme that can effectively determine whether a repeater buffer, e.g., buffer 10, is the only device driving a bus low, so as to prevent any latch condition. The present invention provides an output driver circuit that can be used to determine whether a repeater buffer is the only device driving a bus low. According to the invention, the current through the output driver circuit is compared with a reference current. If that current is greater than the reference current, then the output driver circuit (and hence the repeater buffer) is the only output driving the bus low. On the other hand, if that current is less than the reference current, then the output driver circuit is not the only device driving the bus low. This information can be used in an I 2 C repeater to determine the proper response of the repeater and prevent a latch condition. According to a first embodiment of the present invention, an output driver circuit for connecting to a bus is provided. The circuit comprises a first output driver connected to the bus; a second output driver for generating a reference current; and a comparator, connected to the first and second output drivers, for comparing current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus. According to one aspect of the first embodiment of the invention, the first output driver includes a first resistor and a first transistor, and the second output driver includes a second resistor and a second transistor. According to another aspect of the first embodiment of the invention, the first resistor is slightly larger than the second resistor in value and the first and second transistor are substantially identical. According to a second embodiment of the invention, an output driver circuit for connecting to a bus is provided. The circuit comprises a parallel circuit including first and second paths, the first path for connecting to the bus; a transistor connected to the parallel circuit in series; and a comparator, connected to first and second paths, for comparing currents flowing through the two paths to determine whether there is an external device driving the bus. According to one aspect of the second embodiment of the invention, the first path includes first and second resistors, and the second path includes third and fourth resistors. According to another aspect of the second embodiment of the invention, the first path is a low impedance path, and the second path is a high impedance path. Furthermore, the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths. Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings. The invention is explained in further detail, and by way of example, with reference to the accompanying drawings wherein: Fig. 1 shows a block diagram of a standard I 2 C repeater having one channel; Fig. 2 illustrates an output driver circuit according to a first embodiment of the present invention; Fig. 3 shows the output driver circuit of Fig. 2 along with an additional device; Fig. 4 illustrates an output driver circuit according to a second embodiment of the present invention; and Fig. 5 shows the output driver circuit of Fig. 4 along with an additional device. Throughout the drawings, the same reference numerals indicate similar or corresponding features or functions. Fig. 2 illustrates an output driver circuit 30 according to a first embodiment of the present invention. Circuit 30 is the output stage of a buffer (e.g., buffer 10 or 20 in Fig. 1). For example, in the case of buffer 20, NoutA corresponds to the voltage at bus segment A in Fig. 1. In the case of buffer 10, NoutA corresponds to the voltage at bus segment B in Fig. 1. In Fig. 2, circuit 30 comprises an output driver 32, a replica driver 34, and a comparator 36 in the form of an op-amp, for example. Output driver 32 includes a drain resistor Rl and an ΝMOS transistor Ql. Replica driver 34 includes a drain resistor R2 slightly less than Rl and an ΝMOS transistor Q2 identical to Ql. Replica output driver 34 is used for generating a reference current, as will be discussed below. When the gate voltage (at node gtl) of transistors Ql and Q2 goes high, both the transistors will turn on and pull their outputs low. As the output goes low, the drain- source voltage of each transistor becomes less than the gate-source voltage and will enter into the linear region of operation, thus behaving like a resistor. Since the transistors Ql and Q2 are identical and have identical gate-source voltages they will tend to have identical behavior and identical resistance values. This resistor behavior improves as the drain-source voltage decreases. Therefore, the current through transistors Ql and Q2 will be identical if they have identical loads, assuming that the resistance values of the two transistors are identical. Loads for the transistor Ql are Rl and Rxl while the loads for transistor Q2 are R2 and Rx2. Load resistors Rxl and Rx2 are chosen to be identical. By selecting R2 < Rl, a slightly different current will flow through transistors Ql and Q2. This current difference is measured as a voltage difference across resistors Rl to ground and R2 to ground. When output driver circuit 30 is the only device driving the bus low, the voltage NoutA seen at Rl will be greater than the voltage NsamA at R2. This voltage difference is detected by comparator 36. Thus, when node gtl goes high, the output of comparator 36 also goes high, indicating that output driver circuit 30 (i.e., the buffer) is the only output device driving the bus. If the output driver circuit 30 is not the only device driving the bus low because of an additional device 50 as illustrated in Fig. 3, less current will flow through Rl and the voltage seen NoutA at Rl will be less than the voltage VsamA at R2. This voltage difference is also detected by comparator 36. The change in voltage at Rl due to current sharing on the bus is used to determine if output driver circuit 30 (and thus the repeater buffer) is the only device driving the bus. Thus, in Fig. 3, when node gtl goes high while node gt3 is still low, it indicates that output driver circuit 30 (i.e., the buffer) is the only device driving the bus low and the output of comparator 36 is high. When nodes gtl and gt3 both go high, it indicates that there is an additional device 50 driving the bus low, and the output of comparator 36 goes low. Fig. 4 shows an output driver circuit 60 according to a second embodiment of the present invention. Like circuit 30, circuit 60 is the output stage of a buffer (e.g., buffer 10 or 20 in Fig. 1). Similarly, in the case of buffer 20, VoutAl corresponds to the voltage at bus segment A in Fig. 1. In the case of buffer 10, VoutAl corresponds to the voltage at bus segment B. In Fig. 4, circuit 60 comprises a parallel circuit 62, an ΝMOS transistor Q4 and a comparator 66. Parallel circuit 62 includes two paths: path 1 and path 2. The current through output transistor Q4 is divided between the two paths. The currents through these paths are compared in the form of voltage drops by comparator 66 to determine if output driver circuit 60 (i.e., the buffer) is the only device pulling the bus (i.e., VoutAl) low. When transistor Q4 is ON, the drain current of Q4 is the sum of the currents through the two paths. Path 1 is a low impedance path including resistors Rla and Rib. Path 2 is a high impedance path including resistors R2a and R2b. In a specific example, Rla and Rib each have a value of 20 ohms, and R2a and R2b each have a value of 10 kohms. The resistors in path 2 need not be equal in value to create a fixed voltage offset for comparator 66. In this fashion, when output drive transistor Q4 is ON and output driver circuit 60 (i.e., the buffer) is the only device driving the bus low, the current through Rla is equal to the current through Rib and a voltage level VsamAl at Rla is set. Since the current through R2a always equals the current through R2b, these two resistors can be scaled such that the voltage VsamAl at R2a is lower than the voltage at Rla VoutAl. Thus, when node gt4 goes high, the output of comparator 66 goes high, indicating that output driver circuit 60 (i.e., the buffer) is the only output device driving the bus. When another device 80 is also driving the bus low as shown in Fig. 5, the current through Rib is greater than the current through Rla. This will cause the voltage level VsamAl at Rla to drop below the level, VoutAl, set at R2a, which can be detected by comparator 66, as shown in Fig. 5. This change in voltage at Rla due to current sharing on the bus is used to determine if output driver circuit 60 (i.e., the buffer) is the only device driving the bus. Thus, in Fig. 5, when node gt4 goes high while node gt5 is still low, it indicates that output driver circuit 60 (and thus the buffer) is the only device driving the bus low and the output of the comparator 66 is high. When nodes gt4 and gt5 both go high, it indicates that there is an additional device 80 driving the bus low and the output of comparator 66 goes low. While the invention has been described in conjunction with specific embodiments, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended to embrace all such alternatives, modifications and variations as fall within the spirit and scope of the appended claims.

Claims: CLAIMS: 1. An output driver circuit (30) for connecting to a bus, comprising: a first output driver (32) connected to the bus; a second output driver (34) for generating a reference current; and a comparator (36), connected to the first and second output drivers, for comparing current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus. 2. The circuit of claim 1 , wherein the first output driver includes a first resistor (Rl) and a first transistor (Ql); and wherein the second output driver includes a second resistor (R2) and a second transistor (Q2). ( 3. The circuit of claim 2, wherein the first resistor is slightly different than the second resistor in value and the first and second transistor are substantially identical. 4. The circuit of claim 3, wherein the first resistor is slightly larger than the second resistor in value. 5. The circuit of claim 1, wherein the bus is an I C bus. 6. A method, comprising the steps of: connecting a first output driver to a bus; generating a reference current using a second output driver; and - comparing, with a comparator, current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus. 7. The method of claim 6, wherein the first output driver includes a first resistor and a first transistor; and wherein the second output driver includes a second resistor and a second transistor. 8. The method of claim 7, wherein the first resistor is slightly larger than the second resistor in value and the first and second transistor are substantially identical. 9. The method of claim 6, wherein the bus is an I 2 C bus. 10. An output driver circuit (60) for connecting to a bus, comprising: a parallel circuit (62) including first and second paths, the first path for connecting to the bus; a transistor (Q4) connected to the parallel circuit in series; and a comparator (66), connected to first and second paths, for comparing currents flowing through the two paths to determine whether there is an external device driving the bus. 11. The circuit of claim 10, wherein the first path includes first and second resistors (Rla, Rib); and wherein the second path includes third and fourth resistors (R2a, R2b). 12. The circuit of claim 11 , wherein the first path is a low impedance path; wherein the second path is a high impedance path. 13. The circuit of claim 11 , wherein the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths. 14. The circuit of claim 10, wherein the bus is an I 2 C bus. 15. A method, comprising the steps of: connecting a first path of a parallel circuit to a bus, the parallel circuit also including a second path; connecting a transistor to the parallel circuit in series; and comparing, with a comparator, currents flowing through the two paths to determine whether there is an external device driving the bus. 16. The method of claim 15 , wherein the first path includes first and second resistors; and wherein the second path includes third and fourth resistors. 17. The method of claim 16, wherein the first path is a low impedance path; wherein the second path is a high impedance path. 18. The method of claim 16, wherein the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths,. 19. The method of claim 15 , wherein the bus is an I If C bus

Inventors: ANDERSON ALMA S, ANDREWS PAUL H, ANDERSON, ALMA, S., ANDREWS, PAUL, H.
Applicants: KONINKL PHILIPS ELECTRONICS NV, KONINKLIJKE PHILIPS ELECTRONICS N.V.
Application year: 2001
Main classification: H04L25
IPC codes: H03K17, H03K19, H04L25