10 years, 6 months ago.

Which is the operating frequency of KL25Z used by default?

I wonder which is the default working frequency KL25Z card. You can change? As modified? Thanks in advance.

Question relating to:

3 Answers

10 years, 6 months ago.

48MHz. And yeah you can change it if you want by 'simply' changing the clock settings. However I don't think most library functions are made to take the new frequency into account.

Just as addition to Erik's answer,

here are clock settings for KL25Z , clock setup is set to 1.

https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL25Z/system_MKL25Z4.c

The mbed HAL code contain predefined clock parameters usually for calculating prescalers. Be aware.

Regards,
0xc0170

posted by Martin Kojtal 04 Nov 2013
10 years, 6 months ago.

thank you very much, had the doubt. Hey but for example would define it? ....

#include "mbed.h"

#define CLOCK_SETUP     0  // for 42Mhz, 14Mhz
#define CLOCK_SETUP     1  // for 48Mhz, 24 Mhz
#define CLOCK_SETUP     2  // for 8 MHz, 8Mhz
 
int main() {
     DigitalOut gpo(PTB8);
     DigitalOut led(LED_RED);

while (true) {
         gpo = 1;
        led = 1; // Off
        wait(2);
        gpo = 0;
        led = 0; // on
        wait(2);
}
}

10 years, 6 months ago.

If I understand your question correctly you would need to edit out the clock frequency you don't want. With no clock #define the KL25Z comes up at its hardware default of approx 21 MHz, where the chip is running off the Slow Internal Reference clock multiplied by the Frequency Locked Loop by a factor 640. This is the reset condition of the chip.

cheers