USB Library
Device - CDC Basic Demo

Supported Demo Boards 

The matrix of which demos are supported on a specific board can be found in the Release Notes demo board support section. Verify that the board you wish to use will work with this demo. This table also describes some of the limitations that the board might have while running this demo. 

Demo Board I/O Mapping 

Each demo board has a different number of push buttons, LEDs, and other features with various different names for these components. To determine which board features are used for which demo features, please refer to the io_mapping.h file in the demo folder under the system_config folder. Each demo board will have a corresponding folder with an io_mapping.h file in it. For example, for the PIC18F46J50 PIM this would be the following file: 

<install_directory>/apps/usb/device/cdc_basic/firmware/src/system_config/pic18f46j50_pim/io_mapping.h 

For more information about each demo board, please refer to the Demo Board Information section

Demo Operation 

This demo allows the device to appear like a serial (COM) port to the host. In order to run this demo first compile and program the target device. Please see the following Windows, Linux, and Macintosh sections for how to connect to the device on each of these systems. 

Once connected to the device, there are two ways to run this example project. Typing a key in the terminal window will result in the device echoing that key plus one. So if the user presses “a”, the device will echo “b”. If the pushbutton is pressed the device will echo “ – Button Pressed – “ to the terminal window.

Note: Some terminal programs, like hyperterminal, require users to click the disconnect button before removing the device from the computer. Failing to do so may result in having to close and open the program again in order to reconnect to the device. 

Topics
Name 
Description 
Attach the device to the host. If the host is a PC and this is the first time you have plugged this device into the computer then you may be asked for a .inf file.

Select the “Install from a list or specific location (Advanced)” option. Point to the “<Install Directory>\USB Device - CDC – Basic Demo\inf\win2k_winxp” directory.

Once the device is successfully installed, open up a terminal program, such as hyperterminal. Select the appropriate COM port. On most machines this will be COM5 or higher. 
Upon plugging in a USB CDC ACM virtual COM port device into a Linux machine, the OS will automatically enumerate the USB device successfully, and a new object should show up as:
/dev/ttyACMx
(where ttyACMx is usually ttyACM0, but could be some other number such as ttyACM1, if some other ACM device is already attached to the machine).
To determine the exact number value of “x”, a procedure like follows can be used:
1. Open a console.
2. Make sure the USB device has been plugged into the machine.
3. Type: lsusb
4. You should see a line like: Bus... more 
Upon plugging in a USB CDC ACM virtual COM port device into a Mac OS X based machine, the OS should automatically enumerate the USB device successfully, and a new object should show up as:
/dev/tty.usbmodemXXXX
(where XXXX is some value, such as “3d11”)
To run the example demo project: “USB\Device - CDC - Basic Demo” on a Mac OS X based machine, a procedure like follows can be used:
Open TERMINAL. This can be done by clicking SPOTLIGHT and searching for TERMINAL. Spotlight is the little magnifying glass in the upper right of the screen.
In Terminal, with the... more 
MLA - USB Library Help Version : 2.16
http://www.microchip.com/mla