1.9 Vendor Example (vendor)

This application demonstrates how to interface with a USB device using the generic host client driver. The application includes a generic client driver example for a vendor-specific USB device.

Description

This application demonstrates how to interface with a USB device using the generic host client driver. The application includes a generic client driver example for a vendor-specific USB device.

Downloading and building the application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is usb_apps_host/apps/vendor.

Following table gives the details of project configurations, target device used, hardware and its IDE. Open the project using the respective IDE and build it.

Project NameIDETarget DeviceHardware / Configuration
sam_e54_xpro.XMPLABXATSAME54P20ASAME54 Xplained Pro Board
pic32cx_sg41_curiosity_ultra.XMPLABXPIC32CX1025SG41128PIC32CX SG41 Curiosity Ultra Evaluation Board

Configuring the Hardware

SAM E54 Xplained Pro Board
  • Connect the USB device to the "TARGET USB" connector using a USB Type-A Female to micro-B male cable (This cable is not included in the kit).
  • Press the push button SW0 to toggle the LED on the USB Vendor Device.
  • The LED0 indicates the status of the push button pressed at the USB Vendor Device.
PIC32CX SG41 Curiosity Ultra Evaluation Board
  • Connect the USB device to the micro-B connector (J200) connector using a USB Type-A Female to micro-B male cable (This cable is not included in the kit).
  • Press the push button SW1 to toggle the LED on the USB Vendor Device.
  • The LED1 indicates the status of the push button pressed at the USB Vendor Device.

Running the Application

This application demonstrates the use of the Generic Host client Driver to communicate with a USB device. The application uses the USB Host layer and Generic client driver.

  1. Open the project with the appropriate IDE. Compile the project and program the target device.
  2. Connect the serial interface on the board to a PC. On the PC, launch a terminal emulator, such as Tera Term, and select the appropriate COM port and set the serial port settings to 115200-N-1.
  3. The serial terminal emulator program will display the message "APP: Waiting for device to be available".
  4. Follow the directions for setting up and running the USB device demonstration "usb_apps_device\apps\vendor".
  5. Connect the USB Device connector of the Vendor USB Device board to the USB Host Target board. Refer to the Configuring the Hardware section for any converter requirements.
  6. The serial terminal emulator program will display the message "APP: Device is available".
  7. Pressing the push button on the Host demo board will toggle the LED on the USB Vendor Device. The serial terminal emulator program will display the message "APP: Switch was pressed. Sending LED toggle command to the device.".
  8. The LED on the Host board tracks the push button pressed status on the USB Device Vendor device. Pressing the push button on the Vendor device turns on the LED on the Host board. The serial terminal emulator program will display the message "APP: Change detected in the device switch status".