Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Micrium provides a demo application that lets you test and evaluate the class implementation. Source files are provided for the device (for μC/OS-II and μC/OS-III only). Executable and source files are provided for the host (Windows only).

Note that the demo application provided by Micriµm is only an example and is intended to be used as a starting point to develop your own application.

Set Up the PHDC Demo Application

On the target side, you should compile the application file, app_usbd_phdc.c , with your project. This file is located in the following folder:

\Micrium\Software\uC-USB-Device-V4\App\Device\

The demo application allows you to send and receive different QoS levels for data transfers. All transfers sent by the host application is received using a single receive task. While all transfers sent by the device are handled using one or several transmit tasks assuming one QoS level per transmit task. You can have several tasks transmitting data with the same QoS. When several transmit tasks are used, you may enable the RTOS QoS-based scheduler to prioritize the transfers by their QoS latency. 

Several constants are available to customize the demo application on both device and host (Windows) side.  describe device side constants that are located in the app_cfg.h or  app_usbd_cfg.h file.  describe host side constants that are located in the app_phdc.c file.

Since Microsoft does not provide any specific driver for PHDC, you will have to indicate to windows which driver to load using an INF file. The INF file will ask Windows to load the WinUSB generic driver (provided by Microsoft). The application uses the USBDev_API, which is a wrapper of the WinUSB driver (refer to the USBDev_API page).

Windows will ask for the INF file (refer to the About INF Files section) the first time the device will be plugged-in. It is located in the following folder:

\Micrium\Software\uC-USB-Device-V4\App\Host\OS\Windows\PHDC\INF

Once the driver is successfully loaded, the Windows host application is ready to be launched. The executable is located in the following folder:

\Micrium\Software\uC-USB-Device-V4\App\Host\OS\Windows\PHDC\Visual Studio 2010\exe

Running the PHDC Demo Application

In this demo application, you can ask the device to continuously send data of different QoS level and using a given periodicity. Each requested transfer is called an “item”. Using the monitor, you can see each transfer’s average periodicity and standard deviation. The monitor will also show the data and opaque data that you specified. At startup, the application will always send a default item with a periodicity of 100 ms. This item will send the device CPU usage and the value of a counter that is incremented each time the item is sent. The default item uses low latency / good reliability as QoS.  shows the demo application at startup.

At this point, you have the possibility to add a new item by pressing 1. You will be prompted to specify the following values:

  • Periodicity of the transfer: the period at which the transfer will attempt to occur.
  • QoS (Latency / reliability) of the transfer: the type of QoS desired for this transfer.
  • Opaque data (if QoS is not low latency / good reliability): the opaque data that will be included in this transfer.
  • Data: the actual data that will be transferred.

shows the demo application with a few items added.

Once an item has been added, the application provides statistics about every transfer. From left to right, there is the item’s number, the type of QoS, the ideal period, the mean period value, the standard deviation value and the opaque data/data. The mean and standard deviation values are calculated by the host application, based on a sampling of the actual period value obtained for every single transfer.

  • No labels