Apparatus for supporting I2C bus masters on a secondary side of an I2C multiplexor

Information

  • Patent Grant
  • 6816939
  • Patent Number
    6,816,939
  • Date Filed
    Thursday, May 9, 2002
    22 years ago
  • Date Issued
    Tuesday, November 9, 2004
    20 years ago
Abstract
An apparatus for supporting I2C bus masters on a secondary side of an I2C mulitplexor is disclosed. An electronic system includes a primary serial bus, multiple secondary serial buses, an expander, multiple direction latches, a multiplexor, multiple busy detect circuits, and a to-from multiplexor circuit. The expander, which is coupled to the primary serial bus, includes multiple outputs that can be selectively activated. Each of the direction latches is coupled to a respective one of the outputs of the expander. The multiplexor, which is coupled to the direction latches, includes several outputs connected to the secondary serial buses such that the secondary serial buses can be selectively connected to the primary serial bus. Each of the busy detect circuits is coupled to a respective one of the outputs of the multiplexor. The busy detect circuits detects if there is a transaction occurring on one of the outputs of the multiplexor. In response to a transaction occurring on one of the outputs of the multiplexor, the to-from multiplexor circuit selects one of the busy detect circuits that is involved in the transaction in order to allow one of the direction latches to latch at a correct time such that any bus corruption on the secondary serial buses can be avoided.
Description




BACKGROUND OF THE INVENTION




1. Technical Field




The present invention relates to a primary serial bus coupled to multiple secondary serial buses in general, and in particular to an I


2


C primary bus coupled to multiple secondary I


2


C buses. Still more particularly, the present invention relates to an apparatus for supporting I


2


C bus masters on a secondary side of an I


2


C mulitplexor.




2. Description of the Related Art




An inter-integrated circuit (I


2


C) bus is a well-known industry standard serial bus for interconnecting various integrated circuit devices within a data processing system. A standard I


2


C bus includes two lines, namely, an SDA line and an SCL line. The SDA is for transmitting start, address, data, control, acknowledge and stop information, and the SCL line is for carrying a clock signal.




Generally speaking, a bus master transmits a start bit followed by 8 bits—7 address bits and 1 read/write bit. Of the 7 address bits, 4 bits are preprogrammed by a chip manufacturer, and the remaining 3 bits are typically programmed by a system manufacturer. Because the chip manufacturer pre-programs the most significant 4 bits of a 7-bit address, leaving only 3 programmable address bits for the system manufacturer, an electronic system is usually limited to having a maximum of 2


3


(i.e., 8) of the same type of chip connected to any one I


2


C bus.




Following the transmission of the address and read/write bits, the addressed bus slave responds with an acknowledge (ACK) bit. Next, the bus master transmits 8 bits of data, which is again followed by the transmission of an ACK from the bus slave. The pattern of 8 data bits followed by an ACK bit can be repeated until all data has been transmitted. The transmission can be terminated at any time via a transmission of a stop bit.




Bus loading is a limitation as to the total number of devices that can be coupled to any one bus. Because of bus loading and the intrinsic inability to address more than 8 of the same type of chip on any one I


2


C bus, system manufacturers have previously incorporated more than one I


2


C bus, and there are two general approaches to interconnect multiple I


2


C buses within an electronic system.




The first approach is to use multiple primary I


2


C buses, each with its own controller. Although the first approach solves the problems of bus loading and address availability, it requires additional I


2


C controllers that are usually the most expensive device in an electronic system having an I


2


C bus. In addition, the requirement of running multiple primary I


2


C buses through many connectors and interfaces adds cost and, in some cases, is not possible because of the limited pin count of the connectors and interfaces.




The second approach is to use one primary I


2


C bus multiplexed with two or more secondary I


2


C buses, but controlled separately from any of the secondary I


2


C buses. The second approach is an improvement over the first approach because it does not require additional controllers and it is not constrained to run through multiple connectors and interfaces. However, a separate mechanism must be set up to control the multiplexing. In addition, since the primary I


2


C bus is switched under the second approach, it must be controlled from a different primary I


2


C bus; otherwise, data loss and signal quality degradation will occur. The need for more than one primary I


2


C bus limits the total benefits of the second approach.




Furthermore, the original I


2


