Anonymous
Not applicable
May 03, 2011
06:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 03, 2011
06:42 AM
I'm using the USBUART component from app note EP60246 but the question might also be valid for other USB interfaces.
Everything works fine until the USB cable to the PC is unplugged. Now USBUART_bGetConfiguration() still reports a non-zero value. If I replug the PC and try to write to it USBUART_Write() fails to return.
How can I detect the unplug and reconnect and reinitialize my USBUART component when possible?
Thanks
Labels
- Labels:
-
PSoC 5LP
1 Reply
Anonymous
Not applicable
May 04, 2011
05:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 04, 2011
05:31 AM
- This can be done in two ways.
- Method1: A simple and easy way would be to monitor VBUS supply voltage. Place a Digital Input Pin on the TopDesign and connect it to the USB VBUS. Once you disconnect PSoC from PC there is no voltage on VBUS, the same can be used to ascertain device unplugged from host. Once VBUS power comes back, USB device can be re-enumerated again.
- Method 2: The USBFS component can be configured to bring out the SOF terminal which is the USB start of Frame signal. The same can be monitored and the inactivity on this terminal implies no host is connected.
Let us know if one of these work.