USB to I2C interface

Hi all. This topic may have been covered, and if it has please point me to the location. My project is that I need a USB to I2C interface. I will need to send control information on to one of two I2C buses. This will control MAX7300, MAX1239 chips and I will need to query the same chips. My first question, is can the Arduino chip support two different I2C buses? If so, has anyone done this type of project in the past, maybe with different chips. This is NEW area for me, so be gentle. I will need to send and receive data to the I2C buses from another program and hardware, which is handled by other people, this is my portion. I have purchased my first UNO PWB and I have a bread board with the chips in question. Thanks for any and ALL help...

Regards,

Dave M.

I will need to send control information on to one of two I2C buses.

Do you mean this? The I2C bus can handle lots of different chips on the same bus, there is no need to have more than one bus. They all have different addresses to allow this.

You normally communicate to the arduino from other computers through the serial port.

My project is that I need a USB to I2C interface

The Arduino is a USB to I2C interface (with the right software).

My first question, is can the Arduino chip support two different I2C buses?

As mentioned above, this is rarely necessary since devices have different addresses and all live on the same bus, only responding to their own addresses. Now, I can see a case in which you have multiple devices with the same fixed (non-changeable) I2C address. Then having multiple, separate I2C addresses might be the way to go. The MAX7300 has 16 configurable addresses) but the MAX1239 has a fixed address. If you need multiple MAX1239's then you will need different buses, or maybe different devices rather than the MAX1239 ;)

Now you can "bit bang" I2C on any I/O pins without using the dedicated hardware on the Arduino (known as TWI) but it can be painful.

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

The two busses is a existing design, I just need to pass commands from an external program and hardware, I'm providing the interface between the ATE and the DUT.

I can see a case in which you have multiple devices with the same fixed (non-changeable) I2C address. Then having multiple, separate I2C addresses might be the way to go

No if that is the case you are much better off using the one bus and switching the data line to the two devices.

I'm providing the interface between the ATE and the DUT.

Can you explain what these are please.

ATE (Automated Test Equipment) and DUT (Device Under Test).

Device under test is a bit generic. I am having trouble trying to understand what you ate trying to do. If you hold back detailes it makes it hard to help.

Not trying to be criptic, but we have test equipment with will interact with a product, that product will via I2C have two I2C busses, we will have to ingage communications and turn on and off, read values with the control software to verify during production of the device, it is operating as designed before being installed in the larger piece of equipment it belongs. I can not go deeper that this. I hope that helps a bit more. External Software is NI LabView that will make calls to the I2C bus via USB. Loads and measuring equipment will also be controlled via this same software.

Regards,

Dave M.

OK so if you have two buses coming in and you have to communicate over either, you have the choice of:-

1) Using analogue switches to connect the arduino to each bus in turn. 2) Use the hardware I2C bus on the arduino for one bus and write a bit banging I2C bus driver for the other. 3) Use two arduinos and communicate between them with serial (either hardware or new software serial).

OK, Thanks. I’n not familure with the term bit bang, but I presume that you are forcing a 2nd I2C bus via software, and manually have to pass and read data. Now the big question, where can I find examples of the bit bang process and software examples of creating a I2C serial post and read (for lack of a better term) software. As my project moves forward and I get more information from end user, I will also know if I can use two Arduino’s or one. Again, thanks for the guideance. :slight_smile:

Regards,

Dave M.

Now the big question, where can I find examples of the bit bang process and software examples of creating a I2C serial post and read (for lack of a better term) software.

Here's one person's contribution:

http://codinglab.blogspot.com/2008/10/i2c-on-avr-using-bit-banging.html

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons