Loading ...
Sorry, an error occurred while loading the content.

USB deivce interface testing

Expand Messages
  • madhavi.......
    Hi, Working on AT91SAM9xe testing USB device interface I am initializng the USB controller void MyUSBD_Init() { unsigned int status,abc; int i;
    Message 1 of 1 , Oct 21, 2013
    • 0 Attachment


      Hi,
      Working on AT91SAM9xe testing USB device interface

      I am initializng the USB controller

      void MyUSBD_Init()
      {
      unsigned int status,abc;
      int i;
      AT91C_BASE_UDP->UDP_ICR = AT91C_UDP_RXRSM;
      AIC_ConfigureIT(AT91C_ID_UDP, 0, USBD_InterruptHandler);
      AIC_EnableIT(AT91C_ID_UDP);

      AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_UDP;
      AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP;

      AT91C_BASE_UDP->UDP_TXVC |= AT91C_UDP_PUON; //pull-up
      printf("Drive Pull-up");

      }

      After the initialization i get a END of bus reset interrupt which i sevice in the
      ISR as follows:

      In ISR


      // End of bus reset
      else if ((status & AT91C_UDP_ENDBUSRES) != 0)
      {
      print("End of Bus Reset ");
      // The device enters the Default state
      deviceState = USBD_STATE_DEFAULT;
      AT91C_BASE_UDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS;
      UDP_ResetEndpoints();
      UDP_DisableEndpoints(); //disbale all endpoints except endpoint 0
      printf("\nCalling configure EP0 ") ;
      USBD_ConfigureEndpoint(0);

      // Flush and enable the Suspend interrupt
      AT91C_BASE_UDP->UDP_ICR = AT91C_UDP_WAKEUP
      | AT91C_UDP_RXRSM
      | AT91C_UDP_RXSUSP;
      AT91C_BASE_UDP->UDP_IER = AT91C_UDP_RXSUSP; //enable usb
      suspend interupt

      //// Enable the Start Of Frame (SOF) interrupt if needed
      //if (pUsb->pCallbacks->startOfFrame != 0) {
      //
      // AT91C_BASE_UDP->UDP_IER = AT91C_UDP_SOFINT;
      //}

      // Invoke the Reset callback
      USBDCallbacks_Reset(); ///does nothing

      // Acknowledge end of bus reset interrupt
      AT91C_BASE_UDP->UDP_ICR = AT91C_UDP_ENDBUSRES;

      }
      // Endpoint interrupts

      but after servicing EOB intr i get no response from host

      With Best Regards,
      Madhavi Mane


      Get your own FREE website, FREE domain & FREE mobile app with Company email.  
      Know More >
    Your message has been successfully submitted and would be delivered to recipients shortly.