Page 1 of 1

LED to Indicate address assigned

Posted: Tue May 27, 2008 4:39 am
by TomH
Greetings.

I want to have a LED that indicates USB connected, now the address assigned hook USB_SET_ADDRESS_HOOK() is perfect for turning it on, but what would be a good event for turning it OFF, say if the USB cable is unplugged?

I suspect that this would involve sensing no USB activity, similar to Suspend mode. I suppose that I could just use the 5V from the USB cable, no cable = no LED!

TomH

Posted: Wed May 28, 2008 5:31 pm
by christian
Yes, you can sense the USB power. If you check for USB activity, the LED would go off when the hosts goes into suspend mode and not go back on when it awakes because there's no new enumeration.

You should also turn it off when USB Reset is detected.