Page 1 of 1

Problems with usb 2.0 hosts

Posted: Wed Apr 11, 2007 2:02 pm
by Zak
Hi. I have built device on Mega32. It's work fine on old machines with USB 1.1 controller . But on new machines with USB 2.0 controller, WinXP says "usb device not recognized". My device powered from 3.3 V source (i have same result with Vcc from 3.0 to 3.6 Volts). I've used 68 ohm resistors on D- and D+ lines, and don't used 3.6v zeners diodes.

Can anybody help me?

Posted: Wed Apr 11, 2007 3:17 pm
by christian
Do you have a scope (storage scope would be ideal) to check the wave forms and levels on D+ and D-?

If you power your AVR from 3.3V, there should be no common mode range problem. But a scope often reveals trivial problems which would otherwise be hard to find.

Posted: Wed Apr 11, 2007 5:14 pm
by Zak
Do you have a scope (storage scope would be ideal) to check the wave forms and levels on D+ and D-?

Yes, i have simple scope. I check waveforms on D+ and D-, it's looks different. On usb 1.1 machine waveforms have visually ideal fronts, and on usb 2.0 machine fronts are more longer. Levels in both cases approximately identical.

Posted: Wed Apr 11, 2007 7:00 pm
by christian
Are you sure that this is a USB 2.0 specific problem and not a problem with this particular host? The USB port of this host might be damaged, at least the low speed / full speed circuit.

Posted: Wed Apr 11, 2007 10:06 pm
by Guest
I've tried four hosts. Two hosts with USB 1.1, and two hosts with USB 2.0. On both USB 1.1 hosts my device work fine. On both USB 2.0 hosts device don't recognized. Tomorrow I'll trying more machnes and answer result here.

Posted: Wed Apr 11, 2007 11:33 pm
by christian
I can confirm that the driver itself works well with USB 2.0 hosts as well with USB 1.0 / 1.1 hosts. I would suspect either a hardware problem or something in the firmware which interfers with the driver, e.g. by modifying the status of D+ and D-.

Posted: Thu Apr 12, 2007 6:31 pm
by Zak
I check in addition two machines (with USB 1.1 and 2.0), result is same. I used USB 1.1 cable, maybe USB 2.0 cable will help?

Posted: Thu Apr 12, 2007 7:28 pm
by christian
I doubt that it's the cable -- this is low speed USB anyway.

You must be violating the USB standard somehow. USB 2.0 controllers are more modern and may therefore enforce better standards compliance.

I can assure you that the driver itself is good enough for compatibility with all host controllers and hubs we have heard about so far.

Posted: Fri Apr 13, 2007 11:38 am
by Zak
I solve problem. I call usbPoll() function too rarely. I just add usbPoll() calls into my long funclions, and all works fine. Thanks for help.

Posted: Fri Apr 13, 2007 12:07 pm
by christian
You should call usbPoll() at least every 50 ms (see documentation in usbdrv.h). You may get away with longer intervals after the device enumeration is completed, though.

If you call usbPoll() from other places than the main loop, you should be aware that usbFunctionSetup(), usbFunctionRead() and usbFunctionWrite() are called from usbPoll(). If such a long running function is called by (e.g.) usbFunctionSetup(), you may get recursions which are hard to control.

You may also get undesired effects if usbPoll() calls any of your usb*() functions, thereby modifying global variables. The long running function may not expect this side effect.