Quote Originally Posted by Christopher4187 View Post
Robert,

The .jpg file you attached can be caused by many issues but from my experience, there are two that come to mind. One, is the capacitor value, which has been widely discussed in this post. The second, is enumeration during the first part of the program. I had one program I wrote a while ago that was very long and two problems can occur from that. Like someone else said, you have to service the USBSERVICE at least every 10 milliseconds (I think). The other part of the problem is having the device enumerate and I had problems due to my code. I put a simple loop at the beginning of my program which looks something like this:

USBInit

for T=1 to 15000

usbservice
pauseus 100
next T

On this specific program, I got the exact same error as you did. My device enumerated correctly about once every 20 tries. When I put this loop in there, it enumerated 100% of the time.

I hope this helps.

Chris
Very sorry to bring up an old post but I've done a lot of searching, head scratching, hardware alterations, firmware alterations etc etc and I still can't get to the bottom of this problem....

I have exactly this problem as described above by Chris and solved it in the same way too. I just can't get my head around why it is happening. I simply can't get my device to enumerate correctly without this loop that he's posted above. With this loop it works fine, but I'm wondering if there's a better way to do it? Something like LOOP until the "Enumerated Correctly" flag is set inside the PIC? Obviously there's not a flag in the PIC called this - that would make it far too easy ;-).

Has anyone else had to perform this kind of loop to enable correct enumeration of the USB?

Again, apologies for bringing this up

P.s. the USBService is being actioned by a timer every 10ms and is being started after this loop

Cheers

Rob