C mulitplexor was generally lacking support for multiple bus masters on the secondary side of the I


2


C mulitplexor. If an I


2


C bus master was placed on the secondary side of the I


2


C mulitplexor, a bus collision might occur if there was master activity on the secondary side and the I


2


C mulitplexor were switched to that particular secondary I


2


C bus. A straight-forward solution to the above-mentioned problem is to remove the offending secondary I


2


C bus master, but a better solution is preferred.




The present disclosure provides an improved method and apparatus to support I


2


C bus masters on a secondary side of an I


2


C mulitplexor.




SUMMARY OF THE INVENTION




In accordance with a preferred embodiment of the present invention, an electronic system includes a primary serial bus, multiple secondary serial buses, an expander, multiple direction latches, a multiplexor, multiple busy detect circuits, and a to-from multiplexor circuit. The expander, which is coupled to the primary serial bus, includes multiple outputs that can be selectively activated. Each of the direction latches is coupled to a respective one of the outputs of the expander. The multiplexor, which is coupled to the direction latches, includes several outputs connected to the secondary serial buses such that the secondary serial buses can be selectively connected to the primary serial bus. Each of the busy detect circuits is coupled to a respective one of the outputs of the multiplexor. The busy detect circuits detects if there is a transaction occurring on one of the outputs of the multiplexor. In response to a transaction occurring on one of the outputs of the multiplexor, the to-from multiplexor circuit selects one of the busy detect circuits that is involved in the transaction in order to allow one of the direction latches to latch at a correct time such that any bus corruption on the secondary serial buses can be avoided.




All objects, features, and advantages of the present invention will become apparent in the following detailed written description.











BRIEF DESCRIPTION OF THE DRAWINGS




The invention itself, as well as a preferred mode of use, further objects, and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:





FIG. 1

is a block diagram of an electronic system having an I


2


C bus, in accordance with a preferred embodiment of the current invention;





FIG. 2

is a detailed block diagram of the I/O expander, direction latches and multiplexor from

FIG. 1

, in accordance with a preferred embodiment of the present invention;





FIG. 3

is a detailed block diagram of the busy detect circuits from

FIG. 1

, in accordance with a preferred embodiment of the present invention;





FIG. 4

is a detailed block diagram of the to-from multiplexor circuit from

FIG. 1

, in accordance with a preferred embodiment of the present invention;





FIG. 5

is a block diagram of a switch done circuit in accordance with a preferred embodiment of the present invention;





FIG. 6

is a block diagram of an electronic system having an I


2


C bus, in accordance with an alternative embodiment of the current invention; and





FIG. 7

is a detailed block diagram of the busy select circuit from

FIG. 6

, in accordance with a preferred embodiment of the present invention.











DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT




Referring now to the drawings and in particular to

FIG. 1

, there is depicted a block diagram of an electronic system having an I


2


C bus, in accordance with a preferred embodiment of the current invention. As shown, an electronic system


10


includes an I


2


C bus controller


11


, an I/O expander


12


, two direction latches


13




a


-


13




b


, a multiplexor


14


, four busy detect circuits


15




a


-


15




d


, and a to-from multiplexor circuit


16


. I


2


C bus controller


11


includes an SDA port and an SCL port connected, respectively, to a Primary SDA (PSDA) line and a Primary SCL (PSCL) line of a primary I


2


C bus P. Similarly, I/O expander


12


includes an SDA port and an SCL port connected, respectively, to the PSDA and PSCL lines of the primary I


2


C bus P. Outputs I/O


0


and I/O


1


of I/O expander


12


are connected, respectively, to an input of a direction latch


13




a


and an input of a direction latch


13




b


. The outputs of direction latch


13




a


and direction latch


13




b


are connected to multiplexor


14


. Multiplexor


14


provides four sets of secondary I


2


C bus, namely, S


1


, S


2


, S


3


and S


4


. Multiplexor


14


is used to selectively connect the primary I


2


C bus P to one of the four sets of secondary I


2


C bus S


1


through S


4


. Each set of secondary I


2


C bus, which includes an SDA line and an SDL line, is connected to a respective one of busy detect circuits


15




a


-


15




d


. To-from mulitplexor circuit


16


combines the outputs of busy detect circuits


15




a


-


