All I want is to be a USB HID slave device
Skywise711
Posts: 37
I've been turning my brain to mush pouring over the various threads from over the years (that I can find) regarding USB communication and the Propeller. And it's making my head spin (pardon the pun). In no small part because the solutions I find are way overkill. Everyone is trying to make a USB host.
All I want is low speed HID slave device communication. That's all my device will be.
I don't need all the fancy USB host capabilities, because I'm nothing but a slave device with a single minded purpose.
I don't need full or high speed, because I'm nothing but an HID device with little data to transfer, like a keyboard, or mouse, or joystick. Besides, I "think" that's all an HID device can be anyway, if I understand USB specs correctly?
The purpose is for more input to flight simulator software. The software can map upwards of 1600 buttons to whatever function. I just need a few more buttons than my joystick provides. I want to make such a box of buttons.
Eventually I want to be able to have more sliders/pots as well.
I've also looked at FTDI chips, but from what I read they all want to be hosts. I can not seem to confirm from documentation that I can use one as a slave HID device.
At 1.5mbits the Prop should surely be fast enough to do this "relatively" simple task. But everyone seems hell bent on being full blown full speed host controllers.
And, I have yet to wrap my head around the USB specifications enough to try something on my own.
Any pointers?
Brian
All I want is low speed HID slave device communication. That's all my device will be.
I don't need all the fancy USB host capabilities, because I'm nothing but a slave device with a single minded purpose.
I don't need full or high speed, because I'm nothing but an HID device with little data to transfer, like a keyboard, or mouse, or joystick. Besides, I "think" that's all an HID device can be anyway, if I understand USB specs correctly?
The purpose is for more input to flight simulator software. The software can map upwards of 1600 buttons to whatever function. I just need a few more buttons than my joystick provides. I want to make such a box of buttons.
Eventually I want to be able to have more sliders/pots as well.
I've also looked at FTDI chips, but from what I read they all want to be hosts. I can not seem to confirm from documentation that I can use one as a slave HID device.
At 1.5mbits the Prop should surely be fast enough to do this "relatively" simple task. But everyone seems hell bent on being full blown full speed host controllers.
And, I have yet to wrap my head around the USB specifications enough to try something on my own.
Any pointers?
Brian
Comments
http://forums.parallax.com/showthread.php/97027-California-Dreamin
Personally, I think USB HID doesn't seem to be a job that the Propeller is suited for. (and I love the Propeller) There are several non-prop, inexpensive solutions to this.
Jeff
I had found that thread, and looked at Brad's code. It's pretty dang close to what I need. It just has two complications: it's copyrighted, and he admits it's not USB compliant. Those may cause problems for commercial possibilities.
I'll concentrate on looking for an external chip of some kind, then.
Brian
So clearly it is IMPOSSIBLE for the Propeller ;-) with 8*32Bit 80/100MHz
EDIT: http://www.obdev.at/products/vusb/index-de.html
http://www.obdev.at/articles/implementing-usb-1.1-in-firmware-de.html
Unfortunately the Prop is really running at 20MHz and not a multiple of the USB 12MHz rate either. However by running the Prop at 96Mhz we end up with a 24MHz CPU speed and a nice multiple of 12MHz. So I wouldn't consider it IMPOSSIBLE as we like to say hoping that someone will take the challenge and prove us wrong, but I would consider USB a hack and a huge waste of resources to accomplish little.....normally.
I'm thinking that to be able to at least implement USB HID would be a useful addition to the Tachyon O/S, but to do this with minimal resources, as we do in Tachyon and now in V3 which I am working on I can save hub space by loading cogs from EEPROM or SD at runtime, and in this case it will be the low-level USB driver with minimal code space taken by high-level handlers. There is no reason though that this can't be incorporated in the current version either, but the cog image can only be reused for buffers (code needs to be backed up which would overwrite the source image in EEPROM), which is a bit of a waste.
forgot the 4 clocks / instruction for a second :-( ...
But 24MIns/sec is still double the AVR.
so a COG should be able to handle it.
Not that I would need it atm ...
But sure, a Tachyon COGlet feeding a USB buffer in HUB ... might be (IM)possible.
no - this would need input from the plane model ...
They have plenty of usb slave devices but I guess they are not HID.
Silabs CP2110 and CP2112 are HID devices and don't need drivers, but they can NOT be set to emulate a keyboard.
But if you can program in C# I'm pretty sure you could create a windows program to send fake keyboard presses to OS.
http://www.silabs.com/products/interface/usbtouart/Pages/usb-to-uart-bridge.aspx
Prop should be able to do this, it's just that the USB protocol with endpoints etc makes your head spin.
Probably will take 2months of fulltime programming to do this, anyone with those skills is unfortunately pretty busy with a day job.
Based on this thread, it looks like TI wrote a ready-to-go example of using the TM4C family of microcontrollers for USB HID comms. I'd strongly encourage you to pick up one of those cheap dev boards and play around with it. I've use the LM4F120 with StellarisWare (the predecessor to TM4C and TivaWare) and they're very powerful, simply, cheap boards with great software libraries. Stellaris/TivaWare is actually where I got the inspiration for PropWare.
This is their cheapest dev board I think http://www.ti.com/tool/ek-tm4c123gxl. The equivalent to my LM4F120. The only question is whether or not you can get that example project running on this dev board - the one it's written for (the 232) is a couple hundred dollars I think.
?!?? I use it !
In my Makefile, anything I put on the line COGSRC= gets put in hubram, any file on ECOGSRC= gets compiled, objcopied, and linked as an ECOG.
It could potentially save up to 14K of hubram; the most it's ever saved me is 7K, which is enough that I think many would be interested. I don't use SimpleIDE; is it a clickable option there ? I also think someone could do this in Spin without too much trouble.
Unfortunately out of stock right now......
Implementing USB in software in the Propeller is a DEAD END if you intend a commercial product. Not due to technical limitations, but due to the Vendor ID.
Anyone intending to make a USB device is *REQUIRED* to purchase a unique Vendor ID from the USB Implementers Forum, and that will cost you $5000 US Dollars.
There is no such thing as a general purpose VID that us small fry can use. If you just "pick one", you'll be stepping on someone else's VID that they paid for.
The only choice is to purchase someone else's product which implements the USB device functions you require. That company will already have their VID, and you'll just be using their device. An example are the FTDI chips.
Upon discovering this, I found various websites discussing this very problem.
It should be called "FUSB" for F U Small Business.
Oh well, another idea bites the dust.
Brian
Because I was looking into the possibility of this becoming a commercial product.
Brian
I believe Cypress also has a low cost mcu that enumerates as a driverless USB HID device. It should support SPI or I2C communication to be paired with the Propeller for button reading/mapping.
Thank you. I'll look into it.
Brian
So much for that....
http://www.cypress.com/?id=4&rID=33410
I would have to purchase a VID for commercial use.
Nice chip, though.
Brian
Must be nice for you to have five grand just laying around, eh? Maybe you can buy my VID for me?
5 grand is an effing lot of money for someone like me. I couldn't even scrape that up to buy parts for production. I'm on a seriously low budget. If I had 5 grand just laying around for something like that, I wouldn't be looking for ways of developing some small device to try to sell and EARN some money.
I'm beginning to regret even coming here asking for help. I keep getting answers to the questions I'm not asking.
Brian
On the other hand, Microchip has a fairly standard policy regarding handing out PIDs under their VID without charge. I am only vaguely familiar with their hardware, but you should be able to find products of theirs to complete you product.
http://www.microchip.com/usblicensing/Default.aspx
Thank you again, Andrew.
I've seen the Microchip form. It's a possible solution. It would mean investing in a new MCU, and learning it. But that's a much smaller investment than buying a VID.
FTDI also offers a PID service, but it doesn't look like any of their chips will do the job.
If Cypress offers a PID solution, then it just becomes a peripheral chip to the Prop I already know.
It sure would be nice if the P2 ends up with USB somehow, and if Parallax can offer a PID service. After all I've been reading about USB, it's my opinion that it would be a significant selling point. I can see why folks were clamoring for it.
Brian
How exactly does it convert HID USB traffic into 1600 buttons ?
Err, most FTDI parts are USB slaves, not Hosts ?
Why is HID so important ? Is that the only interface choice your target SW offers ?
SiLabs have CP2110 HID supported devices. and they also have CP2112 for SMBus/I2C Bridge
and Exar have XR21B1421 as HID device
http://www.exar.com/connectivity/uart-and-bridging-solutions/usb-uarts/xr21b1421/
There are Eval boards for CP211x and XR21B1421, get a couple and try them.
Build a product that somebody else wants to buy, then worry about this minutia.
see http://www.mcselec.com
but I do not now yet how they handle the VID.
since it is a good question I asked Marc the creator of BASCOM and will post the answer here.
And with BASCOM very easy to program.