<?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: KL26   Moving from FEI to PEE mode ,running is ok ,but do not debug in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390224#M21230</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 tested the same on a FRDM-KL26Z and CodeWarrior and found the same behavior. I saw that the behavior is related with the wrong configuration of the MCG_C2 register. In your code you are configuring:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCG_C2 = 0x1C which is:&lt;/P&gt;&lt;P&gt;RANGE0 = 01 Encoding 1 — High frequency range selected for the crystal oscillator .&lt;/P&gt;&lt;P&gt;EREFS0 = 1&amp;nbsp; Oscillator requested.&lt;/P&gt;&lt;P&gt;HGO0 = 1 Configure crystal oscillator for high-gain operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the DataSheet when RANGE0 = 01 the Oscillator must have a value of Min. 3 MHz and Max. 8 MHz. Since I am using the FRDM-KL26Z with an 8 MHz Oscillator I configured:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCG_C2 = 0x24 which is:&lt;/P&gt;&lt;P&gt;RANGE0 = 1x Very high frequency range selected for the crystal oscillator&lt;/P&gt;&lt;P&gt;EREFS0 = 1&amp;nbsp; Oscillator requested.&lt;/P&gt;&lt;P&gt;HGO0 = 0 Configure crystal oscillator for low-power operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="data kl26.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51710i90D16D0835FDAB30/image-size/large?v=v2&amp;amp;px=999" role="button" title="data kl26.jpg" alt="data kl26.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check that the MCG_C2 value is configured correctly according to the Oscillator values in your hardware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this information can help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Adrian Sanchez Cano&lt;BR /&gt;Technical Support Engineer&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2015 22:28:10 GMT</pubDate>
    <dc:creator>adriancano</dc:creator>
    <dc:date>2015-03-19T22:28:10Z</dc:date>
    <item>
      <title>KL26   Moving from FEI to PEE mode ,running is ok ,but do not debug</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390223#M21229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I use keil5, I do clock init&amp;nbsp; .reference: "KL26P121M48SF4RM" of page on 416~418 2&lt;SPAN style="font-family: HelveticaLTStd-Bold; font-size: 15pt; color: #000000;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;4.5.3.1 Example 1: Moving from FEI to PEE mode: External Crystal =&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;4 MHz, MCGOUTCLK frequency = 48 MHz&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: HelveticaLTStd-Bold; font-size: 10pt; color: #000000;"&gt; it running is ok ,but when I do debug,it is failed . it stopping " while((MCG-&amp;gt;S &amp;amp; IREFST ) == 0x10U);"&amp;nbsp; I need you help. thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: HelveticaLTStd-Bold; font-size: 10pt; color: #000000;"&gt;&lt;SPAN style="font-family: HelveticaLTStd-Roman; font-size: 9pt; color: #000000;"&gt;external reference clock is 8Mhz&lt;BR style="text-align: -webkit-auto;" /&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;my code as follow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "MKL26Z4.h"&lt;/P&gt;&lt;P&gt;#include "clock.h"&lt;/P&gt;&lt;P&gt;#define OSCINIT0 0x02&lt;/P&gt;&lt;P&gt;#define IREFST&amp;nbsp;&amp;nbsp; 0x10&lt;/P&gt;&lt;P&gt;#define CLKST&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0c&lt;/P&gt;&lt;P&gt;#define PLLST&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x20&lt;/P&gt;&lt;P&gt;#define LOCK0&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x40&lt;/P&gt;&lt;P&gt;void Clock_Init(void)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;&amp;nbsp; // SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTA_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //CLOCK_SETUP=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;COPC = (uint32_t)0x00u;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5 |= (uint32_t)0x0200UL;&amp;nbsp;&amp;nbsp;&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-&amp;gt;CLKDIV1 = (uint32_t)0x00010000UL;&amp;nbsp; /* Update system prescalers */&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTA-&amp;gt;PCR[18] &amp;amp;= (uint32_t)~0x01000700UL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTA-&amp;gt;PCR[19] &amp;amp;= (uint32_t)~0x01000700UL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; OSC0-&amp;gt;CR = (uint8_t)0x80U;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG-&amp;gt;C2=0x1c;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; MCG-&amp;gt;C1=0x98;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MCGLOUTCLK &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; OSCINIT0 ) == 0x00U);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; IREFST ) == 0x10U);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; CLKST ) != 0x08U);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; MCG-&amp;gt;C5=0x03; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; MCG-&amp;gt;C6=0x40;&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;&amp;nbsp; MCG-&amp;gt;C2=0x1c;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; PLLST ) == 0x00U); &lt;/P&gt;&lt;P&gt;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; LOCK0 ) == 0x00U); &lt;/P&gt;&lt;P&gt;&amp;nbsp; MCG-&amp;gt;C1=0x18;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while((MCG-&amp;gt;S &amp;amp; CLKST ) != 0x0cU); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: HelveticaLTStd-Bold; font-size: 10pt; color: #000000;"&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 13.3333330154419px;"&gt;Best regards,&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:32:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390223#M21229</guid>
      <dc:creator>chuanchuanli</dc:creator>
      <dc:date>2015-03-17T09:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: KL26   Moving from FEI to PEE mode ,running is ok ,but do not debug</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390224#M21230</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 tested the same on a FRDM-KL26Z and CodeWarrior and found the same behavior. I saw that the behavior is related with the wrong configuration of the MCG_C2 register. In your code you are configuring:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCG_C2 = 0x1C which is:&lt;/P&gt;&lt;P&gt;RANGE0 = 01 Encoding 1 — High frequency range selected for the crystal oscillator .&lt;/P&gt;&lt;P&gt;EREFS0 = 1&amp;nbsp; Oscillator requested.&lt;/P&gt;&lt;P&gt;HGO0 = 1 Configure crystal oscillator for high-gain operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the DataSheet when RANGE0 = 01 the Oscillator must have a value of Min. 3 MHz and Max. 8 MHz. Since I am using the FRDM-KL26Z with an 8 MHz Oscillator I configured:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCG_C2 = 0x24 which is:&lt;/P&gt;&lt;P&gt;RANGE0 = 1x Very high frequency range selected for the crystal oscillator&lt;/P&gt;&lt;P&gt;EREFS0 = 1&amp;nbsp; Oscillator requested.&lt;/P&gt;&lt;P&gt;HGO0 = 0 Configure crystal oscillator for low-power operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="data kl26.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51710i90D16D0835FDAB30/image-size/large?v=v2&amp;amp;px=999" role="button" title="data kl26.jpg" alt="data kl26.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check that the MCG_C2 value is configured correctly according to the Oscillator values in your hardware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this information can help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Adrian Sanchez Cano&lt;BR /&gt;Technical Support Engineer&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 22:28:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390224#M21230</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2015-03-19T22:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re: KL26   Moving from FEI to PEE mode ,running is ok ,but do not debug</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390225#M21231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you . and I have some question abot &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;HGO0 .why &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;HGO0 = 0,&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;low-power or &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; high-gain ,&amp;nbsp; high-gain have a good ? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="QQ截图20150320110317.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51728i78210066333A03EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQ截图20150320110317.png" alt="QQ截图20150320110317.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 03:06:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390225#M21231</guid>
      <dc:creator>chuanchuanli</dc:creator>
      <dc:date>2015-03-20T03:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: KL26   Moving from FEI to PEE mode ,running is ok ,but do not debug</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390226#M21232</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;The different HGO modes can be used according to your hardware and project requirements. Please refer to the specific reference manual in the section High-Frequency, High-Gain Mode and section High-Frequency, Low-Power Mode to have a better understanding of each mode. As you can see in the Datasheet in the section Oscillation frequency specifications the HGO modes will impact directly in the Crystal startup time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="osc.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51052i09F827359B53866C/image-size/large?v=v2&amp;amp;px=999" role="button" title="osc.jpg" alt="osc.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this information can help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Adrian Sanchez Cano&lt;BR /&gt;Technical Support Engineer&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 18:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26-Moving-from-FEI-to-PEE-mode-running-is-ok-but-do-not-debug/m-p/390226#M21232</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2015-03-23T18:36:34Z</dc:date>
    </item>
  </channel>
</rss>

