Reset problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
shaoziyang

Reset problem

Post by shaoziyang » Tue Nov 21, 2006 3:34 pm

When watchdog reset a AVR_USB device, mcu will go on work after reset. Windows will lost this USB device when mcu reset, and will not find device again because D- line's resistance not change.

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

Post by christian » Tue Nov 21, 2006 4:58 pm

There are two ways to force a re-enumeration after a watchdog reset:
  1. Connect the pull-up resistor to a port pin instead of +3.3V and take this port pin low for a while during startup. The driver has provisions for this technique with the usbDeviceConnect() and usbDeviceDisconnect() macros.
  2. If you don't want to spend an additional port pin, just pull D+ and D- to low during startup and hold them low for a while. This will indicate USB Reset to the host and cause re-enumeration. Most of the reference designs use this technique.

Please note that (2) is not completely standard compliant since only the host or hub may issue USB Reset, not the device.

shaoziyang

Post by shaoziyang » Thu Nov 23, 2006 4:13 pm

I use (2), and windows will find device again. But user's PC application need to reopen USB device.

In this case, if user's software send usb_control_msg function fail, it maybe device reset or function fail.

Post Reply