Library to control the KL25z Clock Module.

Introduction

I created this library to assist in controlling the multipurpose clock generator (MCG) module of the KL25z. There is some base functionality in the mbed target library that allows you to configure the clock in several ways, but there is no support for switching clock modes in real time. This library aids in this task, by automating the process of jumping from one clock mode to another.

Check this website for the power modes available in the KL25z: http://www.freescale.com/files/training_pdf/28973_S08_MCG_WBT.pdf

Clock switching example routines can be seen in: mbed-src/targets/cmsis/target_klXX/target_kl25/system_mkl25z4

Curretly, there is support for the following transitions:

  • FEI -> PEE
  • PEE -> BLPI
  • BLPI -> PEE

This is a work in progress. The final implementation of this library wll have the capacity to switch between all clock modes using a reentrant state machine and have user configurable speeds for each mode.

For more info on how the transitions are done, take a look the entry in my blog: http://alfredoer.wordpress.com/2014/09/02/tutorial-switching-clock-modes-with-the-frdm-kl25z-in-mbed/

I hope this helps people in developing ultra low power applications with the KL25z.

Cheers!


All wikipages