Go Down

Topic: Sharing a USB connector with I2C (Read 3095 times) previous topic - next topic


I have a device I'm developing for airsoft that would be headless while in use during the games, but I would like a device that I can plug into it to change settings, read logs, etc. Eventually I'll go wireless when I feel a bit more confident.

TWI seems to be the way to go, connector wise, since with my understanding it only requires 4 conductors, two for data & two for power/ground.

I had looked at using 3.5mm 4 conductor plugs & jacks, but unfortunately they seem to be difficult to come by, and I like the option of using retractable USB cables to keep the kit as small and as clean as possible.

Ideally, I would like to set these devices as such:

Gun Unit USB
- Firmware Updates
- TWI Connection

Controller Unit USB
- Firmware Updates
- TWI Connection
- Battery Charging

I'm currently using a couple of arduinos to develop this, with the intent to movie to dedicated AVRs once it seems stable enough.

I know I could use a mode switch on each device so that they understand what mode they should be in without the need to sense the lines, but I would like to learn how to set up the sensing as well, to simplify the design down the road.



Using a USB-style connector, and making the Arduino-powered device appear as a specific USB device are two entirely different things. The first is trivial. The second is a lot more complex.
The art of getting good answers lies in asking good questions.


Jan 28, 2011, 05:43 pm Last Edit: Jan 28, 2011, 06:31 pm by AcidFire Reason: 1
Oh I understand that completely. My current design has an FTDI to act as the USB to Serial for updates from the Arduino IDE. I'll be burning the bootloader to the final product to make it work.

Now, since the gun unit normally will be running on a power supply seperate from the power provided from the usb cable while its in operation in the gun, would I be able to use that as a trigger/condition as to how it talks to the unit, getting the avr to connect the pull ups for TWI when connected to the external pack, and cutting them off when not so that the pull ups wouldn't affect the USB lines?

This is how I think I could set this up if I were to stay with USB:

Go Up