Using I/O pins for USB

Hi, very new to Arduinos and I'm working on a project with a mega that fits onto a PCB inside a rack mount case. I'd like to have a usb port mounted to the case so I can update the arduino sketch without having to open everything up.

I was wondering if arduino i/o pins can be configured as a USB port? Originally I was thinking to just plug in a USB extension cable but space is very tight inside the case and it would interfere with other headers. I'd like to bring the pins out to a better location on the PCB with a smaller connector.

Alternatively I could just remove the USB connector and solder on a new, smaller header but I'd rather do it with i/o pins if possible.

I was wondering if arduino i/o pins can be configured as a USB port?

No. What you really need is one of these http://www.ftdichip.com/Products/Modules/USBRSxxx.htm See Figure 1.4

A DB9-USB-D5-M can be used to replace a male DB9 connector that is wired in a PC compatible RS232 manner. This module operates at 5.0V signal levels. A DB9-USB-D5-F can be used to replace a female DB9 connector that is wired in a PC compatible RS232 manner. This module operates at 5.0V signal levels. The purposes of these modules is to provide a simple method of adapting legacy serial devices with UART interfaces to modern USB ports by replacing the DB9 connector with this miniaturised module which closely resembles a DB9 connector. This is accomplished by incorporating the industry standard FTDI FT232R USB-Serial Bridge IC.

Bring Rx, Tx to D0, D1 as needed. Gnd to Gnd. 3.3 V and 5V are not brought out. DTR looks to also be accessible to drive reset thru the onboard DTR/Reset cap; this is not available as an IO pin on the mega; adding a cap between the module's DTR pin Reset pin on the Mega is probably easier.

Thanks for the reply! Will this get me the same kind of plug and play functionality as the existing USB port? Like I said I only want to use this for applying updates and debugging as needed so I would like it to function the same.

If not I’m completely fine with replacing the USB connector. I’d just like to exhaust other potentially cleaner options first.

I also just found this:

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

will that give similar functionality to the solution you suggested?

You don't need to replace the connector - just connect the adapter to D0, D1, and DTR thru a 0.1uF cap for autoreset to work.

USB Serial, yes. Not as easy to panel mount tho.