Does the NuMicro® family provide the flag to check and ensure the internal clock is stable?
Posted: 24 Mar 2017, 15:15
Yes, all the series except the NUC1xxAN series provide the flag, OSC22M_STB, in the CLKSTATUS register to ensure the internal (HIRC) clock is stable.
Please refer to the related Technical Reference Manual for further information.
Please add the following marked code after the internal clock is enabled.
Case 1:(All series except NUC1xxAN series)
while(SYSCLK->CLKSTATUS.OSC22M_STB == 0); // Check if (HIRC) clock is stable or not
Case 2:(NUC1xxAN series)
DrvSYS_Delay(5000); // Add delay to make sure (HIRC) clock is stable
Please refer to the related Technical Reference Manual for further information.
Please add the following marked code after the internal clock is enabled.
Case 1:(All series except NUC1xxAN series)
while(SYSCLK->CLKSTATUS.OSC22M_STB == 0); // Check if (HIRC) clock is stable or not
Case 2:(NUC1xxAN series)
DrvSYS_Delay(5000); // Add delay to make sure (HIRC) clock is stable