Author Topic: Emulating a HID  (Read 8618 times)

mike808

  • Member
  • ***
  • Posts: 2
Emulating a HID
« on: November 18, 2012, 10:42:14 pm »
Aloha! I have a ATMEGA32U4 MCU and I wanted to emulate a HID (namely a pedometer). I have third party software that already communicates with the device. I wanted the software to think my MCU is the pedometer and thus my project. I set the VENDOR_ID and PRODUCT_ID to match the pedometer. I was wondering what the next course of actions were. I assume there is some messaging going back and forth on the USB bus, but not sure how I can see/decode/debug that. Or how I can simulate the read/write from my MCU. Any suggestions/examples would greatly be appreciated.

I am using the avr-gcc tool chain to compile code for the MCU.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Emulating a HID
« Reply #1 on: November 19, 2012, 09:40:05 am »
If you are emulating an existing device, use a protocol analyzer to monitor communications with it. Then duplicate the descriptors and other communications in your device.

http://www.lvr.com/development_tools.htm#analyzers

mike808

  • Member
  • ***
  • Posts: 2
Re: Emulating a HID
« Reply #2 on: December 02, 2012, 12:28:28 am »
Not sure if it will help anyone else, but that link has some software that either is old and not compatible with current operating systems and/or are not free. A solution I got working was to use wireshark to capture and analyze USB traffic. It also is able to decode the USB packets rather than just print the hex output. Next step would be to understand the messages and what functions map to them...