AnsweredAssumed Answered

USB clock initialization when CPU CLock = 150MHz.

Question asked by arnogir on Jan 6, 2017
Latest reply on Jan 9, 2017 by arnogir

Hello,

 

I'm tis K70 150MHz.

 

By default, Bus Clk is 120MHz in MQX.

for that, in init_gpio.c, _bsp_usb_io_init, the USB clock is initialised like this:

 

      /* Configure USB divider to be 120MHz * 2 / 5 = 48 MHz */
       SIM_CLKDIV2_REG(SIM_BASE_PTR) &= ~(SIM_CLKDIV2_USBFSDIV_MASK | SIM_CLKDIV2_USBFSFRAC_MASK);
       SIM_CLKDIV2_REG(SIM_BASE_PTR) |= SIM_CLKDIV2_USBFSDIV(4) | SIM_CLKDIV2_USBFSFRAC_MASK;

 

Now, I change CLock configuration to have Bus Clock to 150MHz.

So If I keep this USB init, USB clock will be 50MHz instead of 48Mhz which is the maximum USB frequency.

 

But When I change SIM_CLK2 register FSDiv and FSFrac to adapt frequency to lower, USB not work!

I test many value.

Exemple:

        SIM_CLKDIV2_REG(SIM_BASE_PTR) &= ~(SIM_CLKDIV2_USBFSDIV_MASK | SIM_CLKDIV2_USBFSFRAC_MASK);
        SIM_CLKDIV2_REG(SIM_BASE_PTR) |= SIM_CLKDIV2_USBFSDIV(4) ;

 

To obtain 150Mhz * 1 / 5 = 30MHz, but not work!

 

Are they a value which work with 150MHz busClock??

Thank

Outcomes