USB interlink

Is it possible to link Arduino boards using their USB connections? [m]

no.

-j

ok, Thanks.

Thought that as they are both emulating a serial connection ... but I suppose there's a few more layers than that.

Cheers [m]

They can be linked by connecting the serial lines Tx and Rx (Tx on one to Rx on the other and vice versa).

Of course!

Thanks. [m]

On many implementations the RX/TX pair is dedicated to the bootloader link (e.g. Diecimila). Trying to use these pins for another purpose (like connecting to another Arduino) would not work.

With other implementations (e.g. Mini, Boarduino) you can use the RX/TX - but would have to switch the wires back to the development system (typically a USB adapter) when you want to download a different program. This can be cumbersome.

alternatives:

ladyada has a software serial solution that would allow you to use two general purpose pins as a serial port.

The Wire library looks like a possible solution.

The SPI port could be used to connect two boards together

On many implementations the RX/TX pair is dedicated to the bootloader link (e.g. Diecimila). Trying to use these pins for another purpose (like connecting to another Arduino) would not work.

I've tried it on the Diecimila--it works. ;)

On that board the FTDI USB chip (FT232RL) Tx and Rx pins are connected to the Atmega168 Tx and Rx pins through 1K resistors (http://www.arduino.cc/en/uploads/Main/Arduino-Diecimila-schematic.pdf), which allow the external Rx and Tx connections (pins 0 and 1) to drive the Atmega168's USART without taxing the FTDI chip too much (i.e., the FT232RL output pins would have to source/sink no more than 5 ma through said resistors).

Sorry for my original terse (but correct) reply. As others are pointing out, there are other options besides USB.

In addition to direct serial connections bypassing the USB chip, you can use I2C or SPI. The arduino core duo board uses I2C to allow 2 arduino-enabled ATmegas to talk to each other.

If your needs are simple, e.g. a single flag to indicate some condition is true or false, a single digital IO line (and a common ground, of course) will accomplish that.

There are probably other ways, too.

-j

Out of curiosity, what's to prevent a USB to USB connection from working, if a cable is made with the appropriate connector on each end, and Tx and Rx reversed?

Because the physical connection is only a small part of USB. There is a huge protocol stack that goes with it, and the peripherals are slightly dumb and at the mercy of the host, which is meant to be a full OS type system. There must be a host on the bus for USB to be interesting, and an Arduino-to-Arduino bus doesn't have a host.

I understand there is some ongoing effort to get simple USB devices to talk to each other. USB On-The-Go (tm) allows "Limited host capability to communicate with selected other USB peripherals". A completely different approach is the Vinculum VNC1L, which is an IC that implements the host side for a limited number of perpiherals. Search the forum for VDIP and VMUSIC for ways folks are using that device with the arduino (hint, not to make them talk to each other, it's easier to do that via one of the methods I mentioned).

-j

Ah, thanks--couldn't be that easy.