Pages: [1]   Go Down
Author Topic: HID Hosting With The Vinculum VNC1L (VDIP2)  (Read 1744 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, it's a bank holiday weekend here in the UK and that means I have an extra day to do all the things I normally do on a weekend.

I had planned to entertain myself with a USB host shield, but I couldn't get one. smiley-sad So I picked up one of these instead http://www.vinculum.com/prd_vdip1.html

From what I know, the VDIP1 has one USB port connected, but also has a second port which has no connector. I have the VDIP2 which has both ports available to use.

Searching the web (and this forum), you'd find that the unit is great for usb disk access; but port 2 is also supposed to be capable of talking to other USB devices although there's a caveat stating that you'd have to write your own code to handle things like HID. Because I couldn't find any info out there, I thought I'd post and share some findings.

This isn't a beginners guide to hooking these units up to an Arduino or using the commands to access storage devices. I suppose I *might* be able to answer a few basic questions if people wanted.

Anyway...

I decided to try reading a Thrustmaster Firestorm 2 USB gamepad from my Arduino via the VNC1L. This pad is an HID device, transmitting button states through an interrupt IN endpoint. This is where we hit the first "problems" and lack of information. You'd expect to have to write code to deal with the HID class specific options etc. So I spent hours trying to figure this out... and failed. smiley-sad

Then purely by chance I noticed something strange: something was sitting on the data line from the VDIP2. Took me a few minutes to make the mental leap but then I realised, the VNC1L was receiving the interrupt transactions and sending the 'payload' to the Arduino. That data which was sitting there (and re-appearing) was the 7-byte status of all the gamepad's buttons and analogue sticks.

So now I have a very simple Arduino sketch that can use a Thrustmaster gamepad... and more importantly, proof that these Vinculum boards are good for more than just reading a USB flash drive.

Hope someone finds this informative.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh... following on from that...

I just plugged in a Keysonic USB keyboard and got it "working". Not decoding the key presses but I can see the separate keydown and keyup messages.

This device is a composite USB device - exposing two devices to the VNC1L. Device 0 is the main keyboard, and Device 1 is another keyboard but only for the 8 multimedia buttons. No problems handling both of those by setting the current device to one and checking for data; then switching the current device to the other keyboard and getting the messages from that too.
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the info.  I knew that this was theoretically possible, but I haven't been able to get reliable operation out of my VDIP1 for basic mass storage stuff (probably due in part to handshaking issues), so I never went on to more complicated USB operation.

From the datasheet(s) it seems possible to add a PS/2 keyboard (to the GPIO), add mroe serial ports (using FTDI usb/rs232 adapters), and so on.  Maybe I should dig that VDIP1 out and figure out the handshaking issues, or maybe even work out the SPI interface.

-j
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the UART mode, and found the easiest way was to connect AD2 and AD3 - bypassing the flow control etc.

Then it's just a matter of reading from the serial port (I'm using NewSoftSerial connected to AD0 and AD1) and processing carriage returns.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

VERY IMPORTANT INFO for anyone hoping to use these devices.

Wasted a good portion of the day because of a relatively simple matter. My VDIP2 came with the VDAP firmware v3.05 installed - there are lots of bugs in this version, particularly with sending USB Setup Packets from the user program/command monitor.

If you buy one, make sure you head over to http://www.vinculum.com/downloads.html and reflash it with the latest version of the firmware. Easy to do, you just save the file (renamed FTRFB.FTD onto a memory stick and plug it in to the VDIPx).

I was trying to use the force feedback on the Thrustmaster gamepad with absolutely no joy whatsoever ("Bad Command" shown when I sent an SSU)... and updating the firmware fixed it instantly.
Logged

SF Bay Area
Offline Offline
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using these devices for disk access is not too easy either. Especially in SPI mode. There are a lot of poorly documented gotchas for this product. I'd recommend against using them unless there just isn't another option. The hardware is cool but the firmware is not thought out from the perspective of someone who has to integrate it into a project.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I heard SPI is a problem - but realistically, I'm having great results from the UART mode.

Couple of niggles but given that I've only had it since friday afternoon I'm pretty impressed by what I've been able to achieve.

So far I have

  • written a library supporting all the features of a Thrustmaster USB gamepad (including force feedback).
  • got a multimedia USB keyboard working enough to establish it would.
  • achieved a quick test using a 3 gsm & mobile broadband dongle to send SMS messages. Not looked at internet communication yet...

That's not bad at all for someone who only has a passing understanding of the USB protocols.
« Last Edit: August 30, 2010, 05:16:51 pm by Eight » Logged

Pages: [1]   Go Up
Jump to: