<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic USB device detect host attach/detach in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-device-detect-host-attach-detach/m-p/558960#M15719</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fancypants on Thu Jun 11 15:51:38 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all - I'm developing a high-speed usb 2.0 device (not host or on-the-go) on an LPC4350. It is self-powered. I'm trying to reliably detect when the host attaches and/or detaches (i.e. cable plugged in or unplugged). Attaching is pretty straightforward - it receives a usb suspend and/or reset event (SLI and/or URI). However, detecting detach isn't as straightforward. VBUS is attached to USB0_VBUS (protected so it doesn't power while the mcu isn't powered).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I've got a some questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is it possible to monitor VBUS status via the OTGSC register? So far my experiments with this doesn't appear fruitful: the "A" status bits don't seem to reflect proper state, and the "B" status bits sort-of do, but I've also been able to get false positives from them. In any case, they don't seem to be reliable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Is it possible to depend on getting a suspend or reset event (SLI and/or URI)? So far my experiments show that it is possible that pulling the usb cable fast enough sometimes doesn't register any SLI or URI interrupts - BUT the CCS bit in PORTSC1 is clear (but the user manual says " It does not state the device being disconnected or suspended").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess, ultimately my question is: via the usb registers, is there a way to detect disconnect from host? How?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:44:11 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:44:11Z</dc:date>
    <item>
      <title>USB device detect host attach/detach</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-device-detect-host-attach-detach/m-p/558960#M15719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fancypants on Thu Jun 11 15:51:38 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all - I'm developing a high-speed usb 2.0 device (not host or on-the-go) on an LPC4350. It is self-powered. I'm trying to reliably detect when the host attaches and/or detaches (i.e. cable plugged in or unplugged). Attaching is pretty straightforward - it receives a usb suspend and/or reset event (SLI and/or URI). However, detecting detach isn't as straightforward. VBUS is attached to USB0_VBUS (protected so it doesn't power while the mcu isn't powered).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I've got a some questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is it possible to monitor VBUS status via the OTGSC register? So far my experiments with this doesn't appear fruitful: the "A" status bits don't seem to reflect proper state, and the "B" status bits sort-of do, but I've also been able to get false positives from them. In any case, they don't seem to be reliable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Is it possible to depend on getting a suspend or reset event (SLI and/or URI)? So far my experiments show that it is possible that pulling the usb cable fast enough sometimes doesn't register any SLI or URI interrupts - BUT the CCS bit in PORTSC1 is clear (but the user manual says " It does not state the device being disconnected or suspended").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess, ultimately my question is: via the usb registers, is there a way to detect disconnect from host? How?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-device-detect-host-attach-detach/m-p/558960#M15719</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: USB device detect host attach/detach</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-device-detect-host-attach-detach/m-p/558961#M15720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For USB0 as device, OTGSC bit 11 BSV (B-session valid) should do it. For USB1 as device, OTGSC won't help, you may have to route VBUS to a pin interrupt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2016 21:15:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-device-detect-host-attach-detach/m-p/558961#M15720</guid>
      <dc:creator>Dezheng_Tang</dc:creator>
      <dc:date>2016-10-07T21:15:50Z</dc:date>
    </item>
  </channel>
</rss>

