电表量测:USBD+_2这个PIN的电平,怎么调都拉不起来.<br /><br />void USB_Init (void) {<br /><br /> <br /> OTG_STAT_CTRL=3;<br /><br /> PINSEL0 &= ~0x3C000000; /* P0.29 USB1_D+, P0.30 USB1_D- */ <br /> PINSEL0 |= 0x14000000; /* PINSEL1 26.27, 28.29 */<br /><br /> PINSEL1 &= ~0xC0000000;<br /> PINSEL1 |= 0x40000000; <br /> <br /> PINSEL3 &= ~0x30000000; /* P1.18 GoodLink, P1.30 VBus */<br /> PINSEL3 |= 0x20000000; /* PINSEL3 4.5, 28.29 */<br /><br /> /* The SoftConnect pin for LPC2300 on USB_U1 doesn't work for now, <br /> make it GPIO and make it low to turn on pull-up on D+. <br /> Once it's fixed, make #if 1 and set it as SoftConn Pin. */<br />#if 0<br /> PINSEL4 &= ~0x000C0000; /* P2.9 USB1 SoftConnect */<br /> PINSEL4 |= 0x000040000; /* PINSEl4 18.19 */<br />#else<br /> //PINSEL4 &= ~0x000C0000;<br /> FIO0DIR |= (1 << 14);<br /> FIO0CLR = (1 << 14);<br />#endif<br /><br />// while(1);<br /> PCONP |= 0x80000000; /* USB PCLK -> enable USB Per. */<br /><br /> OTG_CLK_CTRL = 0x12; /* Dev clock, AHB clock enable */<br /> while ((OTG_CLK_STAT & 0x12) != 0x12);<br /> while(1);<br /> VICVectAddr22 = (unsigned long)USB_ISR; /* USB Interrupt -> Vector 22 */<br /> VICVectCntl22 = 0x01; /* USB Interrupt -> Priority 1 */<br /> VICIntEnable = 1 << 22; /* Enable USB Interrupt */<br /><br /> DEV_INT_EN = DEV_STAT_INT; /* Enable Device Status Interrupt */<br /><br />#if 1 /* Partial Manual Reset since Automatic Bus Reset is not working */<br /> USB_Reset();<br /> USB_SetAddress(0);<br />#endif<br />} |
|