<?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 Making USB-1 work on LPC1837 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Making-USB-1-work-on-LPC1837/m-p/548298#M13618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have seen couple of folks asking this question, and even this was a question me until I debugged the issue. I have chosen usbd_rom_hid_keyboard example for explaining. This example uses USB0 for demonstrating HID_Keybaord functionality.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make the same example to work with USB-1, we need the following changes.&lt;/P&gt;&lt;P&gt;1) comment "#define USE_USB0" in app_usbd_cfg.h file&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #678509;"&gt;/* #define USE_USB0 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;2) Enable clock for USB-1, I have defined the following function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;/**&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;* @brief enables power for USB1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;* @return Nothing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #303030;"&gt;void pwrEnable_USB1(){&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; /* Setup GPIOs for USB demos */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_SCU_PinMux(0x2, 6, (MD_PUP | MD_EZI), FUNC4); /* P2_6 USB1_PWR_EN, USB1 VBus function */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_SCU_PinMux(0x2, 5, (MD_PLN | MD_EZI | MD_ZI), FUNC2); /* P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_GPIO_WriteDirBit(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] = USB1_PWR_EN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_GPIO_WritePortBit(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] output high */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #303030;"&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call the above function in &lt;STRONG&gt;hid_main&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Board_Init();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #eb7a3d;"&gt;pwrEnable_USB1();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* enable clocks and pinmux */&lt;/P&gt;&lt;P&gt;USB_init_pin_clk();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2016 07:30:39 GMT</pubDate>
    <dc:creator>gvk51</dc:creator>
    <dc:date>2016-06-20T07:30:39Z</dc:date>
    <item>
      <title>Making USB-1 work on LPC1837</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Making-USB-1-work-on-LPC1837/m-p/548298#M13618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have seen couple of folks asking this question, and even this was a question me until I debugged the issue. I have chosen usbd_rom_hid_keyboard example for explaining. This example uses USB0 for demonstrating HID_Keybaord functionality.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make the same example to work with USB-1, we need the following changes.&lt;/P&gt;&lt;P&gt;1) comment "#define USE_USB0" in app_usbd_cfg.h file&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #678509;"&gt;/* #define USE_USB0 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;2) Enable clock for USB-1, I have defined the following function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;/**&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;* @brief enables power for USB1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;* @return Nothing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #303030;"&gt;void pwrEnable_USB1(){&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; /* Setup GPIOs for USB demos */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_SCU_PinMux(0x2, 6, (MD_PUP | MD_EZI), FUNC4); /* P2_6 USB1_PWR_EN, USB1 VBus function */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_SCU_PinMux(0x2, 5, (MD_PLN | MD_EZI | MD_ZI), FUNC2); /* P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_GPIO_WriteDirBit(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] = USB1_PWR_EN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&amp;nbsp; Chip_GPIO_WritePortBit(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] output high */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #303030;"&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call the above function in &lt;STRONG&gt;hid_main&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Board_Init();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #eb7a3d;"&gt;pwrEnable_USB1();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* enable clocks and pinmux */&lt;/P&gt;&lt;P&gt;USB_init_pin_clk();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 07:30:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Making-USB-1-work-on-LPC1837/m-p/548298#M13618</guid>
      <dc:creator>gvk51</dc:creator>
      <dc:date>2016-06-20T07:30:39Z</dc:date>
    </item>
  </channel>
</rss>

