mk20dx128.c for (n=0; n<10; n++) ;

Status
Not open for further replies.

Frank B

Senior Member
I don't understand this:

Is this not optimized away ?

mk20dx128.c
Code:
	for (n=0; n<10; n++) ; // TODO: why do we get 2 mA extra without this delay?

Perhaps asm volatile ("nop") is better(?)

Frank
 
Last edited:
I see that when my library goes into BLPI it leaves the Clock Out Pin using OSCERCLK0 and instead of using LPO clock. Haven't tried that yet but since I dropped going into VPLR mode in my new library I'll try to figure it out to get that elusive 1mA. The USB stuff is not even intialized when compiling at 2MHZ right? I'm wondering if its the order in starting the clocks? Maybe selecting the fast IRCS before setting the MCG OUT clk to internal ref, thats how I did it. I'll play around with this maybe I'll stumble on to something.
 
Status
Not open for further replies.
Back
Top