Pages: [1]   Go Down
Author Topic: Sharing a USB connector with I2C  (Read 1560 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Thoughts?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 651
Posts: 50841
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
« Last Edit: January 28, 2011, 12:31:36 pm by AcidFire » Logged

Pages: [1]   Go Up
Jump to: