Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
There is no way for me to check the OEER bit or setup the USB Processor as a loopback since I don't have control of that firmware. I already have the application processor echo what it receives and that is working. What would cause the OERR bit to get set? Can I clear it by resetting the USB processor? –  mjh2007 Oct 14 '10 at 15:54
    
The problem was with the UART on the USB processor. Once the UART on the USB processor had an error there was no way to reset it. The solution was to power-up the development board while holding the MCLR reset for the application processor. Then releasing the MCLR after the USB processor powered up. –  mjh2007 Oct 14 '10 at 17:04
add comment

USB Sniffing:

Windows: http://sourceforge.net/projects/usbsnoop/

Linux: http://www.linux-usb.org/tools.html

Microchip CDC:

I'm afraid that I know nothing about their official stack, but...

Over at http://dangerousprototypes.com they've been building a new Open Source PIC USB stack.

They're using it in the new single chip Bus Pirate. The Bus Pirate CDC driver is here.

Or, you can pick up the original alternative stack version here.

share|improve this answer
    
I tried using USBSnoop and every time I try to install the snooper on the device the device stops working. I can no longer connect to the COM port says bad COM port Id. –  mjh2007 Oct 14 '10 at 14:51
1  
USBsnoop seems to work with HID class devices only. I used SniffUSB (pcausa.com/Utilities/UsbSnoop) instead. –  mjh2007 Oct 14 '10 at 15:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.