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 the PIC18F2455/2550/4455 and 4550 PIC's or PICs with the same USB SIE.
See the section "Interface" in file "USB_CDC_Library.mpas" and the demo project (see below) for the operation details.
Two versions are available:
USB_CDC_Library.mpas: without usage of ping pong buffering (see PIC datasheet for ping pong)
USB_CDC_PP2_Library.mpas: with usage of ping pong buffering (mode2, should be faster than the non ping pong version).
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:
USB_CDC_Project_Example.zip and USB_CDC_PP2_Demo.zip (both 20 Mhz crystal used).
In both 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.
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).
-------------------------------------------