2
\$\begingroup\$

As the title states I want to connect a USB mouse to the USB port on a USB/UART bridge. I want to determine if it is possible to communicate with the mouse using serial commands on the FPGA board then converted to USB signals.

In other words, I want the bridge to serve as the host to a peripheral like a mouse/keyboard. Do I need to worry about converting to PS/2 at all when connected?

Is this feasible as I am looking for a viable solution to connect a mouse to my FPGA board without having to create a USB block to handle this from scratch?

\$\endgroup\$

marked as duplicate by Chris Stratton, brhans, Elliot Alderson, Renan, Bimpelrekkie Feb 4 at 12:41

This question was marked as an exact duplicate of an existing question.

  • 1
    \$\begingroup\$ No. And you don't really need to post a third question on this same undelrying problem. If you want to do it with an outboard device you'd need a small MCU with USB host capability, perhaps a KL25Z or an STM32F4. Or just get a PS/2 mouse already. \$\endgroup\$ – Chris Stratton Feb 3 at 21:47
  • \$\begingroup\$ The board has almost no available GPIO ports so I might have to work out a solution to use the occupied ones for the LCD display or get an FMC to GPIO board. HW-FMC-XM105-G (digikey.com/product-detail/en/xilinx-inc/HW-FMC-XM105-G/…) Then I need to connect a PS2 pmod connector on the board to get PS/2 capability. Probably this is the only way I can solve this problem. \$\endgroup\$ – Vahe Feb 4 at 0:04
  • \$\begingroup\$ An MCU outputting the mouse stream via a serial UART would be the minimum of pins (1 signal and its ground), thought a little more complex to receive in an FPGA than a synchronous protocol. \$\endgroup\$ – Chris Stratton Feb 4 at 0:23
6
\$\begingroup\$

Almost all ICs marketed as "USB/UART bridge" or similar (including the CP2103) can only act as a USB device on their USB port, so no - this won't work.

What you are looking for is a "USB host controller". Those will have a USB host port to interface with your mouse (or another USB device), and a host controller interface to connect to a host processor - typically a CPU of some kind, but in your case an FPGA. In most cases this host controller interface will be an implementation of one of several standards such as UHCI, EHCI, XHCI.

Unfortunately for you, those are very complicated standards and it would take a lot of work to implement the corresponding logic in the FPGA. Fortunately for you, there are a small number of host controllers designed for this kind of application which integrate a lot of that logic and present a simpler, higher-level interface to the host processor. Examples include the MAX3421E and FTDI's Vinculum (VNC1L, VNC2).

\$\endgroup\$
4
\$\begingroup\$

Nope.


The USB port on the converter chip is a device, not a host. It cannot be used to connect to a mouse.

Your best bet would be to buy a PS/2 mouse, or see if your USB mouse is backward compatible with PS/2 via passive adapter. PS/2 is a really simple protocol and easily interfaced with an FPGA.

\$\endgroup\$

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