7 years, 10 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

7 years, 10 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.


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


posted by Martin Kojtal 04 Nov 2013
7 years, 10 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
        gpo = 0;
        led = 0; // on

7 years, 10 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.