<?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: Correct setup of the K10 Internal Reference Clock... in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288713#M11374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Pavel,&lt;/P&gt;&lt;P&gt;I am trimming the IRC to 32.768kHz. I went through to double check my setup and added the following two lines to copy the trim values into the registers:&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C3 = *((uint8_t*) 0x03FFU);&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C4 = (MCG_C4 &amp;amp; 0xE0U) | ((*((uint8_t*) 0x03FEU)) &amp;amp; 0x1FU);&lt;/P&gt;&lt;P&gt;This hasn't resolved the issue and the rest of my setup, as far as I can tell, is the same as what is shown in that document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Sep 2013 23:15:07 GMT</pubDate>
    <dc:creator>Alex_HMBE</dc:creator>
    <dc:date>2013-09-01T23:15:07Z</dc:date>
    <item>
      <title>Correct setup of the K10 Internal Reference Clock...</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288710#M11371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're trying to get the full 72MHz system clock out of a 64-pin, 72MHz K10. We've pulled code in from PE, setting the DCO up to give us 2197x32.768=71.99MHz. After setting up a UART and noticing some bad characters, I checked the bit period on a scope and found that it was off by 2.9% (after taking the baud rate error created by the UART divisor into account).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my question is - should the FLL output, using the IRC, be able to produce a reliable 72MHz?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the setup code from PE:&lt;/P&gt;&lt;P&gt;void __init_hardware()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** PE initialization code after reset ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; SCB_VTOR = (uint32_t)__vector_table; /* Set the interrupt vector table position */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Disable the WDOG module */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* WDOG_UNLOCK: WDOGUNLOCK=0xC520 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; WDOG_UNLOCK = (uint16_t)0xC520U;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Key 1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* WDOG_UNLOCK : WDOGUNLOCK=0xD928 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; WDOG_UNLOCK&amp;nbsp; = (uint16_t)0xD928U;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Key 2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* WDOG_STCTRLH: ??=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,??=0,??=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; WDOG_STCTRLH = (uint16_t)0x01D2U;&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;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* System clock initialization */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* SIM_SCGC5: PORTA=1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_SCGC5 |= (uint32_t)0x0200UL;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable clock gate for ports to enable pin routing */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=3,OUTDIV4=3,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_CLKDIV1 = (uint32_t)0x01330000UL; /* Update system prescalers */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* SIM_SOPT2: PLLFLLSEL=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_SOPT2 &amp;amp;= (uint32_t)~0x00010000UL; /* Select FLL as a clock source for various peripherals */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* SIM_SOPT1: OSC32KSEL=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_SOPT1 &amp;amp;= (uint32_t)~0x000C0000UL; /* System oscillator drives 32 kHz clock for various peripherals */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Switch to FEI Mode */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C1 = (uint8_t)0x06U;&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;&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; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C2: LOCRE0=0,??=0,RANGE0=0,HGO0=0,EREFS0=0,LP=0,IRCS=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C2 = (uint8_t)0x00U;&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;&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; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C4: DMX32=1,DRST_DRS=2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C4 = (uint8_t)((MCG_C4 &amp;amp; (uint8_t)~(uint8_t)0x20U) | (uint8_t)0xC0U);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* OSC_CR: ERCLKEN=1,??=0,EREFSTEN=0,??=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; OSC_CR = (uint8_t)0x80U;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C7: OSCSEL=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C7 &amp;amp;= (uint8_t)~(uint8_t)0x01U;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C5: ??=0,PLLCLKEN0=0,PLLSTEN0=0,PRDIV0=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C5 = (uint8_t)0x00U;&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;&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; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV0=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C6 = (uint8_t)0x00U;&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;&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; &lt;/P&gt;&lt;P&gt;&amp;nbsp; while((MCG_S &amp;amp; MCG_S_IREFST_MASK) == 0x00U) { /* Check that the source of the FLL reference clock is the internal reference clock. */&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; while((MCG_S &amp;amp; 0x0CU) != 0x00U) {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until output of the FLL is selected */&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of PE initialization code after reset ***/&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 03:00:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288710#M11371</guid>
      <dc:creator>Alex_HMBE</dc:creator>
      <dc:date>2013-07-24T03:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Correct setup of the K10 Internal Reference Clock...</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288711#M11372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking with this issue, I will be back when I could get any updated info.&lt;/P&gt;&lt;P&gt;Thank you for the patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B.R.&lt;/P&gt;&lt;P&gt;Ma Hui&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 09:12:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288711#M11372</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2013-08-28T09:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Correct setup of the K10 Internal Reference Clock...</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288712#M11373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;are you correctly trimming the internal clock?&lt;/P&gt;&lt;P&gt;if you are using PE tools (Multilink or OSJTAG), it looks as in the document&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-95356"&gt;https://community.freescale.com/docs/DOC-95356&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 09:19:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288712#M11373</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-28T09:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Correct setup of the K10 Internal Reference Clock...</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288713#M11374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Pavel,&lt;/P&gt;&lt;P&gt;I am trimming the IRC to 32.768kHz. I went through to double check my setup and added the following two lines to copy the trim values into the registers:&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C3 = *((uint8_t*) 0x03FFU);&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C4 = (MCG_C4 &amp;amp; 0xE0U) | ((*((uint8_t*) 0x03FEU)) &amp;amp; 0x1FU);&lt;/P&gt;&lt;P&gt;This hasn't resolved the issue and the rest of my setup, as far as I can tell, is the same as what is shown in that document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Sep 2013 23:15:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288713#M11374</guid>
      <dc:creator>Alex_HMBE</dc:creator>
      <dc:date>2013-09-01T23:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Correct setup of the K10 Internal Reference Clock...</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288714#M11375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do a test based on TWR-K20D72M board, with using internal trim value 0x190 (MCG_C3 = 0X90; MCG_C4 [SCFTRIM] is set), I measure flexbus clock output frequency at PTC3 pin (ALT5 function is CLKOUT). I could measure the CLKOUT clock is not a stable 36MHz, which could swing from 36.4MHz to 36.0MHz. For the UART with clock error tolerance, the FLL with IRC(slow) could generate UART communication matched clock. I could get correct print characters from serial terminal with baud rate 115200.&lt;/P&gt;&lt;P&gt;Wish it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 04:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Correct-setup-of-the-K10-Internal-Reference-Clock/m-p/288714#M11375</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2013-09-02T04:54:34Z</dc:date>
    </item>
  </channel>
</rss>

