Simple generic HID example demonstrating bidirectional communication. The firmware is compatible with the AN82072 Application note of Cypress so that we could use that PC application to test the USB communication.

Dependencies:   USBDevice mbed

You are viewing an older revision! See the latest version

Homepage

13_USBHID_demo

Simple generic HID example demonstrating bidirectional communication. The firmware is compatible with the AN82072 Application note of Cypress so that we could use that PC application to test the USB communication. We send and receive 8 byte packages, however not all of this data is really used.

Input report data (received by the PC):

  • Byte0: button status (0: pressed, 1: released)
  • Byte1-Byte4: raw ADC data (32 bit, big Endian format) - actually we use only the lowest 16 bits...

Output report data (sent by the PC):

  • Byte0: LED control for LED_RED (0: off, 1: on)
  • Byte1: PWM duty cycle control for LED_GREEN (0-100: duty cycle in %)

Hardware requirements:

  • FRDM-KL25Z board
  • Analog signal (potmeter or thermometer) connected to the A0 (PTB0) analog input
  • Pushbutton connected between D3 (PTA12) and GND.
  • Socket labelled as USB shoud be connected to Computer running the Generic HID UI.exe application

Software requirements:

  • We need files Generic HID UI.exe and CyUSB.dll from package AN82072.zip

/media/uploads/icserny/05_analog_thermometer_bb.png


All wikipages