Hi Customer,
Your code is wrong, you didn't check ICS_S[IREFST] bit, please refer to the following code:
ICS->C2 |= ICS_C2_BDIV(0x01);
SIM->BUSDIV = 0x01U;
ICS->C2 = (uint8_t)((ICS->C2 & (uint8_t)~(uint8_t)(
ICS_C2_BDIV(0x07) |
ICS_C2_LP_MASK
)) | (uint8_t)(
ICS_C2_BDIV(0x00)
));
OSC->CR = (OSC_CR_OSCEN_MASK | OSC_CR_OSCOS_MASK | OSC_CR_RANGE_MASK);
ICS->C1 = (ICS_C1_CLKS(0x00) | ICS_C1_RDIV(0x03) | ICS_C1_IRCLKEN_MASK);
while((ICS->S & ICS_S_IREFST_MASK) != 0x00U) {
}
while((ICS->S & 0x0CU) != 0x00U) {
}
Wish it helps you!
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------