#if defined(__IMXRT1062__)
extern "C" uint32_t set_arm_clock(uint32_t frequency);
#endif
void setup() {
while ( !Serial);
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
// put your setup code here, to run once:
#if defined(__IMXRT1062__)
TimeDiff();
TimeDiff();
set_arm_clock(240000000); // comment here to get full speed
TimeDiff();
[B] set_arm_clock(110000000); // comment here to get full speed[/B]
TimeDiff();
set_arm_clock(24000000); // comment here to get full speed
TimeDiff();
set_arm_clock(600000000); // comment here to get full speed
TimeDiff();
set_arm_clock(130000000); // comment here to get full speed
TimeDiff();
set_arm_clock(110000000); // comment here to get full speed
TimeDiff();
set_arm_clock(24000000); // comment here to get full speed
TimeDiff();
set_arm_clock(600000000); // comment here to get full speed
TimeDiff();
[B] set_arm_clock(24000000); // comment here to get full speed
[/B] TimeDiff();
set_arm_clock(600000000); // comment here to get full speed
TimeDiff();
[B] set_arm_clock(150000000); // [COLOR="#FF0000"]EDITED - this was missing a 0 and was asking for 15 not 150 MHz giving F_CPU=16200000 below[/COLOR]
[/B] TimeDiff();
TimeDiff();
Serial.printf("\n DONE \n \t F_CPU=%u", F_CPU_ACTUAL );
Serial.printf( "\tdeg C=%u\n" , (uint32_t)tempmonGetTemp() );
#endif
}
static uint32_t t0;
void loop() {
// put your main code here, to run repeatedly:
}
void TimeDiff() {
#if defined(__IMXRT1062__)
Serial.printf("\n F_CPU=%u", F_CPU_ACTUAL );
Serial.printf( "\tdeg C=%u\n" , (uint32_t)tempmonGetTemp() );
#endif
while (!(millis()>(t0+1000)));
t0=millis();
uint32_t t1=micros(), t2=millis();
delay(50);
Serial.printf("\t50ms delay:: %u us and %u ms", micros()-t1, millis()-t2);
}