This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB hid examples don't work on LPC2387

Hello.

I have a SK-MLPC2387 board with LPC2387 processor and here some problem with it. I downloaded Keil HidUsb examples for LPC2378 and loaded it (hex file) in LPC2387 using latest version of FlashMagic utility (ISP). The loading was sucessfully finished and veryfied, then I disconnected board. When I connected the board again (after ~ 20 sec), operation system (Win 7) didn't find new device looks like USB cable was disconnected. The power LED is on, and I don't know where source of problem..

Parents
  • Aha, forget to format the code

    usbhw.c

    void USB_Init (void) {
       ...
       ...
      /* The SoftConnect pin for LPC2300 on USB_U1 doesn't work for now,
         make it GPIO and make it low to turn off pull-up on D+.
             Once it's fixed, make #if 1 and set it as SoftConn Pin. */
    //#if 1                                     /* MCB2300 V4.0                 */
    #if 0                                     /* MCB2300 V4.0                 */
      PINSEL4 &= ~0x000C0000;                 /* P2.9 USB1 SoftConnect        */
      PINSEL4 |=  0x00040000;                 /* PINSEl4 18.19                */
    #else                                     /* MCB2300 V3.0                 */
      PINSEL4 &= ~0x000C0000;
      FIO2DIR |= (1 << 9);
      FIO2CLR  = (1 << 9);
    #endif
       ...
       ...
    
    
    void USB_Connect (BOOL con) {
    //  WrCmdDat(CMD_SET_DEV_STAT, DAT_WR_BYTE(con ? DEV_CON : 0));
      if ( con )
         FIO2SET  = (1 << 9);
      else
         FIO2CLR  = (1 << 9);
    }
    

    Tsuneo

Reply
  • Aha, forget to format the code

    usbhw.c

    void USB_Init (void) {
       ...
       ...
      /* The SoftConnect pin for LPC2300 on USB_U1 doesn't work for now,
         make it GPIO and make it low to turn off pull-up on D+.
             Once it's fixed, make #if 1 and set it as SoftConn Pin. */
    //#if 1                                     /* MCB2300 V4.0                 */
    #if 0                                     /* MCB2300 V4.0                 */
      PINSEL4 &= ~0x000C0000;                 /* P2.9 USB1 SoftConnect        */
      PINSEL4 |=  0x00040000;                 /* PINSEl4 18.19                */
    #else                                     /* MCB2300 V3.0                 */
      PINSEL4 &= ~0x000C0000;
      FIO2DIR |= (1 << 9);
      FIO2CLR  = (1 << 9);
    #endif
       ...
       ...
    
    
    void USB_Connect (BOOL con) {
    //  WrCmdDat(CMD_SET_DEV_STAT, DAT_WR_BYTE(con ? DEV_CON : 0));
      if ( con )
         FIO2SET  = (1 << 9);
      else
         FIO2CLR  = (1 << 9);
    }
    

    Tsuneo

Children