1. Technical Field
The present invention relates to computer bus architecture. More specifically, the present invention relates to Inter Integrated Circuit (I2C) buses.
2. Description of Related Art
Many similarities exist between seemingly unrelated designs in consumer, industrial and telecommunication electronics. Examples of similarities include intelligent control, general-purpose circuits (i.e. LCD drivers, I/O ports, RAM) and application-oriented circuits. The Philips Inter Integrated Circuit (I2C) bus is a bi-directional two-wire serial bus designed to exploit these similarities.
Devices on the I2C bus are accessed by individual addresses, 00-FF (even addresses for Writes, odd addresses for reads). The I2C architecture can be used for a variety of functions. One example is Vital Product Data (VPD). Each component in the system contains a small Electrically Erasable Programmable Read Only Memory (EEPROM) (typically 256 bytes) which contains the VPD information such as serial numbers, part numbers, and engineering change revision level.
I2C busses can connect a number of devices simultaneously to the same pair of bus wires. Normally, the device addresses on the I2C bus are predefined by hardwiring on the circuit boards. A limitation of the I2C bus is that it will only allow a single device to respond to each even address between 00 and FF. All addresses are even because only the high-order seven bits of the address byte are used for the address. Bit 0 is used to indicate whether the operation is to be a read or a write. Therefore, there are a limited number of addresses that can be assigned to a device.
Many I2C devices have their high-order four address bits predefined. The remaining three address bits are assigned with the use of strapping pins on the device. For example, most I2C accessible EEPROMs have three strapping pins which limit their addresses to the even addresses between A0-AF. This permits eight unique addresses for a given chip of that type. Thus, only eight of these devices may be connected to a single bus and still each have a unique address.
In addition to address conflicts, a problem results when one of the devices malfunctions and pulls a bus signal (clock or data) low. The bus will not operate, and it is very difficult to determine which of the numerous devices connected to the I2C bus is responsible. A similar problem occurs when one of the bus conductors becomes shorted to a low impedance source, such as, for example, ground.
Therefore, a need exists for an I2C device that includes bus switches and that may be addressed using a reprogrammable device address.
An I2C device is disclosed that includes a main I2C section, bus switches, switch logic, and address logic as part of the I2C device. The I2C device is coupled to an I2C bus for communicating with other I2C devices and to an I2C bus controller that is also coupled to the I2C bus. The switch logic controls a current position of the switches. The I2C device is coupled to the I2C bus utilizing the switches. The switches control whether the main I2C section, the address logic, the switch logic, or a combination of the main I2C section, address logic, and switch logic is currently coupled to I2C bus. The address logic is used to receive and store the address of the I2C device. Thus, the device address can be redefined or reprogrammed. The I2C device will respond to the address that is stored in its address logic. Thus, the I2C device's address is the address that is stored in its address logic.
The above as well as additional objectives, features, and advantages of the present invention will become apparent in the following detailed written description.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives 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:
With reference now to the figures and in particular with reference to
With reference now to
Processor 202 and main memory 204 are connected to PCI local bus 206 through PCI bridge 208. PCI bridge 208 also may include an integrated memory controller and cache memory for processor 202. Additional connections to PCI local bus 206 may be made through direct component interconnection or through add-in boards. In the depicted example, local area network (LAN) adapter 210, small computer system interface SCSI host bus adapter 212, and expansion bus interface 214 are connected to local bus 206 by direct component connection. In contrast, audio adapter 216, graphics adapter 218, and audio/video adapter 219 are connected to local bus 206 by add-in boards inserted into expansion slots. Expansion bus interface 214 provides a connection for a keyboard and mouse adapter 220, modem 222, and additional memory 224. SCSI host bus adapter 212 provides a connection for hard disk drive 226, tape drive 228, and CD-ROM drive 230.
An operating system runs on processor 202 and is used to coordinate and provide control of various components within data processing system 200 in
Those of ordinary skill in the art will appreciate that the hardware in
For example, data processing system 200, if optionally configured as a network computer, may not include SCSI host bus adapter 212, hard disk drive 226, tape drive 228, and CD-ROM 230, as noted by dotted line 232 in
The depicted example in
The processes of the present invention are performed by processor 202 using computer implemented instructions, which may be located in a memory such as, for example, main memory 204, memory 224, or in one or more peripheral devices 226-230.
In the prior art, one or more I2C devices, such as main section 302, are coupled together using an I2C bus to communicate with each other. According to the present invention, switch pairs 308 and 310, address logic 304 and switch logic 306 are added to main section 302 to create a new I2C device 300. Thus, one or more I2C devices 300 may be coupled together using an I2C bus to communicate with each other.
An IN switch pair 308 and an OUT switch pair 310 are also included which are controlled by switch logic 306 in order to control which portions of I2C device 300 are coupled to the I2C bus as well as whether or not I2C device 300 communicates on the I2C bus at all. In addition, by selecting particular switch positions, I2C device 300 can control whether or not devices coupled to the I2C bus downstream from I2C device 300 can communicate on the I2C bus.
I2C devices that receive a signal on the I2C bus after a particular I2C device has received the signal are considered to be “downstream” from the particular I2C device.
Since an I2C bus is comprised of two signal lines, Clock and Data, the IN and OUT switches are each comprised of a pair of rotary switches. Each one of the IN and OUT switches is a double pole rotary switch. One of the poles in the IN pair is for the Clock signal and the other is for the Data signal. The same is true of the OUT switch.
For simplicity, the drawings and corresponding description indicate that the two signals combined as the “I2C bus communication bus”, “I2C bus signals”, or “I2C signals” and the double pole rotary switches will simply be referred to herein as “switch” or “switches”.
Each switch may, independently of the position of the other switch, be in one of four different positions, position 0, 1, 2, or 3. Thus, IN switch 308 may be in either position 0, 1, 2, or 3 while OUT switch 310 may be in either position 0, 1, 2, or 3.
Switch positions are controlled by switch logic 306. Thus, switch logic 306 receives a command and then causes one or both switches 308, 310 to change their position.
A reset signal 312 may be received by main section 302 and address logic 304. When reset signal 312 is received, switch logic 306 causes both IN switch 308 and OUT switch 310 to move to position 3 if they are not in position 3 already.
I2C device 300 is included within an integrated circuit 320. Various parts of I2C device 300 are accessible utilizing one of the pins 322-336 of integrated circuit 320. For example, reset signal 312 may be received utilizing pin 322. The I2C communication bus is input to I2C device 300 utilizing pins 336 and 334 for the Clock and Data signals and is output from I2C device 300 utilizing pins 332 and 330. In this manner, multiple devices, such as I2C device 300, may be coupled serially together by coupling an output of the I2C bus for one I2C device to an input for the bus for another I2C device.
Address logic 304 is used by an I2C device 300 to receive and store the address of I2C device 300. I2C device 300 will respond to the address that is stored in its address logic. The address stored in address logic 304 is programmable. Thus, I2C device 300 may receive a new address and then store that address in its address logic 306. I2C device 300 will then respond to this new address. In this manner, the address of I2C device 300 is reprogrammable to a new address received via the I2C bus.
A typical I2C address is a seven-bit address. The lower-order three bits are typically hardwired using pins. The present invention may be used to override, and thus reprogram, any or all of these seven bits. Thus, any or all of the three lower-order hardwired address pins can be overridden by storing a new address in the address logic that changes just the lower-order bits. As another example, only the higher-order four address bits could be overridden using the present invention, thus preserving the hardwired bits.
For example,
The I2C bus signal is first received, via I2C bus segment 402, as an input to device 300a. I2C bus segment 404 is used to output an I2C bus signal from device 300a to be received as an input by device 300b. Device 300b outputs an I2C bus signal via I2C bus segment 406 which is then received as an input by device 300c. Device 300c then outputs an I2C bus signal via I2C bus segment 408 which is received as an input by device 300d.
A reset signal 410 is output from bus driver 400 and received by each device 300a-d.
Referring again to
When both IN 308 and OUT 310 switches are in position 3, the I2C bus signal received at IN switch 308 will pass through device 300 and be made available as an output from switch 310 on pin 330 to any device downstream that is connected to this device. The I2C bus signal is received by main section 302, address logic 304, and switch logic 306. When the switches are in position 3, main section 302 is active and available. The address of device 300 may be programmed, and the switches may be controlled by switch logic 306.
When both IN 308 and OUT 310 switches are in position 2, the I2C bus signal received at IN switch 308 will pass through device 300 and be made available as an output from switch 310 on pin 330 to any device downstream that is connected to this device. The I2C bus signal is received by address logic 304 and switch logic 306. Main section 302 is disconnected from the bus and will not receive the bus signal. When the switches are in position 2, main section 302 is inactive and unavailable. However, address logic 304 and switch logic 306 are both active and available. Therefore, the address of device 300 may be programmed, and the switches may be controlled by switch logic 306 when the switches are both in position 2.
When both IN 308 and OUT 310 switches are in position 1, the I2C bus signal received at IN switch 308 will pass through device 300 and be made available as an output from switch 310 on pin 330 to any device downstream that is connected to this device. The I2C bus signal is not received by main section 302, address logic 304, or switch logic 306. Main section 302, address logic 304, and switch logic 306 are all disconnected from the bus and will not receive the bus signal. Therefore, when the switches are in position 1, the address of device 300 may not be programmed, and the switches cannot be controlled by switch logic 306. When the switches are in position 1, device 300 is logically removed from the I2C bus. In addition, most of the device's 300 ability to create a bus fault is removed for diagnostic purposes.
When OUT switch 310 is in position 0, all downstream devices are removed from the bus. Thus, the I2C bus signal received at IN switch 308 will not be made available as an output from switch 310 to any device downstream that is connected to this device. If the IN switch is in position 3, the I2C bus received at IN switch 308 will be received by main section 302, address logic 304, and switch logic 306. If the IN switch is in position 2, the I2C bus received at IN switch 308 will be received by address logic 304 and switch logic 306. However, if the OUT switch 310 is in position 0, regardless of the position of IN switch 308, the bus signal will not be sent to any device downstream that is coupled to the output of device 300.
When IN switch 308 is in position 0, all downstream devices are removed from the bus. In addition, device 300 is removed from the bus and will not receive the I2C bus signal. Thus, the I2C bus signal received at IN switch 308 will not be received by main section 302, address logic 304, or switch logic 306. In addition, the bus signal will not be sent to any device downstream that is coupled to the output of device 300.
Referring again to
Now suppose both switches of device 300b are in position 3, the bus signal will be received by the main section, address logic, and switch logic of device 300b, and then output on segment 406.
If both switches of device 300b are in position 2, the bus signal will be received by only the address logic and switch logic, and not the main section, of device 300b. The bus signal will also be output on segment 406.
If both switches of device 300b are in position 1, the bus signal will not be received by main section, address logic, or switch logic of device 300b. The bus signal will, however, pass from the IN switch to the OUT switch of device 300b and be output on segment 406.
If the IN switch of device 300b is in position 0, the main section, address logic, and switch logic of device 300b will not receive the bus signal. In addition, the bus signal will not be output on segment 406. Therefore, devices 300c and 300d will not receive the bus signal and are, therefore, logically removed from the bus.
If the OUT switch of device 300b is in position 0 and the IN switch is in position 3, the main section, address logic, and switch logic of device 300 will receive the signal, but the signal will not be output on segment 406. Therefore, devices 300c and 300d will not receive the bus signal and are, therefore, logically removed from the bus.
If the OUT switch of device 300b is in position 0 and the IN switch is in position 2, the address logic and switch logic of device 300 will receive the signal, but the signal will not be output on segment 406. Therefore, devices 300c and 300d will not receive the bus signal and are, therefore, logically removed from the bus.
Referring again to block 502, if a determination is made that an instruction to exclude the I2C device including all of its elements from the I2C bus while still passing I2C bus traffic to downstream devices has not been received, the process passes to block 504. Block 504 depicts a determination of whether or not an instruction has been received by an I2C device 300 to exclude just the I2C device's main section from the I2C bus while permitting bus traffic to still be received by the address logic and switch logic and be passed to downstream I2C devices. If a determination is made that an instruction has been received to exclude just the main section from the I2C bus while bus traffic is passed to downstream I2C devices, the process passes to block 505 which illustrates setting the positions of both switches of this I2C device to position 2. The process then terminates as depicted by block 512.
Referring again to block 504, if a determination is made that an instruction has not been received to exclude just the I2C device's main section from the I2C bus while bus traffic is passed to downstream I2C devices, the process passes to block 506. Block 506 depicts a determination of whether or not an instruction has been received by an I2C device 300 to remove all I2C devices that are downstream from this I2C device while this I2C device including all of its elements remain on the bus receiving bus traffic. If a determination is made that an instruction has been received by an I2C device 300 to remove all I2C devices that are downstream from this I2C device while this I2C device including all of its elements remain on the bus receiving bus traffic, the process passes to block 507 which illustrates setting the OUT switch for this I2C device to position 0. The process then terminates as depicted by block 512.
Referring again to block 506, if a determination is made that an instruction has not been received by an I2C device 300 to remove all I2C devices that are downstream from this I2C device while this I2C device including all of its elements remain on the bus receiving bus traffic, the process passes to block 508. Block 508 illustrates a determination of whether or not an instruction has been received by an I2C device to remove all I2C devices that are downstream from this I2C device as well as this I2C device. If a determination is made that an instruction has been received by an I2C device to remove all I2C devices that are downstream from this I2C device as well as this I2C device, the process passes to block 509 which depicts setting the IN switch for this I2C device to by block 512.
Referring again to block 508, if a determination is made that an instruction has not been received by an I2C device to remove all I2C devices that are downstream from this I2C device as well as this I2C device, the process passes to block 510. Block 510 illustrates a determination of whether or not an instruction has been received to reset one or more I2C devices. If a determination is made that an instruction has been received to reset one or more I2C devices, the process passes to block 511 which depicts setting both switches for any I2C device that is to be reset to position 3. Any I2C device that has both switches in position 3 will be fully functional, capable of receiving bus traffic by its main section, address logic, and switch logic, and will pass I2C bus traffic to the next I2C device downstream from this I2C device. The process then terminates as depicted by block 512.
Referring again to block 510, if a determination is made that an instruction has not been received to reset one or more I2C devices, the process then terminates as depicted by block 512.
Referring again to block 616, if a determination is made that at least two of the I2C devices have duplicate addresses, the process passes to block 606 which illustrates sending a command to the I2C devices that have duplicate addresses to set their OUT switches to position 0. Thus, such a command is broadcast on the I2C bus to the duplicate address.
Each device 300 monitors the I2C bus and will respond to its own address. When an address conflict occurs, i.e. when two or more devices have the same address, all of those devices having this address will respond to the address. Thus, if a command to set OUT switches to position 0 is broadcast to the duplicate address, all of the I2C devices having the duplicate address will respond to the command by setting their OUT switches to position 0.
Next, block 608 depicts sending a command to the duplicate address to change its address to a specified new address. Because all I2C devices having the duplicate address have removed downstream devices from the I2C bus when their OUT switch was set to position 0, only the first I2C device on the bus from the bus driver that has the duplicate address will receive this command to change its address. This I2C device that is first on the serial bus from the bus driver will change its address to the new address. However, the remaining I2C devices on the bus having the duplicate address will continue to have what was originally the duplicate address. Block 610, then, illustrates sending a command to this new address to set the switches in the I2C device to position 3 to make the device fully functional and permit downstream I2C devices to receive bus traffic.
Now, the second device having the previously duplicate address is reconnected to the bus. If it is the only device still having that address, nothing more needs to be done as it is no longer an address shared by another device.
Thereafter, block 612 depicts a determination of whether or not any more of the I2C devices have duplicate addresses. If a determination is made that one or more of the I2C devices still have duplicate addresses, the process passes back to block 608. This process loop continues until only one device has the original duplicate address which is then a unique address. Once a set of duplicate addresses is dealt with in the manner described above, the process then passes back to block 602.
Referring again to block 604, if none of the devices have duplicate addresses, the process passes to block 616 which depicts a determination of whether or not any addresses for other I2C devices should be changed. If a determination is made that no other addresses need to be changed, the process terminates as illustrated by block 624.
Referring again to block 616, if a determination is made that the address for another I2C device needs to be changed, the process passes to block 620 which depicts sending a command to this I2C device to change its address to a new address. The process then terminates as depicted by block 624.
The device depicted herein is given merely by way of example and is not intended as an architectural limitation to the present invention. Other embodiments of a device including switches may include different numbers of pins and include other components not shown.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
The subject matter of the present invention is related to copending U.S. application Ser. No. 09/779,364, entitled I2C SELF BUS SWITCHING DEVICE, filed on Feb. 8, 2001; Ser. No. 09/779,368, entitled METHOD FOR ISOLATING AN I2C BUS FAULT USING SELF BUS SWITCHING DEVICE, filed on Feb. 8, 2001; and Ser. No. 09/773,185, entitled DYNAMICALLY ALLOCATING I2C ADDRESSES USING SELF BUS SWITCHING DEVICE, filed on Jan. 31, 2001, all of which being assigned to the same assignee and all of which incorporated herein by reference.