Arduino Uno : Write to USB port ?

Hi,
I want to power up my Arduino board using 5V DC battery. Can the USB port be connected to a USB stick such that any device output that I would code could be routed to a file in this USB ?

N.

No, the arduino as-is does not support being a USB host to do that.

Are you using the arduino uno?

If yes, we were able to power it with a 9v DC battery using a 'power jack' (avalable in electro shops) soldered to a 9v DC connector (also avalable in electro shops)

I hope this helps

Giete

Thanks, CrossRoads. I guess, a SD shield is the only answer then.

Giete, yes, I am using Uno. However, the more important question I had in my mind was about writing to a USB stick via the USB port. As answered by CrossRoads, this is not possible.

As answered by CrossRoads, this is not possible.

Without additional hardware, it is not. With a USB Host shield, it is possible. Not trivial, and I don't know that anyone has written the code needed to write to your "USB stick". Whatever a "USB stick" is.

cogitoergosum:
Hi,
I want to power up my Arduino board using 5V DC battery. Can the USB port be connected to a USB stick such that any device output that I would code could be routed to a file in this USB ?

N.

Does it specifically have to be a USB memory stick? There are shields available to add removable SD card storage, and with that it should be possible to redirect any output you want to a file stored on that card.

SD storage is fine. I will try it.

CrossRoads:
No, the arduino as-is does not support being a USB host to do that.

Is that simply the case that the software in the bootloader does provide host capabilities or is the FTDI chip insufficient as well?

If it's not a hardware limitation it would presumably be possible to provide minimalistic data logging to USB flash devices but without attempting to provide full fs support. ie just treat it as a block device and write an unformatted byte stream to it.

This could be recovered with linux dd command later from the raw device.

This would require forfeiting using USB for other things after booting but would be better than buying a shield of some sort in order to have a data logging ability.

I'm guessing that level of host functionality could be fitted in to a reasonably compact code size, though I have not dug into the USB spec to see just what is required.

If it's not a hardware limitation it would presumably be possible to provide minimalistic data logging to USB flash devices but without attempting to provide full fs support. ie just treat it as a block device and write an unformatted byte stream to it.

Interesting ! :slight_smile:

It seems possible that some simple usb host capability should be possible with a modified firmware for the 16U , if it is not possible already.

I don't know whether a USB device can be a hermaphrodite or if it has to be one or the other before connection.

At least it may be possible to flash the 16U to act as a host so that it can interact with mass storage devices in a similar way to converting it to be a MIDI device (thus forfeiting the ability to reprogramme it via USB).

This may be a useful option for an arduino data logger without needing to buy an extra shield for mass storage capability.

I don't know whether a USB device can be a hermaphrodite

It's called USB On-The-Go. A number of phones and media players support it. I haven't looked closely enough at it to see if it could be implemented on the 16U.

http://www.usb.org/developers/onthego/