<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: K60 Clock Setup in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147294#M49</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running a bareboard setup and can not get my clocks and PIT to work correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First is there code that sets up the K60 Tower with its 50Mhz OSC?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need 96Mhz core, 48Mhz bus 24 Mhz flash and 48Mhz USB ciocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone also step me through PIT setup..... I set it up now and it runs very slow :smileyhappy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that my system is running at 96Mhz from a LED toggle program I wrote and put it on scope, it looked like approx 20ns...... but PIT runs from bus clock right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2012 12:25:08 GMT</pubDate>
    <dc:creator>T_M_F</dc:creator>
    <dc:date>2012-02-23T12:25:08Z</dc:date>
    <item>
      <title>K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147287#M42</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help to speed up my core. Before I start to explain my problem - just two things to know:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I use Keil ARM with RL-RTX for my board, so there is no Processor Expert and MQX available&lt;/P&gt;&lt;P&gt;- I also use the CMSIS header file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;okay, according to CMSIS, i have the C-file "system_MK60N512MD100.c" in which is the function SystemInit()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are also 3 predefinded configurations to setup the clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here the code:&lt;/P&gt;&lt;PRE&gt;#define CLOCK_SETUP     3/* Predefined clock setups   0 ... Multipurpose Clock Generator (MCG) in FLL Engaged Internal (FEI) mode         Core clock/Bus clock derived from an internal clock source 32.768kHz         Core clock = 47.97MHz, BusClock = 47.97MHz   1 ... Multipurpose Clock Generator (MCG) in PLL Engaged External (PEE} mode         Clock derived from and external crystal 8MHz         Core clock = 48MHz, BusClock = 48MHz   2 ... Multipurpose Clock Generator (MCG) in Bypassed Low Power External (BLPE) mode         Core clock/Bus clock derived directly from external crystal with no multiplication         Core clock = 8MHz, BusClock = 8MHz*/&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*----------------------------------------------------------------------------  Define clock source values *----------------------------------------------------------------------------*/&lt;STRONG&gt;#if (CLOCK_SETUP == 0)&lt;/STRONG&gt;  #define CPU_XTAL_CLK_HZ           4000000u /* the external crystal or oscillator clock frequency in Hz */  #define CPU_XTAL32k_CLK_HZ      32768u /* the external 32k crystal or oscillator clock frequency in Hz */  #define CPU_INT_SLOW_CLK_HZ   32768u   /* the slow internal oscillator clock frequency in Hz  */  #define CPU_INT_FAST_CLK_HZ     4000000u /* the fast internal oscillator clock frequency in Hz  */  #define DEFAULT_SYSTEM_CLOCK  47972352u /* Default System clock value */&lt;STRONG&gt;#elif (CLOCK_SETUP == 1)&lt;/STRONG&gt;  #define CPU_XTAL_CLK_HZ          8000000u /*  the external crystal or oscillator clock frequency in Hz */  #define CPU_XTAL32k_CLK_HZ     32768u   /* the external 32k crystal or oscillator clock frequency in Hz */  #define CPU_INT_SLOW_CLK_HZ  32768u   /* the slow internal oscillator clock frequency in Hz  */  #define CPU_INT_FAST_CLK_HZ    4000000u /* the fast internal oscillator clock frequency in Hz  */  #define DEFAULT_SYSTEM_CLOCK 48000000u /* Default System clock value */ &lt;STRONG&gt;#elif (CLOCK_SETUP == 2)&lt;/STRONG&gt;  #define CPU_XTAL_CLK_HZ           8000000u /* the external crystal or oscillator clock frequency in Hz */  #define CPU_XTAL32k_CLK_HZ     32768u   /* the external 32k crystal or oscillator clock frequency in Hz */  #define CPU_INT_SLOW_CLK_HZ   32768u   /* Value  the slow internal oscillator clock frequency in Hz  */  #define CPU_INT_FAST_CLK_HZ     4000000u /* Value of the fast internal oscillator clock frequency in Hz  */  #define DEFAULT_SYSTEM_CLOCK  80000000u /* Default System clock value */&lt;STRONG&gt;#endif /* (CLOCK_SETUP == 2) */&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;this is in the function SystemInit()&lt;/P&gt;&lt;PRE&gt;  /* System clock initialization */&lt;STRONG&gt;#if (CLOCK_SETUP == 0)&lt;/STRONG&gt;  /* Switch to FEI Mode */  /* MCG-&amp;gt;C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */  MCG-&amp;gt;C1 = (uint8_t)0x06u;  /* MCG-&amp;gt;C2: ??=0,??=0,RANGE=0,HGO=0,EREFS=0,LP=0,IRCS=0 */  MCG-&amp;gt;C2 = (uint8_t)0x00u;  /* MCG_C4: DMX32=1,DRST_DRS=1 */  MCG-&amp;gt;C4 = (uint8_t)((MCG-&amp;gt;C4 &amp;amp; (uint8_t)~(uint8_t)0x40u) | (uint8_t)0xA0u);  /* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */  MCG-&amp;gt;C5 = (uint8_t)0x00u;  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=0,CME=0,VDIV=0 */  MCG-&amp;gt;C6 = (uint8_t)0x00u;  while((MCG-&amp;gt;S &amp;amp; MCG_S_IREFST_MASK) == 0u) { /* Check that the source of the FLL reference clock is the internal reference clock. */  }  while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x00u) {    /* Wait until output of the FLL is selected */  }  /* SIM-&amp;gt;CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0 */  SIM-&amp;gt;CLKDIV1 = (uint32_t)0x00110000u; /* Update system prescalers */&lt;STRONG&gt;#elif (CLOCK_SETUP == 1)&lt;/STRONG&gt;/* Switch to FBE Mode */
  /* OSC-&amp;gt;CR: ERCLKEN=0,??=0,EREFSTEN=0,??=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
  OSC-&amp;gt;CR = (uint8_t)0x00u;
  /* SIM-&amp;gt;SOPT2: MCGCLKSEL=0 */
  SIM-&amp;gt;SOPT2 &amp;amp;= (uint8_t)~(uint8_t)0x01u;
  /* MCG-&amp;gt;C2: ??=0,??=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
  MCG-&amp;gt;C2 = (uint8_t)0x24u;
  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
  MCG-&amp;gt;C1 = (uint8_t)0x9Au;
  /* MCG-&amp;gt;C4: DMX32=0,DRST_DRS=0 */
  MCG-&amp;gt;C4 &amp;amp;= (uint8_t)~(uint8_t)0xE0u;
  /* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=3 */
  MCG-&amp;gt;C5 = (uint8_t)0x03u;
  /* MCG-&amp;gt;C5: PLLCLKEN=1 */
  MCG-&amp;gt;C5 |= (uint8_t)0x40u;            /* Enable the PLL */
  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=0,CME=0,VDIV=0 */
  MCG-&amp;gt;C6 = (uint8_t)0x00u;
  while((MCG-&amp;gt;S &amp;amp; MCG_S_OSCINIT_MASK) == 0u) { /* Check that the oscillator is running */
  }
  while((MCG-&amp;gt;S &amp;amp; MCG_S_IREFST_MASK) != 0u) { /* Check that the source of the FLL reference clock is the external reference clock. */
  }
  while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x08u) {    /* Wait until external reference clock is selected as MCG output */
  }
  /* Switch to PBE Mode */
  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
  MCG-&amp;gt;C1 = (uint8_t)0x82u;
  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=0,VDIV=0 */
  MCG-&amp;gt;C6 = (uint8_t)0x40u;
  /* Switch to PEE Mode */
  /* MCG-&amp;gt;C1: CLKS=0,FRDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
  MCG-&amp;gt;C1 = (uint8_t)0x02u;
  /* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=3 */
  MCG-&amp;gt;C5 = (uint8_t)0x03u;
  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=0,VDIV=0 */
  MCG-&amp;gt;C6 = (uint8_t)0x40u;
  while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x0Cu) {    /* Wait until output of the PLL is selected */
  }
  while((MCG-&amp;gt;S &amp;amp; MCG_S_LOCK_MASK) == 0u) { /* Wait until locked */
  }
  /* SIM-&amp;gt;CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0 */
  SIM-&amp;gt;CLKDIV1 = (uint32_t)0x00110000u; /* Update system prescalers */
