How to start USB bus in Arduino board

We are trying to read input pins and send them to usb bus. And read from usb to outputs.

But how to start usb bus. That is when we use serial bus, how to get that into usb. All I see is serial buses.

What code do I need in Arduino? Do I have to switch some hardware plugs?

The USB port is accessed through a serial-to-USB chip. So the Arduino board will always appear as a serial-port on a PC.

Arduino only has a serial port, no USB.

The serial port uses a USB plug, but it is not a USB device.

Some people have made Arduino work as a USB HID device

Google "Arduini AVRusb" to find info. But don't expect too much.

Hi, and thanks for answering.

What I understood is that serial to usb chip shows like a somekind of virtual serial bus in a pc. Nothing more fancy.

But that would be enough for us. In pc we write to a virtual com port and it comes out of Arduino. Is that all what is needed.

I have not actually used the card yet, but I understand, code is also downloaded to the Arduino via usb, don't code and our data get mixed up.

No, no mix-up will happen... once the USB/serial/arduino has the firmware uploaded... you are free to use the Serial port/usb as a program communication path between arduino and PC.

You can use the serial port to communicate between Arduino and the PC without any problems.

You only use the serial port to download the program to the Arduino port for a few seconds, then the program run and you can use the port for communicating with another program on the PC.

Sorry my delayed reply, other work to be done first.

I think I begin to understand. So, what goes to serial io goes to usb also. The schematic seems to say so.

One more basic question, if the power is cut off, does our program stay in the board.

if the power is cut off, does our program stay in the board.

Yes, and it restarts from the beginning of the program when power is reapplied. There is no need for the Arduino IDE program to be running for this restart option, just plugged into the USB port for power or use external power applied to the external power jack on the Arduino board and you don't need the PC at all.

Lefty

I think we can use this board.

There could be some more io but you can't get everything.

For curious: A friend of mine is going to write some pc programs reading and writing usb com port. And my job is to handle some hw devices with usb/serial data.

Thanks

Sounds like a plan to me. Oh and if you find you are getting short of I/O pins just jump on the new Arduino Mega board and all your existing programming can still be utilized as 54 I/O pins should hold you for a while then ;)

http://arduino.cc/en/Main/ArduinoBoardMega

Lefty