Use Arduino to build USB device?

Is it possible to use the Arduino to build an arbitrary USB device. Can I for example build a HID or mass-storage device using the Arduino which then doesn't require any vendor-specific drivers when connected to a host?

Sorry to reply with a single link to google.
http://www.google.co.uk/search?q=usb+host+site%3Aarduino.cc

But it seemed pointless to type all of this out in a reply when you can just read through the google results.

Gordon

i don't think that's quite what he is after

try these

http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=139

Those are not related to Arduino, but your Arduino is nothing more than an ATmega packaged with a FT232RL, a crystal, some pre-written C++ code, and a bootloader, think of it as such. The bootloader can load code hex code compiled from any editor, not just Arduino

While not an Arduino, I believe the Teensy will do what you want...

http://www.pjrc.com/teensy/index.html

Here's the main problem I see when using an Arduino as an USB device:

$ lsusb
[...]
Bus 005 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
[...]

That is how the Arduino I have identifies itself on the system, as a serial device. In other words, when you plug in your arduino, you are essentially plugging in a USB to Serial converter, and behind this serial converter the actual AVR chip with its code and whatever you wired to it.

This is also the reason why the Arduino IDE cannot automatically pick up a board to work with, nor automatically choose a serial port to send out the data.

You can make a device driver however, that uses a serial port to send and receive data the problem with this is that it cannot automatically detect which serial port it will be talking to, sure you can search for whatever port the device id 0403:6001 created, however, that leaves three problems:

  1. You still won't know what's behind the serial port
  2. You can have more than one device with this ID connected to the system
  3. Another device with the same ID can be connected.

Here's what I'd like to know, however, the device id I provided is for my Arduino Duemilanove with an ATmega168. All Arduinos of this kind should identify with the same ID. Since the parts for the Arduinos are pretty much the same except for the Atmel chip itself, do the other Arduinos use the same TTL to Serial converter?

Hi,

Here's what I'd like to know, however, the device id I provided is for my Arduino Duemilanove with an ATmega168.

Not really, the device-id (USB-Vendor-ID / USB-Product-ID) is for the USB2Serial converter on the Arduino board. I have a GPS-Logger that uses the same device-id.
You could use a custom device-id with the converter to identify Arduino-Boards, but then you have to become a member of the USB-IF (at 4000$ a year).

...do the other Arduinos use the same TTL to Serial converter?

Yes.

But at least on Linux there is an easy way to idenetify a specific Arduino board by the serial number on the USB2Serial converter.
See at bottom of this topic
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1254340446/3

Eberhard

Is it possible to use the Arduino to build an arbitrary USB device.

Somewhat, yes.

Can I for example build a HID

Yes.

or mass-storage device using the Arduino

Not really, unless the operating system you use supports non-spec compliant low-speed mass storage devices.

which then doesn't require any vendor-specific drivers when connected to a host?

Only if the device class is supported by the operating system. But it is possible to write a custom libusb based "driver" (using something like Python) also.

In all cases you'll need to build a custom shield using a small number of components.

My work based on the V-USB code (and associated shield) has been documented here: http://code.rancidbacon.com/ProjectLogArduinoUSB

--Philip;

Hi Frank,

Is there a way to download the driver V-USB on the computer instead of the board? because the ATmega328 flash has a small size comparing to the size of the driver, so it won't be possible to upload the driver on the board.

Thanks,

Dany, I don't understand your question. V-USB can fit onto 8 pin ATtiny chips, I don't see why it would not fit on an ATmega328P.

Hey,

I meant the memory size of the flash. the software has a size of 412KB, while the size of the flash of the Arduino ATmega328 is 32KB, so it's not possible to download this software on the flash of the arduino.

thanks for your reply!

it doesn't come with precompiled hex code, you are supposed to compile the files provided yourself (modify some settings to target the ATmega328P) and link it to your project