15




d


to generate a MUX_CLK signal.




With reference now to

FIG. 2

, there is illustrated a detailed block diagram of I/O expander


12


, direction latches


13




a


-


13




b


and multiplexor


14


, in accordance with a preferred embodiment of the present invention. I/O expander


12


, such as the Philips PCF8574 or PCA9557, is an I


2


C slave device. I/O expander


12


includes an I


2


C bus interface and 8 output ports (only ports P


0


and P


1


are shown). A


0


, A


1


and A


2


inputs of I/O expander


12


are connected to either V+ or ground to set the lower order address bits of I/O expander


12


. As mentioned previously, the four high-order address bits of an I


2


C bus device are pre-programmed by a chip manufacturer and are not available for programming by a system designer. Thus, I/O expander


12


, like other I


2


C bus devices, responds to a 7 bit address directed to I/O expander


12


over the primary I


2


C bus P, with the three least significant bits being set by the system manufacturer and the four most significant address bits being pre-programmed by the chip manufacturer. When a transaction is sent to I/O expander


12


, the 8 output ports mirror the byte of the transaction that was sent to I/O expander


12


(most significant bit first). In the present invention, the two least significant bits (from ports P


0


and P


1


) are defined as the select lines, namely, MUX_SEL_


0


and MUX_SEL_


1


, for multiplexor


14


. MUX_SEL_


0


is connected to an input D of direction latch


13




a


, and MUX_SEL_


1


is connected to an input D of direction latch


13




b.






The output ports P


0


and P


1


of I/O expander


12


transition during an ACK cycle of a write transaction to I/O expander


12


. This behavior is critical. Since the MUX_CLK signal goes high on a STOP condition, MUX_SEL_


0


and MUX_SEL_


1


must be valid at direction latch


13




a


before the STOP occurs. Optionally, a SWITCH_DONE signal may be driven into I/O expander


12


to allow the system to read the status of the switch event.




Direction latches


13




a


-


13




b


are preferably D-type flip-flops. The output of direction latch


13




a


is LATCHED_MUX_SEL_


0


, and the output of direction latch


13




b


is LATCHED_MUX_SEL_


1


. The outputs of direction latch


13




a


-


13




b


are respectively connected to the select inputs A and B of multiplexor


14


. A RESET_N signal is connected to a preset input (PRE) of each of direction latches


13




a


-


13




b


. The clock inputs of direction latches


13




a


-


13




b


are driven by a MUX_CLK signal to ensure that mulitplexor


14


will only change when there is no activity on the monitored I


2


C buses. Direction latches


13




a


-


13




b


latch MUX_SEL_


0


and MUX_SEL_


1


after an IDLE condition is detected on the secondary I


2


C buses.




Multiplexor


14


, which is preferably a FET switch multiplexor (a quickswitch multiplexor) such as a Quality Semiconductor QS3257, connects primary I


2


C bus P to one or more sets of secondary I


2


C buses. In the present embodiment, multiplexor


14


connects one primary I


2


C bus P to four sets of secondary I


2


C buses S


1


-S


4


. Since multiplexor


14


is a FET switch, data can travel in a bidirectional manner across the FET switch. Multiplexor


14


has two input ports, namely, input port


1


Y and input port


2


Y. Multiplexor


14


's port


1


Y is connected to a separate SDA line from each of the secondary I


2


C buses. Similarly, multiplexor


14


's port


2


Y is connected to a separate SCL line from each of the secondary I


2


C buses. In this way, each of the secondary I


2


C buses can be switched to the primary I


2


C bus by a single device. The outputs of multiplexor


14


are connected with the lowest numbered secondary I


2


C bus occupying the lowest port number. For example, SDA


1


is connected to output


1


C


0


, and SCL


1


is connected to output


2


C


0


. The select inputs A and B of multiplexor


14


are connected to the outputs of the direction latch so that the direction of multiplexor


14


will change only when the “to” and “from” I


2


C buses transition to IDLE. Port Enable inputs on multiplexor


14


are connected to GND in order to force the ports on.




Referring now to

FIG. 3

, there is depicted a detailed block diagram of busy detect circuit


15




a


, in accordance with a preferred embodiment of the present invention. As shown, busy detect circuit


15




a


