Combine two USB HID devices into one

Thread Starter

Wrath

Joined Jun 26, 2010
17
Hi I would love some help with a project I came up with

I been doing some research for the past few days trying to work out a way of combining the data from two HID devices into one eg. a gamepad and a mouse or two joysticks etc. so it appears as its one device.
I want to be able to configure and remap the buttons/axis relitively easily. I was thinking this would be done via a 'man in the middle' setup, like a USB dongle that would have 2 USB inputs for devices and a USB output to plug into a computer or console. for ease of use it should be powered by the USB VCC and be programable via pluggin it into the USB port of a PC.

Is it possible to merge the data from two sources together and relay it to a PC/Console with a single HID discriptor? what hardware is needed?

My electronics knowledge is somewhat limited as this will be my first foray into microcontrollers but I am eager to learn and any info will be appreciated.

Thanks
 

sceadwian

Joined Jun 1, 2009
499
There's no need to do this, HID devices have to be configured by software, and there's no reason the software can't use two devices so there's no need for a man in the middle, simply map whatever you want your software to use from the devices attached to the system. If you hunt around the net long enough I'm sure you can find HID mapping software as well in case you want to adapt this to existing software.

This isn't a project to get your feet wet with, working with USB is not a walk in the park, especially if in your case you think you want to implement both host and device controllers. I'd say bugger it all and use the right software on the PC to begin with and you should be all set.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
What about consoles. you can't change the software. I want to be able to use the console controller with another device like a mouse or a joystick with full control of key maps and axis. essentially tricking the console into thinking its a controller plugged into the usb port but it can be what ever HID or combination of HIDs I choose.

is it possible to do this with hardware and firmware?

sorry I didn't really outline my project well in the first place now that I read it.
 

retched

Joined Dec 5, 2009
5,207
Well that makes a big difference.

Maybe you should tell us exactly what you want, and we can tell you the best way to go about it.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Basically im thinking off a intergrated USB host and client circuit that recieves the data from two HID devices where it can then be modified (buttons remapped etc.) via firmware and then placed under a single HID class discriptor sent out through the client hardware as if it were one USB HID device to the console.

Well at least I think thats how to go about it! with a host and client together. HIDs ---> Host/client --->console

I know the HIDs convert the anologue signal from the ases, buttons etc. into a digital stream and send it to the host so do I have to convert back to an analogue signal input for the microcontroller or is it possible to just modify the digital data and just 'repackage' it under the one HID descriptor

I hope someone understands me, I don't even know if I do anymore:confused:
 

sceadwian

Joined Jun 1, 2009
499
Take a look at the Viniculum USB modules, that might be your best bet, They support host and slave USB connections and have a built in micro controller to write firmware. You'd have to go through the learning curve of the hardeware and even worse the learning curve of creating USB connections, but since you're limiting yourself to HID compliant devices it's possible, just a lot of work.


http://www.vinculum.com/
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
I have been doing alot of research into USB and HIDs thankfully there is alot of info on this subject and it doesn't seem to difficult for the HID side of things. I do have some programming knowledge and I feel confident of being able to sort out the firmware.

The issue is with the hardware. I don't know which direction to take or the best way to get two USB hosts and a slave onto a single circuit the simplest and most reliable way

I read all the info on the vinculum modules and they sound like a step in the right direction with the two intergrated USB ports. I was thinking I could setup both ports as hosts to recieve data and output through one of the I/O pins but would I then have to send it to another MCU to act as a slave or can I output from the vinculum chip as a slave with some firmware trickery?
 

sceadwian

Joined Jun 1, 2009
499
That's what I'm not sure of, the Viniculm only has two ports, but I don't know what you can do with a hub, I don't know what it's device limitations in software are. If you want more than what a single Viniculm can offer it's easy, use two, or more. The MCU portion supports modern high speed interfaces so you could have multiple modules talking to each other, but you'll really have to get your hands on a module and sit down and play with coding it. Try starting off with a simpler mapper, one HID in (host), one HID out (slave) and remap the original signal, doesn't have to 'do' anything just an exercise to familiarize yourself.

