how to init clock with mk02

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to init clock with mk02

Jump to solution
732 Views
jackxu
Contributor III

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

pastedImage_7.png

Hi there,

what i can set about the "fllStableDelay"

CLOCK_BootToFeeMode(g_defaultClockConfigRun.mcgConfig.oscsel, g_defaultClockConfigRun.mcgConfig.frdiv,
g_defaultClockConfigRun.mcgConfig.dmx32, g_defaultClockConfigRun.mcgConfig.drs,fllStableDelay);

Thanks in advance!

-Jack

1 Solution
537 Views
isaacavila
NXP Employee
NXP Employee

Hello Jack,

This pointer to function passes a delay function that will be executed after FLL is configured, this is done to make sure that FLL is stable after/during clock transition. If you do not want to execute any delay function, you can pass NULL pointer.

On the other hand, if you want to execute one delay function, you can use the CLOCK_FllStableDelay function as reference. This function waits for 1 ms aproximately.

static void CLOCK_FllStableDelay(void)
{
    /*
       Should wait at least 1ms. Because in these modes, the core clock is 100MHz
       at most, so this function could obtain the 1ms delay.
     */
    volatile uint32_t i = 30000U;
    while (i--)
    {
        __NOP();
    }
}

I hope this can help you!

Best Regards,

Isaac

View solution in original post

1 Reply
538 Views
isaacavila
NXP Employee
NXP Employee

Hello Jack,

This pointer to function passes a delay function that will be executed after FLL is configured, this is done to make sure that FLL is stable after/during clock transition. If you do not want to execute any delay function, you can pass NULL pointer.

On the other hand, if you want to execute one delay function, you can use the CLOCK_FllStableDelay function as reference. This function waits for 1 ms aproximately.

static void CLOCK_FllStableDelay(void)
{
    /*
       Should wait at least 1ms. Because in these modes, the core clock is 100MHz
       at most, so this function could obtain the 1ms delay.
     */
    volatile uint32_t i = 30000U;
    while (i--)
    {
        __NOP();
    }
}

I hope this can help you!

Best Regards,

Isaac