0

I'm trying to use V-USB library to emulate a keyboard using Arduino Nano but because of precaution, I don't want to use it's built-in USB port.

My idea is to add another USB port so I cant power my device with the new USB port and use free digital pins as input/output of the new USB serial port in V-USB project.

What circuit I should use and how to add extra USB port to Arduino Nano.

2

USB is deceptively simple. The underlying protocol is very complex. So a complete answer to your question requires some USB background.

USB is divided into 2 types. USB Hosts and USB Devices. We are not concerned about USB Hosts here. USB Devices only need to know about their own functions / features. If they are a serial port device, like the FTDI chip on the Arduino Nano, they only need to "speak" basic USB protocol and the serial CDC USB protocol. If the USB Device was a keyboard, it only needs to know the basic USB protocol and the HID USB protocol.

In order to offer up a USB port the Arduino Nano uses an FTDI chip FT232RL. This chip supports a Serial Port USB Device. It does not appear to support HID USB Devices. So your decision to use V-USB is necessary not because of power but because the Arduino Nano's built in USB port supports a protocol other than USB CDC.

What circuit I should use and how to add extra USB port to Arduino Nano.

The circuit suggested is on the V-USB web page appears to contain the necessary information:

enter image description here

Of course you will have to do some research into V-USB software to see which are the appropriate pins to use on your Arduino Nano.

  • The OP wants to use V-USB! – Gerben Dec 16 '16 at 13:57
  • I see what you mean. I'll edit my answer. Thanks. – st2000 Dec 16 '16 at 14:29
  • Since Arduino Nano have internal oscillator, can I setup only left side of the circuit? – joware Dec 17 '16 at 13:41
  • My understanding is that USB is very picky about frequency. Perhaps this is the reason that the V-USB web page included the external crystal. However, the V-USB web page does say: "Can be clocked with 12 MHz, 15 MHz, 16 MHz 18 MHz or 20 MHz crystal or from a 12.8 MHz or 16.5 MHz internal RC oscillator.". – st2000 Dec 17 '16 at 14:29
0

You can use a USB host mini module for the Arduino NANO and the USB Host Library r2.0 enter image description here

You can implement a keyboard with this...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.