Hi, I am having problem with going from default FEI mode to FBI mode...I am using the "mcg.c" function to do this, but it always gives memory access error when it tries to write into MCG_C1 register to change CLKS bits...I didnt change the mcg.c, so I am curious why is this happening.
Could you let me know which Kinetis product you are using? With that info, I could find related Kinetis exmpale source and mcg driver, then I will test that driver on my side. Thank you for the understanding.
I do a test with KL05 source code and could get MCG works in FBI (slow irc) with below code:
//test FBI mode with slow clock
SIM_CLKDIV1 = ( 0
| SIM_CLKDIV1_OUTDIV4(0) );
mcg_clk_hz = fei_fbi(32768,SLOW_IRC);
And I could measure the PTA15 pin with 32.768KHz clock output.
Please check below attached scope copy.
For the system clock is 32.768KHz, which is too slow. At this situation, the debugger tool will lost connection.
Wish it helps.