<?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 Powerdown and USB in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Powerdown-and-USB/m-p/549373#M13811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bosbessenbasje on Tue Mar 25 05:22:17 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the LPC2468 to make a specific USB HID device. This HID device is bus powered and will be certified. This means that the CPU needs to go into power down mode when the PC is suspended (or in sleep mode).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the following code to do that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;PCONP &amp;amp;= ~(1UL&amp;lt;&amp;lt;14);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Disable power to USB device
INTWAKE = (1 &amp;lt;&amp;lt; 5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Allow wakeup on USB state change
PCON = (1 &amp;lt;&amp;lt; 1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Goto power down mode&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the CPU does wake up immediately. The target is not connected to a PC but to an USB power adapter, which almost immediately results in a 'SUSPENDED' state of the USB stack (which is correct). But it also means that there should be no USB activity, so there is no reason for the CPU to wakeup again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I remove the 'INTWAKE' statement, the powerdown mode is entered correctly, but the CPU does not wake on USB activity (of course not).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something I am missing here? Do I need to change some of the USB peripheral settings as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:50:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:50:27Z</dc:date>
    <item>
      <title>Powerdown and USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Powerdown-and-USB/m-p/549373#M13811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bosbessenbasje on Tue Mar 25 05:22:17 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the LPC2468 to make a specific USB HID device. This HID device is bus powered and will be certified. This means that the CPU needs to go into power down mode when the PC is suspended (or in sleep mode).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the following code to do that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;PCONP &amp;amp;= ~(1UL&amp;lt;&amp;lt;14);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Disable power to USB device
INTWAKE = (1 &amp;lt;&amp;lt; 5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Allow wakeup on USB state change
PCON = (1 &amp;lt;&amp;lt; 1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Goto power down mode&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the CPU does wake up immediately. The target is not connected to a PC but to an USB power adapter, which almost immediately results in a 'SUSPENDED' state of the USB stack (which is correct). But it also means that there should be no USB activity, so there is no reason for the CPU to wakeup again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I remove the 'INTWAKE' statement, the powerdown mode is entered correctly, but the CPU does not wake on USB activity (of course not).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something I am missing here? Do I need to change some of the USB peripheral settings as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Powerdown-and-USB/m-p/549373#M13811</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:27Z</dc:date>
    </item>
  </channel>
</rss>

