<?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>Kinetis Microcontrollers中的主题 Using external reference</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-external-reference/m-p/225432#M4419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;We have built a custom board that has a MK61FN1M0CAA12 chip.&amp;nbsp; We want to use the OSC0 external crystal (32 MHz) as the reference for the system clocks and we are using the example outlined in section 25.5.3.1 of the K61 reference manual (rev 2), "Example 1: Moving from FEI to PEE Mode with OSCO..." as a guide.&amp;nbsp; The code is below-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Enable the external oscillator, and give it an 8pF load&lt;/P&gt;&lt;P&gt;&amp;nbsp; OSC_CR = 0xA2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Select the external oscillator as the reference, and set it to&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Very high frequency range oscillator and high gain.&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C2 = 0x2C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Wait for the crystal to finish initializing&lt;/P&gt;&lt;P&gt;&amp;nbsp; while ((MCG_S &amp;amp; 0x02) == 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Select crystal as source for MCGOUTCLK and FLL, divide it by 1024 to get it to 32 kHz&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C1 = 0xA8;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Wait for the FLL to use the external clock&lt;/P&gt;&lt;P&gt;&amp;nbsp; while ((MCG_S &amp;amp; 0x10) != 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It hangs at this point.&amp;nbsp; I have verified that the oscillator is running at 32 MHz, as expected.&amp;nbsp; Am I doing something wrong in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jan 2013 20:45:19 GMT</pubDate>
    <dc:creator>jimclay</dc:creator>
    <dc:date>2013-01-15T20:45:19Z</dc:date>
    <item>
      <title>Using external reference</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-external-reference/m-p/225432#M4419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;We have built a custom board that has a MK61FN1M0CAA12 chip.&amp;nbsp; We want to use the OSC0 external crystal (32 MHz) as the reference for the system clocks and we are using the example outlined in section 25.5.3.1 of the K61 reference manual (rev 2), "Example 1: Moving from FEI to PEE Mode with OSCO..." as a guide.&amp;nbsp; The code is below-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Enable the external oscillator, and give it an 8pF load&lt;/P&gt;&lt;P&gt;&amp;nbsp; OSC_CR = 0xA2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Select the external oscillator as the reference, and set it to&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Very high frequency range oscillator and high gain.&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C2 = 0x2C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Wait for the crystal to finish initializing&lt;/P&gt;&lt;P&gt;&amp;nbsp; while ((MCG_S &amp;amp; 0x02) == 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Select crystal as source for MCGOUTCLK and FLL, divide it by 1024 to get it to 32 kHz&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG_C1 = 0xA8;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Wait for the FLL to use the external clock&lt;/P&gt;&lt;P&gt;&amp;nbsp; while ((MCG_S &amp;amp; 0x10) != 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It hangs at this point.&amp;nbsp; I have verified that the oscillator is running at 32 MHz, as expected.&amp;nbsp; Am I doing something wrong in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 20:45:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-external-reference/m-p/225432#M4419</guid>
      <dc:creator>jimclay</dc:creator>
      <dc:date>2013-01-15T20:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using external reference</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-external-reference/m-p/225433#M4420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem turned out to be the high-gain setting for the external crystal.&amp;nbsp; I changed the MCG_C2 setting to 0x24, and that fixed the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a 1 MOhm load resistor which I thought made it so that you were supposed to use the high-gain setting, but I guess not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 18:07:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-external-reference/m-p/225433#M4420</guid>
      <dc:creator>jimclay</dc:creator>
      <dc:date>2013-01-17T18:07:06Z</dc:date>
    </item>
  </channel>
</rss>

