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

LPC1768 USB Device Frame Interrupt

Hello

I am going to implement a USB Device using LPC1768 and I need the isochronous transfer type for my application. To this purpose I studied the keil's USBAudio example. It is written in the datasheet of the MCU that the frame interrupt is generated every 1 ms, but this interrupt occurs very much more than one time in 1 ms in USBAudio. Where am I wrong?

Parents
  • Sorry Tsuneo. I checked the crystal and It's near to XTAL pins (about 1 cm). The clock configuration of the system_LPC17xx.c (configuration wizard tab) is as follows (the crystal is 12 MHz):

    PLL1 Configuaration (USB PLL) Checked
    MSEL: PLL Multiplier Selection 4
    PSEL: PLL Divider Selection 2
    USBSEL: Divide Value for USB Clock from PLL1 0

    I added the following code in the beginning of the USB_SOF_Event to create pulses on the DAC in each SOF event:

    int flag;
    void USB_SOF_Event (void) {
    
      LPC_DAC->DACR = (flag ? 1023 << 6 : 0);
      flag ^= 1;
    }
    

    but the frequency of the generated wave is high (order of hunderd KHz). If I place such code in the beginning of the endpoint event witch is handled through DMA the frequency of the generated square wave is as expected.
    Is the problem still relative to the USB clock?

Reply
  • Sorry Tsuneo. I checked the crystal and It's near to XTAL pins (about 1 cm). The clock configuration of the system_LPC17xx.c (configuration wizard tab) is as follows (the crystal is 12 MHz):

    PLL1 Configuaration (USB PLL) Checked
    MSEL: PLL Multiplier Selection 4
    PSEL: PLL Divider Selection 2
    USBSEL: Divide Value for USB Clock from PLL1 0

    I added the following code in the beginning of the USB_SOF_Event to create pulses on the DAC in each SOF event:

    int flag;
    void USB_SOF_Event (void) {
    
      LPC_DAC->DACR = (flag ? 1023 << 6 : 0);
      flag ^= 1;
    }
    

    but the frequency of the generated wave is high (order of hunderd KHz). If I place such code in the beginning of the endpoint event witch is handled through DMA the frequency of the generated square wave is as expected.
    Is the problem still relative to the USB clock?

Children