is an asynchronous state machine that includes four Schmitt-triggered NAND gates


31


-


34


and one inverter


35


. Busy detect circuit


15




a


determines if there is an activity, such as a transaction, on one of the secondary I


2


C buses.




When RESET_N=0, SCL=1, and SDA=1, the output of busy detect circuit


15




a


becomes 0, which corresponds to an initial RESET condition where no activity is on the I


2


C primary bus. The initial RESET condition initializes the state machine to a known good state and a well-defined output. Transitions on SCL and SDA when RESET_N=0 are allowed as long as the attached I


2


C bus is in an IDLE state when the rising edge of RESET_N occurs. SCL and SDA must be in a logical high state sufficiently long enough to allow busy detect circuit


15




a


(i.e., the state machine) to settle before the rising edge of RESET_N. Once out of RESET, busy detect circuit


15




a


drives the output (i.e., BUSY


1


) to a logical high when an START condition is detected and drive BUSY low when an STOP condition is detected. Busy detect circuit


15




a


will handle I


2


C REPEATED START conditions by continuing to drive a BUSY signal high.




Although only busy detect circuit


15




a


is illustrated in

FIG. 3

, it is understood busy detect circuits


15




b


-


15




d


are identical to busy detect circuit


15




a


, with the exception of input and output signals. In

FIG. 1

, each of busy detect circuit


15




a


-


15




d


is connected to a respective set of SCL and SDA lines of a secondary I


2


C bus. In an electronic system that supports more secondary I


2


C buses, a busy detect circuit would be attached to each of those additional buses. The RESET_N from each of busy detect circuits


15




a


-


15




d


is bused together and driven low when the electronic system is being powered up. The system designer must make sure that the I


2


C buses are in an IDLE state before RESET_N is driven high. The system designer may also want to toggle RESET_N when the system power is already good. This behavior is supported as long as all the previously stated reset conditions are met.




With reference now to

FIG. 4

, there is depicted a detailed block diagram of to-from multiplexor circuit


16


, in accordance with a preferred embodiment of the present invention. As shown, to-from multiplexor circuit


16


includes two 1×4 multiplexors


41


and


42


. The outputs of busy detect circuits


15




a


-


15




d


are connected to a respective input of multiplexors


41


and


42


. Busy detect circuits


15




a


-


15




d


are connected to multiplexors


41


and


42


in such a fashion as the lowest order busy detect circuit is connected to the lowest order input on multiplexors


41


and


42


. In this example, the output of busy detect circuit


15




a


(i.e., BUSY


1


) is connected to input


0


of multiplexors


41


and


42


. The select lines of multiplexor


41


are driven directly by the outputs of I/O expander


12


(i.e., MUX_SEL_


0




1


and MUX_SEL





1). The select lines of multiplexor


42


are driven by the outputs of direction latches


13




a


and


13




b


(i.e., LATCHED_MUX_SEL_


0


and LATCHED_MUX_SEL_


1


). The outputs of multiplexors


41


and


42


are combined by a logical NOR gate


43


to form a MUX_CLK signal to be used as a latch control for direction latches


13




a


and


13




b


.




The function of to-from multiplexor circuit


16


is to select the two I


2


C buses that will be monitored during a bus switch. In other words, to-from multiplexor circuit


16


selects the proper busy detect circuits involved in a transaction. Since to-from multiplexor circuit


16


selects inputs that are driven directly from I/O expander


12


, it will pass the BUSY signal that corresponds to the I


2


C bus to which the present invention intends to switch. Likewise, to-from multiplexor circuit


16


passes the BUSY signal that corresponds to the I


2


C bus from which the present invention intends to switch. Thus, during operation, MUX_CLK signal is high when no activity exists on either the “to” or “from” I


2


C secondary bus. MUX_CLK signal is low when activity occurs on either the “to” or “from” I


2


C secondary bus. In this way, the rising edge of MUX_CLK signal will signify that both I


2


C buses have become IDLE.




Referring now to

FIG. 5

, there is illustrated a switch done circuit in accordance with a preferred embodiment of the present invention. As shown, a switch done circuit


50


, which preferably includes two XOR gates


51


-


52




51


-


52


and a NOR gate


53


