Is it possible to run both USB Host and USB Device controllers on top of an AVR (ATMega64)? Specifically, what I'm looking for is to receive data from a usb keyboard, and simultaneously sending keystrokes to a PC.

From what I've seen, both VUSB & LUFA stacks support USB host modes, but they work with a single usb port only.

Any help is appreciated! Thanks!


2 Answers 2

  1. I don't think that V-USB supports host (OTG) mode and LUFA host mode will require at least an AT90USB646 which is quite expensive.

  2. I don't know about a cheap micro that has 2 USB port but you may try using two. Just connect them via an UART and exchange the needed information.

That said, davr is probably right that using a PS/2 keyboard would be simpler.


You might consider using a PS/2 keyboard, they are simple to interface with, it's basically just a serial protocol. Then you can still use USB in Device mode to connect to the host PC.

  • 1
    \$\begingroup\$ You can even make it look like fake USB - many keyboards I have seen are dual-mode USB and PS/2. You could have a USB connector wired up like the "USB to PS/2" adapter and just interface using PS/2. Don't know if the requirement is USB or just a keyboard with a USB connector. \$\endgroup\$
    – W5VO
    Commented May 2, 2010 at 7:59
  • 2
    \$\begingroup\$ IIRC most of these keyboard and mouse adapters did not contain any logic and required the mice/keyboards to have true USB signals on the PS/2 connector (which has 2 unused pins). \$\endgroup\$
    – jpc
    Commented May 2, 2010 at 16:26
  • \$\begingroup\$ Actually I'm looking for a way to work with a real USB keyboard, but in case that will get complicated, I'll sure go with the PS/2 option. Thanks for the advice! \$\endgroup\$
    – mentalist
    Commented May 2, 2010 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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