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

Clock settings

Hi!

I am using a STR912FA44 uC and I have a working firmware at 48MHZ and I am trying to increase these freq to 96 MHZ but for some reason the device is not recognize by the PC anymore. I see that the led's blink much faster (according to the increased freq) but the usb communication is gone. This is the code:

previous definitions (working @ 48MHZ)

  SCU_MCLKSourceConfig(SCU_MCLK_OSC);
  SCU_PLLFactorsConfig(192, 25, 3);
  SCU_PLLCmd(ENABLE);
  SCU_MCLKSourceConfig(SCU_MCLK_PLL);

  SCU_AHBPeriphClockConfig(__VIC, ENABLE);
  SCU_AHBPeriphReset(__VIC, DISABLE);
  /*USB clock = MCLK= 48MHz*/
  SCU_USBCLKConfig(SCU_USBCLK_EXT);
  /*Enable USB clock*/
  SCU_AHBPeriphClockConfig(__USB, ENABLE);
  SCU_AHBPeriphReset(__USB, DISABLE);
  SCU_AHBPeriphClockConfig(__USB48M, ENABLE);
  /* Enable and configure the priority of the USB_LP IRQ Channel*/
  VIC_DeInit();

New Code (working @96 MHZ but USB com not working)

  SCU_MCLKSourceConfig(SCU_MCLK_OSC);
  FMI_Config(FMI_READ_WAIT_STATE_2,FMI_WRITE_WAIT_STATE_0, FMI_PWD_ENABLE,FMI_LVD_ENABLE,FMI_FREQ_HIGH);
SCU_PLLFactorsConfig(192, 25, 2);
  SCU_PLLCmd(ENABLE);
  SCU_MCLKSourceConfig(SCU_MCLK_PLL);

  SCU_AHBPeriphClockConfig(__VIC, ENABLE);
  SCU_AHBPeriphReset(__VIC, DISABLE);
  /*USB clock = MCLK= 48MHz*/
  SCU_USBCLKConfig(SCU_USBCLK_EXT);
  /*Enable USB clock*/
  SCU_AHBPeriphClockConfig(__USB, ENABLE);
  SCU_AHBPeriphReset(__USB, DISABLE);
  SCU_AHBPeriphClockConfig(__USB48M, ENABLE);
  /* Enable and configure the priority of the USB_LP IRQ Channel*/
  VIC_DeInit();

Thanks a lot for all your help and wish a great 2009!

Parents Reply Children
  • Since you are running at 96Mhz, have you tried setting your USB clock source to the PLL/2 as opposed to a external USB clock source? And/Or have verified in some way that you are indeed running the USB clock from an external source.

    The idea is that maybe you thought you were running from an external clock, but in reality you were using the master clock which just so happend to be the desired 48Mhz.

    These are just some idea's to try and help you debug this as I am not familiar with your device.