For a project I prefer lowering the CPU clock so that my Teensy4.1 runs cooler, and may live a longer life.
So in IDE I went Tools, CPU Speed, and picked 150 from the drop down list of options.
When I check what my CPU clock then is with a
Then its says:
F_CPU_ACTUAL is 151200000 Hz or 151.20 MHz
Is that normal? Is F_CPU_ACTUAL what the frequency in Hz really is, as a measurement using some other time reference like the 24 MHz system clock? Or is it a calculation what it would be given that 24 MHz Teensy crystal is probably 24.00000000000 MHz and PLL nominator/denominator values are as loaded in PLL when booting?
Background: I have a precise elapsed time to be sensed in software using CYCCNT that normally runs at 600 MHz, but will run slower. At 150.000 MHz or at 151.2 MHz - that's what I'm not quite too sure about anymore now... How many ns per CYCCNT tick when 150 is picked in the IDE/Tools/CPU_Speed list of options? And is that number available as a global variable double or uint32 maybe?
So in IDE I went Tools, CPU Speed, and picked 150 from the drop down list of options.
When I check what my CPU clock then is with a
Code:
Serial.printf ("F_CPU_ACTUAL is %ld Hz or %1.2f MHz ", F_CPU_ACTUAL, (double)F_CPU_ACTUAL/1E6);
Then its says:
F_CPU_ACTUAL is 151200000 Hz or 151.20 MHz
Is that normal? Is F_CPU_ACTUAL what the frequency in Hz really is, as a measurement using some other time reference like the 24 MHz system clock? Or is it a calculation what it would be given that 24 MHz Teensy crystal is probably 24.00000000000 MHz and PLL nominator/denominator values are as loaded in PLL when booting?
Background: I have a precise elapsed time to be sensed in software using CYCCNT that normally runs at 600 MHz, but will run slower. At 150.000 MHz or at 151.2 MHz - that's what I'm not quite too sure about anymore now... How many ns per CYCCNT tick when 150 is picked in the IDE/Tools/CPU_Speed list of options? And is that number available as a global variable double or uint32 maybe?