Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

USB to UART FT232 Gamepad HID

Hi,

I'm trying to get a USB gamepad to work with my Cyclone V GX starter kit and was testing out the controller using the control panel that came as a demo with the board. Yet as I pressed the buttons nothing showed up as received data and the LEDs did not turn on. The gamepad is confirmed to work with my computer.

I'm just sort of confused by how the USB to UART works for the HID gamepad. Is it that the protocol could be different than what the USB to UART chip supports and therefore cannot convert the data to UART? I thought that although the data might not make sense, I should at least be receiving SOMETHING. Am I missing some understanding about how this works? And if all else fails, can I just use the raw USB data from the gamepad on the board, short of connecting it directly to GPIO or something?

Thanks for the help

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm not an expert on USB protocol, but as far as I know, your method of connecting USB to UART chip to an HID device will not work because of the following:

    1.) USB to UART chip is a conversion IC between a USB Host port and standard UART interface, it requires a specific USB driver running on the USB host that it's connected to do the enumeration and configuration, and to excahnge data with the IC. So, this chip is a USB device that needs to be connected to a host.

    2.) the USB HID device is also a device that needs to be connected to host, which can access the data with the help of a generic HID class driver on the host side.

    So, guess what would happen if you connect two devices to each other? You can't connect them. The USB connectors physically don't mate with each other. Even if you do with some exotic adaptor, the interface will not work.

    A possible solution though, is to bring the USB signals to the FPGA, and have a USB host controller running in the FPGA. I know there are USB host controller IP available, but i never tried using one.

    Another solution would be to have the HID device connected to an external USB host controller, then have that controller connected to the FPGA via other simpler digital interface.

    But either ways, the work required to interface to a USB HID device is substantial if you start everything from scratch. If you absolutely have to interface an HID device to your FPGA, the easiest thing to do would be to have a microcontroller running an OS that supports USB HID devices, and convert the HID data to UART character streams, and send that to the FPGA.