USBUART reconnect | Cypress

USBUART reconnect

Summary: 1 Reply, Latest post by U2 on 04 May 2011 05:31 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
torpe's picture
5 posts

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?



uday's picture
Cypress Employee
569 posts
  • 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.

Log in to post new comments.