Shop OBEX P1 Docs P2 Docs Learn Events
Prop-2 USB HID Connections to a Host Device? — Parallax Forums

Prop-2 USB HID Connections to a Host Device?

Working with USB communications at the "bare-metal" level presents many challenges. Many of us have looked for a way to turn a Propeller-2 MCU into a Human Interface Device (HID) such as a keyboard or mouse. Sad to say, you'll need a different MCU that has a USB "peripheral" interface already installed and a library of many USB functions. The USB protocol is complicated and even "simple" projects fail. I know from experience.

Chip suppliers such as Cypress (Infineon), Atmel, Microchip, and NXP offer USB "enabled" MCUs. They may provide application notes and example code

Here there is a good keyboard-emulation example for Arduino Leonardo, Micro, or Due boards:

https://docs.arduino.cc/built-in-examples/usb/KeyboardMessage

As far as I know, no USB HID library exists for Propeller chips. I recommend the book, "_USB Complete, 5th edition," by Jan Axelson as an excellent guide to all things USB.

Comments

  • @JonTitus said:
    As far as I know, no USB HID library exists for Propeller chips.

    We host-side HID for both P1 and P2. Someone's also made a CDC device with some of the same USB code (too lazy to find latest link rn). HID device is a lot simpler than HID host, so I think writing a HID device library would be quite easy, someone just needs to do it.

  • @JonTitus said:

    As far as I know, no USB HID library exists for Propeller chips. I recommend the book, "_USB Complete, 5th edition," by Jan Axelson as an excellent guide to all things USB.

    Why exactly do you recommend this book? Isn't this the cut-and-paste job of a book where she reveals she knows nothing about USB and then just refers you to a commercial product USB solution?

    I also thought even her serial port book was a big load of fluff too. Tons and tons of filler and then not even the most basic and most important information you would need to know-- how to enable the serial port components in Visual Studio at the time.

    A joke.

  • You criticize, but fail to offer an alternative solution. What would you recommend?

  • See BradC's 'california dreaming' demo for the P1, which sends keystrokes to the PC using a lean HID implementation

    While this is for P1, I don't think it would be hard to port it to P2

  • The other code that currently works as CDC, but could be adapted to HID, is this from SaucySoliton

  • Hi, Tubular,

    Do you have a link to "BradC's 'california dreaming' demo for the P1, which sends keystrokes to the PC"? --Jon

Sign In or Register to comment.