Shop OBEX P1 Docs P2 Docs Learn Events
Propeller as a Windows Human Interface Device? — Parallax Forums

Propeller as a Windows Human Interface Device?

Ron CzapalaRon Czapala Posts: 2,418
edited 2014-06-18 08:27 in General Discussion
I saw something about a version of the Arduino called the Leonardo which
has built-in USB communication, eliminating the need for a secondary processor. This allows the Leonardo to appear to a connected computer as a mouse and keyboard, in addition to a virtual (CDC) serial / COM port

More details are here

Looks interesting, I wonder how we could make a Propeller board enumerate as a Window HID device.

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 08:32
    Well, if you look up a comparison of Arduinios, the Leonardo is just about the same as the Uno.. they all have the USB port that can use the keyboard and mouse from your PC. But it apparent;ly does do some fancy shifting around of serial and USB ports.

    On the other hand, the Propeller has always been able to support a PS2 keyboard and mouse directly or connect to your PC via USB port or RS232 to take input from the keyboard or mouse. Plus the Propeller can include color TV or VGA video at the same time. And the Propeller can provide additional serial ports separate from the USB.

    I am not up to speed on the HID keyboard and mouse deployment. But I suspect the Propeller can do the same. What exactly are you hoping to create as "Human Interface Device"? A touch screen? A joystick?
    +++++++
    It is a bit embarrassing to say this, but it seems like a bit of promotional hype on someone's part. Of course the idea with Arduino is to get you to buy one of each, whereas the Propeller can morph into new uses by firmware changes. That is what the OBEX is all about.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-06-14 09:17
    ...

    I am not up to speed on the HID keyboard and mouse deployment. But I suspect the Propeller can do the same. What exactly are you hoping to create as "Human Interface Device"? A touch screen? A joystick?

    What interested me was the ability to plug it into a Windows PC and have it automatically detected as a HID device (using the installed driver of course) rather than just a USB Serial Port like the FTDI chips.

    Maybe most of the magic is in creating the driver but the Leonardo is doing some tricky stuff as well:
    Just as your computer creates an instance of the serial port driver when you plug in any Arduino, the Leonardo/Micro creates a serial instance whenever it runs its bootloader. The board is an instance of USB's Connected Device Class (CDC) driver.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 10:19
    Windows has a habit of being very tricky about drivers. I am not sure there is much to this on the Leonardo side that couldn't be done with the Propeller. But the hardest part of doing so is to break through all the Windows jargon and Arduino jargon to figure out what you really require to fed the HID services in Windows.

    Taking control of cursor movement and the mouse buttons is all on the Windows side. Feeding keyboard serial through is even easier. But having to read Microsoft or Arduino documentation with an eye towards conversion to generic code for the Propeller takes some effort.

    The Propeller does have an evolve USB object that might allow you to provide an identifying code that would mate with the Windows HID to call up the right driver. But I am a Linux guy... this stuff is poison to my mind.
  • GenetixGenetix Posts: 1,754
    edited 2014-06-14 14:36
    Ron,
    Do you have a particular application in mind or did you just find this new feature interesting? Microchip has had microcontrollers with a built in USB interface for years.
    I still remember an engineer gripeing about USB because it requires extra code while straight serial is easy to implement.

    Why do you even need a PC, because as the Propeller Demo Board demonstrates, you can make your own mini PC.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-06-14 14:48
    Genetix wrote: »
    Ron,
    Do you have a particular application in mind or did you just find this new feature interesting? Microchip has had microcontrollers with a built in USB interface for years.
    I still remember an engineer gripeing about USB because it requires extra code while straight serial is easy to implement.

    Why do you even need a PC, because as the Propeller Demo Board demonstrates, you can make your own mini PC.

    I was thinking along the lines of using a propeller to provide keystrokes or mouse movements to a Windows application.

    For example, a propeller could directly input data values to a PC program by simulating a keyboard or draw using a PC graphics program with the propeller sending mouse movements....

    See time 1:20 in this video
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-06-14 17:51
    The Leonardo uses a different type of USB chip that conforms as a HID device. But, as I recall, you still need a driver. And for Windows 8, you apparently need an inf file. So it's not as seemless as it would seem.

    I've always found the Leonardo very finicky. Maybe they've improved the firmware, but it's not just an Arduino Uno that can also act as a mouse or keyboard. Great idea, but lacking implementation. I'd be happy to hear they've made it better. I threw away the one I got.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-06-14 17:59
    The Leonardo uses a different type of USB chip that conforms as a HID device. But, as I recall, you still need a driver. And for Windows 8, you apparently need an inf file. So it's not as seemless as it would seem.

    I've always found the Leonardo very finicky. Maybe they've improved the firmware, but it's not just an Arduino Uno that can also act as a mouse or keyboard. Great idea, but lacking implementation. I'd be happy to hear they've made it better. I threw away the one I got.

    Yeah, there are a lot of negative comments on the product page on Sparkfun - including troubles uploading a sketch.

    Like you said, good idea though. I'd like to see a Propeller approach (without the associated problems of the Leonardo).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-14 18:22
    I'd like to create a custom mouse. I considered getting a Leonardo since I also had heard it can be used as a HID. After reading so many negative comments about the Leonardo on this thread, I think I'll look for other alternatives.

    I'd think getting the Propeller to act as a HID would be easier than getting it to act as a USB host. Scanlime showed the Propeller can act as an USB host. Three of the last four links in post #14 of my index are to USB host on Propeller pages.

    I'm pretty sure Micah overclocked the Propeller with a 6MHz crystal to get the USB host code to work.

    It would be great if the Prop could act as a HID device but the USB stuff intimidates me. I'm interested in any microcontroller which would make it easy for a device to appear as a normal USB mouse to Windows. I'm hoping to create a custom mouse which can be plugged into a Windows PC without requiring the PC to install special drivers.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2014-06-14 18:36
    Windows boxes still accept Microsoft serial mice as input devices.

    You might be able to get the computer to accept the Propeller as a Microsoft mouse by using the serial data packet format.

    http://www.kryslix.com/nsfaq/Q.12.html

    I'll a longshot, but it's probably more realistic than trying to get the Propeller to work as a USB HID device.

    Jeff
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-15 01:47
    Microsoft historically has supported any and all comers in proprietary device drivers as a means to sustain Windows popularity. Any gadget for a personal computer seems to have a Windows driver, but not all are Linux compatible as the makers don't want to have their code become open-source.

    Needing an inf file gets off into that side of their business and may actually be only possible if MS licenses you developer software that will let you do this. I am pretty sure this gets you all tangled up in fitting somewhere into the Windows Registry scheme. MS is big on justifying this all as better security. So I don't expect them to provide an open HID device INF just for hobbyist to explore their software. They are trying to make things more secure, not less so.

    On the other hand, there is no Registry in Linux; so this is easily done with a Propeller, Arduino, or many other microcontrollers. Or you can even set aside a Propeller and just use an IR Remote control as a HID-like device. Generic USB is not a problem.

    Here is an example of what you can easily do......
    My Cubieboard is a LInux OS device and has the IR reciever already provided. So I am fooling around with getting it to work as a music server that is controlled from IR Remote and will allow me to select from radio stations over the world wide web, or play loaded MP3 files. There are repositories for a complete digital jukebox that will handle input from the IR remote, but I am working one something more basic. I'd also like to be able to play CDs via the remote as well.
  • RDL2004RDL2004 Posts: 2,554
    edited 2014-06-15 05:34
    Needing an inf file gets off into that side of their business and may actually be only possible if MS licenses you developer software that will let you do this. I am pretty sure this gets you all tangled up in fitting somewhere into the Windows Registry scheme. MS is big on justifying this all as better security. So I don't expect them to provide an open HID device INF just for hobbyist to explore their software. They are trying to make things more secure, not less so.

    Unless Microsoft changed things completely just for Windows 8, an .inf file is just a simple text file that anyone can make. They are more of a security problem than a fix. I believe they are actually blocked by default on Windows 7.
  • ercoerco Posts: 20,256
    edited 2014-06-15 07:18
    The Leo was a cost-reduced version of the popular UNO which did away with the FTDI chip and used a single processor for everything. Clever bit of engineering, but it introduced a few conflicts and limitations which made it harder to use, for beginners anyway. A bit like a company after a layoff, where some people have two jobs to do. :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-15 09:45
    RDL2004 wrote: »
    Unless Microsoft changed things completely just for Windows 8, an .inf file is just a simple text file that anyone can make. They are more of a security problem than a fix. I believe they are actually blocked by default on Windows 7.

    That seems easy enough. But if the Windows Registry tracks the number of INF files that are created properly in an install process and you add one by some other route, you just may find yourself shut out of your computer with some cryptic message about file corruption. MS does this to assure that the OS doesn't get further corrupted if a hostel hack has inserted something. Of course a repair software application would just dump the INF you inserted and you are back to square one.

    I have no idea what Windows 8 is doing and barely use the Windows 7 that I have.
  • GenetixGenetix Posts: 1,754
    edited 2014-06-16 11:21
    Microsoft makes quite a bit of money training and certifying people on each of their new products.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-16 11:48
    I don't usually weigh in on these threads, but I think we're getting overly complicated about drivers and certifications. If a device is programmed to appear as a generic HID device then those drivers are in Windows and there are no special drivers required. It is a simple request really and I understand the value in having it. I believe there was someone who made some USB drivers for the Propeller at one time. I think I even have them stored somewhere. I just don't know if they've been tested.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-17 21:25
    I believe there was someone who made some USB drivers for the Propeller at one time.

    Are you thinking of Micah's work (mentioned in post #9)?

    As far as I know she wrote USB host code. I don't know how applicable the code is towards making a HID device.

    Here are some links to Micah's work.

    OBEX
    Forum Thread
    Scanlime's Website
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-17 21:39
    Chris Savage has a very good point.. go generic.

    Both AVR and PIC have USB internal to micro-controllers, but I have completely avoided the use of any of these as it adds a whole additional dimension to the creation of what is a rather simple serial interface. These tend to be available for the consumer electronics that desire to have everything in one chip and a USB device that will generate its own special identity code.

    I somewhat dislike the USB port. It often can be completely set aside. I much prefer a straight RS232, RS485 or RS422 connection into my PC.

    Micah has writen Host code, and maybe some slave code. It is a good place to start if you really want to learn all and everything about USB.
  • jazzedjazzed Posts: 11,803
    edited 2014-06-17 21:48
    All the leaves are brown, and the sky is gray.
    I've been for a walk on a winter's day. ....

    http://forums.parallax.com/showthread.php/97328-USB-toys-to-play-with?p=675656#post675656
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-17 23:02
    jazzed wrote: »
    All the leaves are brown, and the sky is gray.
    I've been for a walk on a winter's day. ....

    http://forums.parallax.com/showthread.php/97328-USB-toys-to-play-with?p=675656#post675656

    Thank you jazzed. Brad's thread didn't turn up when I did a search about a week ago. His code looks like it might do the trick.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-06-18 05:06
    Duane Degn wrote: »
    Thank you jazzed. Brad's thread didn't turn up when I did a search about a week ago. His code looks like it might do the trick.

    I also found that thread a couple of days ago but my initial search attempts did not reveal it. I wish the search feature was more robust!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-18 08:27
    Duane Degn wrote: »
    Are you thinking of Micah's work (mentioned in post #9)? As far as I know she wrote USB host code. I don't know how applicable the code is towards making a HID device.

    Here are some links to Micah's work.

    Hmmm, I didn't think it was host drivers. But with my memory these days anything is possible. I would have thought if it was host drivers I would have related it to the Vinculum where there's a hardware solution already. To be honest I don't remember and I could not locate the old ZIP archive I thought I had.

    A USB object that makes a PC think the Propeller is a generic HID device would open up all kinds of potential.
Sign In or Register to comment.