jenswilly.dk


Reading USB joystick data from Vinculum-II

Success! I have managed to write and compile firmware for the FTDI Vinculum-II (VNC2) USB host IC so I can read HID reports from a Saitek Cyborg EVO joystick, parse the data into values for the X, Y, rotation and throttle axes and button states and transmit any change in values by UART which can be received by an MCU.

This is what I did:

First, I got a V2DIP1-32 development module. This is basically a VNC2 (the 32-pin version) on a PCB along with a 12 MHz crystal, a USB A socket, a 3.3 V voltage regulator, an LED and a couple of capacitors and resistors. In other words, only basic support components.

Next, I installed the Vinculum-II Toolchain (the development IDE) version 2.0.0 and then updated to SP1.
The IDE works ok. Especially the application wizard works well and gives you a good starting point for your own firmware by adding the necessary libraries, headers and scaffolding code based on your selection of IC, USB ports in use and required drivers.
But the IDE is Windows-only software… *sigh* I hate that. Fortunately I have my old MacBook Pro with Windows 7 on a Bootcamp partition.

To flash the compiled firmware onto the chip I used FT-Prog
and a FTDI TTL-232R-3V3 cable connected to the VNC2 as described in this application note.

Note: you don't need the VNC2 Debugger/Programmer Module to flash the VNC2 – the USB-to-UART cable is sufficient – even though the FTDI website states that the Debugger/Programmer module is required for initial programming.

On to the firmware itself. I did start by wasting a couple of hours by not reading the VNC2 dev board's datasheet closely enough to notice that the USB socket on the board is connected to USB port 2 and not – as I figured – port 1. After tweaking the supplied example project 'USBHostHID' and reading the documentation I pretty quickly had some firmware that did what I wanted: wait for a HID device with the specified VID/PID to be connected, read HID data, parse the data into corresponding X, Y, Rz, Z and button values and, if any values change, send the new values over the UART connection.

Here's the complete firmware project (including compiled .rom file).
And here is a sample dump of the UART output. If a line starts with a "S" it is a status message, if it starts with "E" it is an error message and otherwise it is a value update.

If you want to use this project to read data from your own joystick (and it's not a Saitek Cyborg EVO), you'll have to change:

  1. The VID/PID for the joystick:
    // find VID/PID of Saitek Cyborg EVO device
    hc_ioctVidPid.vid = 0x06a3;
    hc_ioctVidPid.pid = 0x0464;
  2. The parse_hid method to match your own joystick's HID descriptor.

3 comments on "Reading USB joystick data from Vinculum-II"
David says:

Hello,
I just work with the Vinculum 2, too an have a problem to reed out continues data. I`m using a logitech gamepad F710 and every time I can just read out one correct sequence of data, stored in the buffer for parsing, the following sequences will about with the status error 0x0a. I have no clue where the problem is. May be you have more experience and can help me to fix my problem. Thanks David

Ravi says:

Hi,

I am working with vinculum 2 device.
The interface between STM32F103 microcontroller to the camera via Vinculum2.

I need one information, i have plan implement the bootloader code fro programming the code via serial interface.
So i am unable to find the registers details in the data sheet.
If any one implemented the bootloader code for this Vinculum 2 device, could you please share with me.
It will help for my project.

Please do the post with my mail id :

Thanks and Regards
Ravi

Lordsinclair says:

Even 2016 your good report is still inspiring for starting with the VNC2 by bootloading only by UART. Also it is easy to find by searching the internet for VNC2 UART bootloader connection.
However for me it did not work so I have to use the programmer/debugger module. Now I saw that 1 year ago another person (Ravi) also didnot get it right.
My VNC2-32 (and I have 2 of them) both miss RTS signal high on IOBUS6 , pin 25. It is low . The answer from FT_PROG subsequently is "No communication possible ". For a working UART connection RTS needs to be high after VNC2 reset (that I made) .
@Jens: what was RTS at VNC2 on your successfull connection by UART ? ( I know it is too late, anyhow ...?)

Leave a Reply