Content originally posted in LPCWare by sinhapra on Thu Aug 07 13:11:35 MST 2014
I am working on USB Host controller and below are the pin configuration that i use and Usbhw init()
PINSEL1 &= ~0x3C000000; /* P0.29 USB1_D+, P0.30 USB1_D- */
PINSEL1 |= 0x14000000; /* PINSEL1 26.27, 28.29 */
PINSEL3 &= ~((3<<4) | (3<<6) | (3<<12) | (3<<22));
PINSEL3 |= ((1<<4) | (2<<6) | (2<<12) | (2<<22)); //GPIO for PPWR1
PCONP |= (1UL << 31); /* Enable USB interface power/clock */
USBClkCtrl |= 0x1F; /* Enable Host, OTG and AHB master clk*/
for (tout = 100; ; tout--) {
if ((USBClkSt & 0x1F) == 0x1F) /* Wait for clocks enabled */
break;
if (!tout)
return (__FALSE);
}
//USBPortSel =0;
/* Port 2 is used for USB host */
//USBPortSel &= ~0x01; /* Enable Port 2 as Host port */
VICVectPriority22 = 0; /* Set USB int highest priority */
VICVectAddr22 = (U32)USB_IRQHandler; /* Set interrupt vector */
After doing all these changes and trying many other combination the LPC2387 doesn't work.
Is there anyone who tell me what I am missing something here..?
It looks like LPC2387 doesn't turn USB controller ON.
Please guide..