USB CDC Library Details

Permits to read data from and write data to USB devices using the CDC protocol (makes the USB device look like a serial port). Intended for See the section "Interface" in file "USB_CDC_Library.mpas" and the demo project (see below) for the operation details.

Two versions are available:
The user interface for both is the same: ping ponging functionality is hidden for the user.

Important: For each project using the USB CDC library, a separate version of "USB_CDC_ProjectItems.mpas" should be available (it is "used" by the USB CDC library), residing the the project's directory itself. The libary itself ("USB_CDC_Library.mpas" or "USB_CDC_PP2_Library.mpas") can of course reside in a directory common for all projects.

No knowledge of the so called USB "descriptors" required. These "USB descriptors" are embedded in the library and adapted according the product dependant defined by the user (in the file "USB_CDC_ProjectItems.mpas").

Based on "Microchip USB C18 Firmware Version 1.3" and application note AN956.


Example project: CDC Example for P24.

In the example projects holds:
- characters sent to the PIC via USB are echoed via USB
- sending a '-' to the PIC stops echoing, while sending a '+' restarts it
- sending a '*' to the PIC makes the PIC send 256 kB characters to the PC (used in the PC tool "TestCDC, Speed test PIC -> PC", see below)
- sending a '%' to the PIC makes it receive 256kB characters from the PC (used in the PC tool "TestCDC, Speed test PC -> PIC", see below)

PC side software:
TestCDC.zip , TestCDC executable + sources (Delphi).
usbser.sys and usbser.inf. The .inf file resides in "C:\Windows\inf", the .sys file resides in "C:\Windows\Windows32\drivers".

Do not forget to adapt the usbser.inf file if you use another VID or PID for your USB product than in the example files. Every time you install (plug in) a CDC device with a new VID/PID combination, windows will give it a comportnumber that was not used before, so the used number always increases. If you want you can change it to a more acceptable number using the windows 'device manager'. Portnumbers already taken can be found in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports.

Important: In all USB documentation the words "IN" and "OUT" are frequently used to indicate the direction of data transfer. Those directions are always "USB host" (e.g. PC) related.
So, "IN" means data from the PIC to the host (data OUT from PIC point of view), "OUT" means data from the host to the PIC (data IN from PIC point of view).


-------------------------------------------