From what little research I've done on USB the Viniculum modules are as easy as you're going to get, a single module won't put you back much and there are plenty of resources on Viniculums website about programming and setting up the existing firmwares for basic functionality, you can take it as far as you want from there. If I'm not mistaken the inbuilt MCU on the Viniculum modules are on par with most modern micro controller architectures so writing your own firmware with the resources they supply is probably your best bet to start with. It's going to be a LOT to take in though.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Well I like a challenge! As long as it can actually be done and not require a huge complex cuircuit I'm willing to put the time and effort in.

I did plan on getting a development board and starting out small to learn the basics of generic USB HID I just need to know which direction to go in hardware wise. I was looking at Audrino boards.

One thing that concerns me with the vinculum is drivers. I have had problems installing FTDI drivers before. Will a viniculum chip support a plug and play HID device for plugging into a console?
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
To read your devices you'll need two host capable ports, and an additional port to act as a device for your PC.

Sounds to me like you might have better luck writing a software layer on your PC that performs the task.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
I don't want to run the system through a PC, I want to just be able to plug the device into the console and the 2 HIDs into the device and away you go.

I was thinking of looking into setting it up as a USB hub but does a hub receieve data that can be read or does it just pass on the data streams to the pc?

Would it be possible to use a viniculum, setup with the 2 USB ports as hosts to provide enumeration to the devices, recieve the data streams then output the data from both devices by SPI or UART to a microcontrller where the buttons etc. Can be remapped and then sent out as a single slave?
 
Last edited:

Thread Starter

Wrath

Joined Jun 26, 2010
17
Ok can someone tell me if this setup will work:

a vinculum VDIP2 board with the two USB ports set as hosts to recieve data from two HID devices, the data then outputed via the I/O bus to a microcontroller where the firmware combines the data from the two devices under a single device descriptor then sends it on to a vinculum VNC1L chip which is setup as a USB slave and it talks to the console as if it where one generic HID device.

Am I getting close?
 

sceadwian

Joined Jun 1, 2009
499
uhh... the circuit will likely end up having more complexity than you're comfortable with =) Believe me you will put dozens or hundreds of hours into this.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Obviously I'm simplifying the circuit alot but I'm just trying to work out how it can be done and just looking for a little guidance from some more experienced minds.

Is it possible with that hardware setup or am I going about it the wrong way?
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Thanks GetDeviceInfo for the response!

The only reason I'm going with the hardware approach is because I'm interfacing with a console so I won't be able to do anything software wise. Which is why Im also concerned about the vinculum being able to support a generic HID class ie. Joystick and it working in the console PnP. I havnt been able to confirm this yet.
 

sceadwian

Joined Jun 1, 2009
499
Wrath
http://www.vinculum.com/
It's text searchable on Viniculums main page..
Connect USB Flash drives to MCUs via the Vinculum's UART, SPI or parallel FIFO interfaces. Connect USB device classes including Mass Storage Class, Printer Class and HID Class devices, or even FTDI's own range of USB-UART and USB-FIFO ICs to an embedded system.
And that's not the most modern version of the chip.
If it uses USB you can do it, you just have to put the effort forward to learn how to write the code on the firmware side of the Viniculum.
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Ok I'm going to give it a go. I've been researching non stop for a few days now and I now have a general understanding of where I'm going with this. I will do a couple of smaller USB projects first to get a grasp of it. Any recomendations for development kits?

Oh and I was looking at combination devices. From what I have read it's a USB device with one address but with 2 endpoints. Can I use this for what I Want to achieve?
 

Thread Starter

Wrath

Joined Jun 26, 2010
17
Im just drawing up a some schematics as we speak. what microcontroller will be best suited to this task?
 
Top