KL25Z 32KHz crystal with RTC operation

Mbed-DEV now supports 32KHz crystal operation for the KL25Z4 MCU.

This enables the RTC to be clocked via the internal clock source that does not require the RTC clock input from the SDA interface MCU or other source if using a project board.

The USB function will no longer operate due to prescaler inaccuracies using a 32KHz clock.

To enable this simply set the clock setup to '3' in the system_MKL25Z4.c file, see below:

system_MKL25Z4.c file snip

#define CLOCK_SETUP     3
/* Predefined clock setups
   0 ... Multipurpose Clock Generator (MCG) in FLL Engaged Internal (FEI) mode
         Reference clock source for MCG module is the slow internal clock source 32.768kHz
         Core clock = 41.94MHz, BusClock = 13.98MHz
   1 ... Multipurpose Clock Generator (MCG) in PLL Engaged External (PEE) mode
         Reference clock source for MCG module is an external crystal 8MHz
         Core clock = 48MHz, BusClock = 24MHz
   2 ... Multipurpose Clock Generator (MCG) in Bypassed Low Power External (BLPE) mode
         Core clock/Bus clock derived directly from an external crystal 8MHz with no multiplication
         Core clock = 8MHz, BusClock = 8MHz
   3 ... Multipurpose Clock Generator (MCG) in FLL Engaged External (FEE) mode
         Reference clock source for MCG module is an external crystal 32.768kHz
         Core clock = 47.97MHz, BusClock = 23.98MHz
         This setup sets the RTC to be driven by the MCU clock directly without the need of an external source.
         RTC register values are retained when MCU is reset although there will be a slight (mSec's)loss of time
         accuracy during the reset period. RTC will reset on power down. 
*/


Please log in to post comments.