How to modify the "CDC - Basic Demo - Firmware" sample for the GPIB->USB adapter. Since the Microchip example code is owned by Microchip it is best not to redistribute it to avoid possible legal issues. I therefore distribute my own additions and instructions how to incorporate it into the Microchip sample code. To get started, install MPLAB (Unless you have already done so) and install the latest version of the MCHPFSUSB Framework. It normally installs under C:\Microchip Solutions\, under there you find "USB Device - CDC - Basic Demo" and under there "CDC - Basic Demo - Firmware" which is the starting point for thix exercise. Make a copy of the entire "CDC - Basic Demo - Firmware" folder at the same level and call it something like "CDC - Basic Demo - Firmware GPIB" Follow the instructions in Pic2550.txt to modify the project (USB Device - CDC - Basic Demo - C18 - PICDEM FSUSB) for PIC2550 Copy in the provided files and add them to the project: gpib.c gpib.h - GPIB Routines ProcessIo.c - Replacement for the ProcessIo() routine in main.c ProcessIo.h - Header file for above Modify the following files: HardwareProfile.h: Add the following two lines below the line "#include "HardwareProfile - PICDEM FSUSB.h"" #elif defined(__18F2550) #include "HardwareProfile - PICDEM FSUSB 2550.h" main.c 1. Comment out or delete the entire ProcessIo() function. 2. Add the following lines below "InitializeSystem();": string_offset=0; Verbose = 0; 3. Add the following variables under the "Variables section" char string[64]; volatile BOOL Verbose; unsigned char string_offset; 4. Add the line below, last in function InitializeSystem(void) gpib_init(); This will leave a lot of dead and redundant code, but the removal of that is left as an excercise for the reader. Links: http://www.lvr.com/usb_virtual_com_port.htm For signalling Define USB_CDC_SUPPORT_DSR_REPORTING Change void CDCNotificationHandler(void) so that SerialStatePacket.SerialState.byte = 0x02; or fudge in HardwareProfile - PICDEM FSUSB 2550.h: #define UART_DTS PORTBbits.RB4 #define UART_DTR LATDbits.LATD3 #define UART_RTS LATAbits.LATA2 #define UART_CTS PORTAbits.RA3