Using the Curie as a USB slave HID?

Discussion in 'UDOO X86' started by Eric Falsken, Aug 31, 2017.

  1. Eric Falsken

    Eric Falsken New Member

    Joined:
    Apr 25, 2017
    Messages:
    19
    Likes Received:
    3
    For my project, I was looking at using a stack like LUFA to program the embedded Curie to appear as an HID USB Keyboard. I want to program it to read the GPIOs to trigger key-presses in the host OS. Probably with a Muxer shield to get a few more i/o. (I need about 30 for what I'm doing)

    I know that some Arduino Uno and all of the Leonardo can appear as a programmable USB device (like keyboard). Can the Curie/101?

    Has anyone seen a tutorial or code sample?
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    It appears not. I believe because the Curie has 2 CPU's and the CPU that is controlling the USB is not the CPU that is doing I/O. They (Intell) did not make firmware to support this function. There is a Curie BLE HID library somehere that simulates a keyboard over Bluetooth but quality unknown. See also:
    https://www.udoo.org/forum/threads/genuino-101-to-control-keyboard-solved-but-contentions.7709/

    Does your programm on the OS only accepts keyboard presses or can you reprogram it to accept characters from USB directly? Because then you can Curie send those characters to the USB with Serial.print()
     
    ccs_hello likes this.
  3. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    Read the text output from the Arduino and insert them into the OS's event system?
     
  4. Eric Falsken

    Eric Falsken New Member

    Joined:
    Apr 25, 2017
    Messages:
    19
    Likes Received:
    3
    I guess I could use serial, but I was hoping to take advantage of DMA or Interrupt signaling rather than serial I/O and buffering. HID Game Controller would be closer to my intention. I have an external board that is currently doing the I/O, I was hoping to consolidate it onto the Udoo to reduce my power and space requirements.
     
  5. tuxun

    tuxun Member

    Joined:
    Dec 20, 2013
    Messages:
    67
    Likes Received:
    12
    idea 1)
    "what about plug an Atmel32u4 board on your curie serial already enabled controller?"

    The atmega32u4 is the second chip on arduino uno (Ok i'm simplifying).

    This chip usually handle usb to serial connection via CDC protocol and In Circuit "Serial" (again? Really? not sure :D ) Programming (ISCP) for part talking with arduino main chip, but you can reprogram it to handle HID on USB (instead of CDC on USB) and still use ICSP/SERIAL for curie talk)

    Maybe more clear, on a UNO with PC
    CPU->USB->atmel32u->serial->main_arduino_chip
    on the UDOO
    CPU->CURIEchip1dontTOUCH->CURIE_MAINCPU
    well you could do:
    CPU->CURIEchip1dontTOUCH->CURIE_MAINCPU
    +
    CPU->USB->HIDatmel32u4->serial->CURIE_MAINCPU
    use that arduino functions https://www.arduino.cc/en/Reference/MouseKeyboard
    maybe with a board like that...
    https://www.sparkfun.com/tutorials/337


    idea 2) just destroy a usb keyboard :)

    http://archives.funlab.fr/MakeyMakey_DIY
    (OMG I just notice it is.. uh... was... a working keyboard that I repaired before somes mates ruin it for science, look, it has red 3D printed feets!)
    This solution has the advantage to be other computer-plugable easily but as reverse solder 30 pair of wire can quick become a mess
     
    Last edited: Sep 2, 2017
  6. Eric Falsken

    Eric Falsken New Member

    Joined:
    Apr 25, 2017
    Messages:
    19
    Likes Received:
    3
    I'm using my Udoo x86 to build a mini arcade cabinet. I already had a small USB controller for the joystick and buttons, but I wanted to simplify it into a shield to reduce the space and power requirements. I'll probably have to leave it as a separate board for now. I'm currently using one of these Picade PCB boards. and I wanted to consolidate.
     
  7. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  8. Eric Falsken

    Eric Falsken New Member

    Joined:
    Apr 25, 2017
    Messages:
    19
    Likes Received:
    3
    yup. The buffering necessary to read serial input means that it will have some annoying latency issues. It also means that I have to have a daemon or process running on the host system to do the reading. I was hoping to use an off-the-shelf distro or build..... thus the USB-HID. The less custom coding on the Udoo Host OS, the better.
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580

Share This Page