Electronic – Problems with CDC Device Class

picserialuartusb

I'm using the Microchip 16-bit 28-pin starter board and the USB communication with the PC keeps breaking.

There are two microprocessors on the board. The application processor communicates to the USB processor via UART. The USB processor is configured as a CDC class USB device and shows up in device manager as a serial port.

The device enumerates ok and the data being transmitted from the PC to the application processor ok. The application processor is responding to the USB processor, but the response never gets to the PC.

I know the UART communications between the two processors is working ok because I'm using a BusBee to monitor the UART. I did not write the code for the USB processor (that came from Microchip). It's worked before, but I can't seem to get it working again.

Is there a tool or anything I can use to debug the USB end points on the PC?

Something like wireshark, but for USB?

Has anyone else used the 16-bit starter kit from Microchip and had similar problems?

Best Answer

The PIC UART can be picky. Did you remember to check the Frame Overrun (OERR) bit? The PIC will be unable to receive UART communications until the OERR is cleared.

EDIT: I was also thinking...perhaps you could try a sort of loopback? That is, cut the UART out of the loop, and when the PC sends anything over USB, just send it straight back. This would tell you whether the issue is with the UART or the USB side of the PIC.