&lt;STRONG&gt;#elif (CLOCK_SETUP == 2)&lt;/STRONG&gt;
...
...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;changing some defines in the second part have no effect...these values have no reference to the other code or files..I just postet for the sake of completeness...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To change clock, I only have to change CLOCK_SETUP from 0 to 1 or 2&lt;/P&gt;&lt;P&gt;0 and 2 are working, 1 unfortunatly not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found out, that I have to change the modes from FEI to FBE to PBE&amp;nbsp; to PEE to get the maximal core-frequenzy (96 MHz)...am I right ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In uVision, I got the opportunity to manually change the registers -&amp;gt; but I always stuck by swtiching into PEE mode.The debug mode is exiting without an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have some experience about this all? Or can anybody say why CLOCK_SETUP 1 is not working ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Regards, Philip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:48:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147287#M42</guid>
      <dc:creator>pende</dc:creator>
      <dc:date>2020-10-29T08:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147288#M43</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the PEE mode working on your controller?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied the configuration from CMSIS startup - so normaly, it should work :-/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The programm starts directly in debug mode...in all other CLOCL_SETUP modes, I have to start it manually...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also cannot stop or reset the controller per software.&lt;/P&gt;&lt;P&gt;"Could not stop Cortex-M device! Please check the JTAG cable."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does this mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 15:52:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147288#M43</guid>
      <dc:creator>pende</dc:creator>
      <dc:date>2011-07-14T15:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147289#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does nobody have any experience? Are you all running your K60 in lowspeed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here again some code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FEI -&amp;gt; FBE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  /* Switch to FBE Mode */  /* OSC-&amp;gt;CR: ERCLKEN=0,??=0,EREFSTEN=0, */  OSC-&amp;gt;CR = (uint8_t)0x00u;  /* SIM-&amp;gt;SOPT2: MCGCLKSEL=0 TRACECLKSEL=1 */  SIM-&amp;gt;SOPT2 = SIM_SOPT2_TRACECLKSEL_MASK;  /* MCG-&amp;gt;C2: ??=0,??=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */  MCG-&amp;gt;C2 = (uint8_t)0x24u;  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */  MCG-&amp;gt;C1 = (uint8_t)0x9Au;  /* MCG-&amp;gt;C4: DMX32=0,DRST_DRS=0 */  MCG-&amp;gt;C4 &amp;amp;= (uint8_t)~(uint8_t)0xE0u;  /* MCG-&amp;gt;C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=25(50MHz / 25 = 2MHz)*/  MCG-&amp;gt;C5 = (uint8_t)0x18u;  /* MCG-&amp;gt;C5: PLLCLKEN=1 */  MCG-&amp;gt;C5 |= (uint8_t)0x40u;            /* Enable the PLL */  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=0,CME=0,VDIV=0 */  MCG-&amp;gt;C6 = (uint8_t)0x00u;  while((MCG-&amp;gt;S &amp;amp; MCG_S_OSCINIT_MASK) == 0u) { /* Check that the oscillator is running */  }  while((MCG-&amp;gt;S &amp;amp; MCG_S_IREFST_MASK) != 0u) { /* Check that the source of the FLL reference clock is the external reference clock. */  }  while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x08u) {    /* Wait until external reference clock is selected as MCG output */  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;FBE-&amp;gt;PBE&lt;/P&gt;&lt;PRE&gt;   /* Switch to PBE Mode */  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */  MCG-&amp;gt;C1 = (uint8_t)0x82u;  /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=0,VDIV=0 */  MCG-&amp;gt;C6 = (uint8_t)0x40u;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;PBE-&amp;gt;FEI&lt;/P&gt;&lt;PRE&gt;  /* Switch to PEE Mode */  /* MCG-&amp;gt;C1: CLKS=0,FRDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */   MCG-&amp;gt;C1 = (uint8_t)0x02u;  /* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=25 */  MCG-&amp;gt;C5 = (uint8_t)0x18u;    /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=0,VDIV=50 (2MHz * 48 = 96MHz) */  MCG-&amp;gt;C6 = (uint8_t)0x58u;    while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x0Cu) {    /* Wait until output of the PLL is selected */  }  while((MCG-&amp;gt;S &amp;amp; MCG_S_LOCK_MASK) == 0u) { /* Wait until locked */  }  /* SIM-&amp;gt;CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=3,OUTDIV4=1 */  SIM-&amp;gt;CLKDIV1 = (SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV3(3) | SIM_CLKDIV1_OUTDIV4(1));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Calculation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;50 MHz external reference clock deviced by PRDIV=25&amp;nbsp; --&amp;gt; 2 MHz input to PLL&lt;/P&gt;&lt;P&gt;2 MHz multiply VDIV=48 --&amp;gt;96 MHz to MCGOUTCLK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Core / System Clock = 96 MHz&lt;/P&gt;&lt;P&gt;Bus Clock = 48 MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after this, a simple LED programm should run...but it exit before &lt;SPAN class="lia-unicode-emoji" title=":confused_face:"&gt;&lt;LI-EMOJI id="lia_confused-face" title=":confused_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5&amp;nbsp;&amp;nbsp;&amp;nbsp; |= (1UL &amp;lt;&amp;lt;&amp;nbsp; 9);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable Clock to Port A */ &lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTA-&amp;gt;PCR[28] = (1UL &amp;lt;&amp;lt;&amp;nbsp; 8);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Pin is GPIO */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; PTA-&amp;gt;PDOR = (1 &amp;lt;&amp;lt; 28);&lt;BR /&gt;&amp;nbsp; PTA-&amp;gt;PDDR |= (1 &amp;lt;&amp;lt; 28);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:48:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147289#M44</guid>
      <dc:creator>pende</dc:creator>
      <dc:date>2020-10-29T08:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147290#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works fine with the K60 TWR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* MCG-&amp;gt;C2: ??=0,??=0,RANGE=1,HGO=1,EREFS=1,LP=0,IRCS=0 */  MCG-&amp;gt;C2 = MCG_C2_RANGE(1)|MCG_C2_HGO_MASK| MCG_C2_EREFS_MASK;  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=2,IREFS=0,IRCLKEN=0,IREFSTEN=0 */  MCG-&amp;gt;C1 = MCG_C1_CLKS(2)|MCG_C1_FRDIV(3);      while((MCG-&amp;gt;S &amp;amp; MCG_S_OSCINIT_MASK) == 0u) { /* Check that the oscillator is running */  }  while((MCG-&amp;gt;S &amp;amp; MCG_S_IREFST_MASK) != 0u) { /* Check that the source of the FLL reference clock is the external reference clock. */  }  while((MCG-&amp;gt;S &amp;amp; MCG_S_CLKST_MASK) != 0x08u) {    /* Wait until external reference clock is selected as MCG output */  }    /* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=1 */  MCG-&amp;gt;C5 = MCG_C5_PRDIV(0x17u);   /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=1,VDIV=0 */  MCG-&amp;gt;C6 = MCG_C6_CME_MASK|MCG_C6_PLLS_MASK;    while(!(MCG-&amp;gt;S &amp;amp; MCG_S_PLLST_MASK)) { /* Check that the oscillator is running */  }  while(!(MCG-&amp;gt;S &amp;amp; MCG_S_LOCK_MASK)) { /* Check that the source of the PLL reference clock is the external reference clock. */  }    SIM-&amp;gt;CLKDIV1 =  SIM_CLKDIV1_OUTDIV1(0)| SIM_CLKDIV1_OUTDIV2(0)| SIM_CLKDIV1_OUTDIV3(1)| SIM_CLKDIV1_OUTDIV4(3); /* Update system prescalers */  /* MCG-&amp;gt;C1: CLKS=2,FRDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */  MCG-&amp;gt;C1 &amp;amp;= ~MCG_C1_CLKS_MASK;  while((MCG-&amp;gt;S &amp;amp; MCG_S_CLKST_MASK) != 0x0Cu) {    /* Wait until external reference clock is selected as MCG output */  } &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;K60P144M100SF2RM.pdf @ page586&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:48:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147290#M45</guid>
      <dc:creator>Brun</dc:creator>
      <dc:date>2020-10-29T08:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147291#M46</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in your code:&lt;/P&gt;&lt;PRE&gt;/* MCG-&amp;gt;C5: ??=0,PLLCLKEN=0,PLLSTEN=0,PRDIV=1 */  MCG-&amp;gt;C5 = MCG_C5_PRDIV(0x17u);&lt;/PRE&gt;&lt;P&gt;you mean PRDIV is 24, am I right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calculation:&lt;/P&gt;&lt;P&gt;50 MHz / 24 = 2,083333 MHz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRDIV=24&lt;/P&gt;&lt;P&gt;2,083333 MHz * 24 = 50 MHz &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VDIV = 24 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Core/System Clock should be 50MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A short messurement with oscilloscope (before, I included this code):&lt;/P&gt;&lt;PRE&gt;    /* Set the trace clock to the core clock frequency */ SIM-&amp;gt;SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; /* Enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) */ PORTA-&amp;gt;PCR[6] = ( PORT_PCR_MUX(0x7));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I got 25 MHz output on traceclk or Tower A36 pin...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jumper J6 is on 1-2 state, so external reference clock is 50MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-unicode-emoji" title=":confused_face:"&gt;&lt;LI-EMOJI id="lia_confused-face" title=":confused_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:48:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147291#M46</guid>
      <dc:creator>pende</dc:creator>
      <dc:date>2020-10-29T08:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147292#M47</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;r u shure u can measure the frequency this way? (I also see only 25MHz)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but if I enter 50MHz for SysTick_Config(), and for Uart_init(), the timer and the baudrate is as expectet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:34:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147292#M47</guid>
      <dc:creator>Brun</dc:creator>
      <dc:date>2011-07-25T15:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147293#M48</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A service request gave me a answer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is possible to messure the frequency this way, but you have to divide it by 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"TRACE_CLKOUT is half of CPU clock"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so its everything correct. Thanks Brun.&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2011 14:29:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147293#M48</guid>
      <dc:creator>pende</dc:creator>
      <dc:date>2011-07-26T14:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: K60 Clock Setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147294#M49</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running a bareboard setup and can not get my clocks and PIT to work correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First is there code that sets up the K60 Tower with its 50Mhz OSC?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need 96Mhz core, 48Mhz bus 24 Mhz flash and 48Mhz USB ciocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone also step me through PIT setup..... I set it up now and it runs very slow :smileyhappy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that my system is running at 96Mhz from a LED toggle program I wrote and put it on scope, it looked like approx 20ns...... but PIT runs from bus clock right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 12:25:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-Clock-Setup/m-p/147294#M49</guid>
      <dc:creator>T_M_F</dc:creator>
      <dc:date>2012-02-23T12:25:08Z</dc:date>
    </item>
  </channel>
</rss>