, provides a SWITCH_DONE signal to notify external circuitry that a switch has been completed. The parts are connected in such a way as to drive a SWITCH_DONE signal low when the multiplexor select lines (i.e., MUX_SEL_


0


and MUX_SEL_


1


) differ from the latched multiplexor select lines (i.e., LATCHED_MUX_SEL_


0


and LATCHED_MUX_SEL_


1


), and to drive the SWITCH_DONE signal high when the multiplexor select lines are the same as the latched mulitplexor select lines.




With reference now to

FIG. 6

, there is illustrated a block diagram of an electronic system having an I


2


C bus, in accordance with an alternative embodiment of the current invention. As shown, an electronic system


60


includes an I


2


C bus controller


61


, an I/O expander


62


, two direction latches


63




a


-


63




b


, a multiplexor


64


, five busy detect circuits


65




a


-


65




e


, and a busy select circuit


66


. Electronic system


60


is very similar to electronic system


10


from

FIG. 1

, with the addition of a fifth busy detect circuit and a busy select circuit. Each set of secondary I


2


C buses, which includes an SDA line and an SDL line, is connected to a respective one of busy detect circuits


65




a


-


65




d


. Busy detect circuit


65




e


is connected to primary I


2


C bus P. Busy select circuit


66


combines the outputs of busy detect circuits


65




a


-


65




e


to generate a MUX_CLK signal.




Referring now to

FIG. 7

, there is depicted a detailed block diagram of busy select circuit


66


, in accordance with a preferred embodiment of the present invention. As shown, busy select circuit


66


includes a 1×4 multiplexor


71


and a NOR gate


72


. The outputs of busy detect circuits


65




a


-


65




e


are connected to the inputs of multiplexor


71


. Busy detect circuits


65




a


-


65




e


are connected to multiplexor


71


in such a fashion as the lowest order busy detect circuit is connected to the lowest order input on multiplexor


71


. The select lines of multiplexor


71


are driven directly by the outputs of I/O expander


62


(i.e., MUX_SEL_


0


and MUX_SEL_


1


). The output of multiplexor


71


is combined with a BUSY


5


signal from busy detect circuit


65




d


via NOR gate


72


to form a MUX_CLK signal to be used as a latch control for direction latches


63




a


and


63




b


from FIG.


6


.




The following is an example of the use of the present invention. An electronic system, such as electronic system


10


in

FIG. 1

, has one primary I


2


C bus (I


2


C_


0


) and eight secondary I


2


C buses (I


2


C_


1


-I


2


C_


8


). The I


2


C





5 bus is attached to a backplane of a direct access storage device (DASD) having a SCSI support chip, an EEPROM and three thermal sensors. The DASD backplane is powered by a 5 V supply rail of the electronic system. The I


2


C_


0


bus is powered from 3.3 V auxiliary supply rail so transactions can complete on the I


2


C_


0


bus while the 5 V supply rail is powered off. When the 5 V supply rail is powered, the SCSI support chip that is located on the DASD backplane will begin self-programming by fetching code from the EEPROM. Since the SCSI support chip and the EEPROM communicate through the I


2


C_


5


bus, such transaction would be seen by all devices that resided on the I


2


C_


5


bus.




Given the conditions above, the electronic system's service processor, which is located on the I


2


C_


0


bus, is programmed to periodically read the thermal sensors located on the I


2


C_


5


bus. The service processor only reads the thermal sensors when the 5 V supply rail is powered. An error occurs when the SCSI support chip is performing its code load and the service processor attempts to read one of the thermal sensors. Since the service processor has no “visibility” to the transactions on the I


2


C_


5


bus when switched to a bus other than the I


2


C_


5


bus, the service processor will “blindly” switch the I


2


C multiplexor to the I


2


C_


5


bus in preparation of reading the thermal sensors. When this situation occurs, the I


2


C_


0


bus and the I


2


C_


5


bus are logically connected. Since the service processor did not “see” the I


2


C START condition that started the SCSI support chip's code load, the service processor “thinks” the I


2


C bus is idle. The service processor then begins a transaction to read the thermal sensors located on the I


2


C_


5


bus. The service processor's transaction then collides with the SCSI support chip's code load and causes the SCSI support chip to enter an invalid state. As a result, failures occur at the DASD subsystem.




