Problems with usb 2.0 hosts

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Zak
Posts: 4
Joined: Wed Apr 11, 2007 1:48 pm

Problems with usb 2.0 hosts

Post by Zak » Wed Apr 11, 2007 2:02 pm

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?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Apr 11, 2007 3:17 pm

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.

Zak
Posts: 4
Joined: Wed Apr 11, 2007 1:48 pm

Post by Zak » Wed Apr 11, 2007 5:14 pm

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.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Apr 11, 2007 7:00 pm

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.

Guest

Post by Guest » Wed Apr 11, 2007 10:06 pm

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.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Apr 11, 2007 11:33 pm

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-.

Zak
Posts: 4
Joined: Wed Apr 11, 2007 1:48 pm

Post by Zak » Thu Apr 12, 2007 6:31 pm

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?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Apr 12, 2007 7:28 pm

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.

Zak
Posts: 4
Joined: Wed Apr 11, 2007 1:48 pm

Post by Zak » Fri Apr 13, 2007 11:38 am

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.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Fri Apr 13, 2007 12:07 pm

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.

Post Reply