Microchip® Advanced Software Framework

Change USB speed

In this use case, the USB device is used with different USB speeds.

Setup Steps

Prior to implement this use case, be sure to have already apply the UDI module "basic use case".

Usage Steps

Example Code

Content of conf_usb.h:

#if // Low speed
#define USB_DEVICE_LOW_SPEED
// #define USB_DEVICE_HS_SUPPORT
#elif // Full speed
// #define USB_DEVICE_LOW_SPEED
// #define USB_DEVICE_HS_SUPPORT
#elif // High speed
// #define USB_DEVICE_LOW_SPEED
#define USB_DEVICE_HS_SUPPORT
#endif

Workflow

  1. Ensure that conf_usb.h is available and contains the following parameters required for a USB device low speed (1.5Mbit/s):
    • #define USB_DEVICE_LOW_SPEED
      //#define USB_DEVICE_HS_SUPPORT
  2. Ensure that conf_usb.h contains the following parameters required for a USB device full speed (12Mbit/s):
    • //#define USB_DEVICE_LOW_SPEED
      //#define USB_DEVICE_HS_SUPPORT
  3. Ensure that conf_usb.h contains the following parameters required for a USB device high speed (480Mbit/s):
    • //#define USB_DEVICE_LOW_SPEED
      #define USB_DEVICE_HS_SUPPORT

In this use case, the USB device is used with different USB speeds.

Setup Steps

Prior to implement this use case, be sure to have already applied the UDI module "basic use case".

Usage Steps

Example Code

Content of conf_usb.h:

#if // Low speed
#define USB_DEVICE_LOW_SPEED
// #define USB_DEVICE_HS_SUPPORT
#elif // Full speed
// #define USB_DEVICE_LOW_SPEED
// #define USB_DEVICE_HS_SUPPORT
#elif // High speed
// #define USB_DEVICE_LOW_SPEED
#define USB_DEVICE_HS_SUPPORT
#endif

Workflow

  1. Ensure that conf_usb.h is available and contains the following parameters required for a USB device low speed (1.5Mbit/s):
    #define USB_DEVICE_LOW_SPEED
    //#define USB_DEVICE_HS_SUPPORT
  2. Ensure that conf_usb.h contains the following parameters required for a USB device full speed (12Mbit/s):
    //#define USB_DEVICE_LOW_SPEED
    //#define USB_DEVICE_HS_SUPPORT
  3. Ensure that conf_usb.h contains the following parameters required for a USB device high speed (480Mbit/s):
    //#define USB_DEVICE_LOW_SPEED
    #define USB_DEVICE_HS_SUPPORT