The present invention would prevent the above-mentioned collision by delaying the I


2


C multiplexor switch event until both the “switch to” and “switch from” buses are idle. In the example above, the service processor would not have been allowed to switch to the I


2


C_


5


bus until the SCSI support chip's code load had been completed. The service processor would then be notified of the completed switch with a SWITCH_DONE signal.




As has been described, the present invention provides an improved method and apparatus to support I


2


C bus masters on a secondary side of an I


2


C mulitplexor.




While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.



Claims
  • 1. An electronic system, comprising:a primary serial bus; a plurality of secondary serial buses; an expander coupled to said primary serial bus, said expander includes a plurality of outputs that can be selectively activated; a plurality of direction latches, each coupled to a respective one of said outputs of said expander; a multiplexor, coupled to said direction latches, includes a plurality of outputs, each connected to a respective one of said secondary serial buses such that each of said secondary serial buses can be selectively connected to said primary serial bus; a plurality of busy detect circuits, each coupled to a respective one of said outputs of said multiplexor, for detecting if there is a transaction on one of said outputs of said multiplexor; and a to-from multiplexor circuit for selecting one of said busy detect circuits involved in said detected transaction to allow one of said direction latches to latch at a correct time in order to prevent any bus corruption on said secondary serial buses.
  • 2. The electronic system of claim 1, wherein said primary serial bus is a primary I2C bus and said plurality of secondary serial buses are secondary I2C buses.
  • 3. The electronic system of claim 1, wherein said direction latches are D flip-flops.
  • 4. The electronic system of claim 1, wherein said multiplexor is a FET switch multiplexor.
  • 5. The electronic system of claim 1, wherein said to-from multiplexor circuit includes a to multiplexor and a from multiplexor to generate a MUX_CLK signal for clocking said direction latches.
  • 6. The electronic system of claim 1, wherein said electronic system further includes a switch done circuit for providing a SWITCH_DONE signal to notify an external circuit that a switch has been completed.
  • 7. An electronic system, comprising:a primary serial bus; a plurality of secondary serial buses; an expander coupled to said primary serial bus, said expander includes a plurality of outputs that can be selectively activated; a plurality of direction latches, each coupled to a respective one of said outputs of said expander; a multiplexor, coupled to said direction latches, includes a plurality of outputs, each connected to a respective one of said secondary serial buses such that each of said secondary serial buses can be selectively connected to said primary serial bus; a plurality of busy detect circuits, each coupled to a respective one of said outputs of said multiplexor, for detecting if there is a transaction on one of said outputs of said multiplexor; and a bus select circuit for selecting one of said busy detect circuits involved in said detected transaction to allow one of said direction latches to latch at a correct time in order to prevent any bus corruption on said secondary serial buses.
  • 8. The electronic system of claim 7, wherein said primary serial bus is a primary I2C bus and said plurality of secondary serial buses are secondary I2C buses.
  • 9. The electronic system of claim 7, wherein said direction latches are D flip-flops.
  • 10. The electronic system of claim 7, wherein said multiplexor is a FET switch multiplexor.
  • 11. The electronic system of claim 7, wherein said busy select circuit includes only one to multiplexor for generating a MUX_CLK signal for clocking said direction latches.
  • 12. The electronic system of claim 7, wherein said electronic system further includes a switch done circuit for providing a SWITCH_DONE signal to notify an external circuit that a switch has been completed.
US Referenced Citations (17)
Number Name Date Kind
5333276 Solari Jul 1994 A
5455915 Coke Oct 1995 A
5526497 Zilka et al. Jun 1996 A
5619661 Crews et al. Apr 1997 A
5640521 Whetsel Jun 1997 A
5892933 Voltz Apr 1999 A
5898891 Meyer Apr 1999 A
5991833 Wandler et al. Nov 1999 A
6052754 Anand Apr 2000 A
6134679 Liddell et al. Nov 2000 A
6233635 Son May 2001 B1
6253268 Bjorkengren et al. Jun 2001 B1
6301623 Simpson et al. Oct 2001 B1
6339806 Foster et al. Jan 2002 B1
6438624 Ku et al. Aug 2002 B1
6622188 Goodwin et al. Sep 2003 B1
20030135679 Tangen Jul 2003 A1