<?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 LPC824 running 30MHz - Unstable PLL? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944144#M37587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a project where I just happened to run a LPC824 at 30MHz with an external 12MHz crystal. According to the user manual (UM10800) this setup is supported, and it does seem to work "sometimes".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture1.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92898i723C1D428C4D8608/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.JPG" alt="Capture1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I say sometimes because as soon as the micro controller becomes just slightly warm (Only talking about 35c here) and you reset it, it wont lock the PLL anymore and it gets stuck trying to lock.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've included my code below, written in MCUXpresso with the SDK for the LPC824, just in case it is me doing something wrong:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void SysCLKSET() {&lt;BR /&gt; //Configure XTAL pins&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKCTRL |= (SYSCON_SYSAHBCLKCTRL_IOCON_MASK | SYSCON_SYSAHBCLKCTRL_SWM_MASK);&lt;BR /&gt; IOCON-&amp;gt;PIO[IOCON_INDEX_PIO0_9] = 0;&lt;BR /&gt; IOCON-&amp;gt;PIO[IOCON_INDEX_PIO0_8] = 0;&lt;BR /&gt; //Enable XTAL pins&lt;BR /&gt; SWM0-&amp;gt;PINENABLE0 &amp;amp;= ~(SWM_PINENABLE0_XTALIN_MASK | SWM_PINENABLE0_XTALOUT_MASK);&lt;BR /&gt; //Set freq range&lt;BR /&gt; SYSCON-&amp;gt;SYSOSCCTRL = 0;&lt;BR /&gt; //Turn on system OSC (XTAL)&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~(SYSCON_PDRUNCFG_SYSOSC_PD_MASK);&lt;BR /&gt; for(uint16_t delay = 0; delay &amp;lt; 8000; delay++)&lt;BR /&gt; __asm("nop");&amp;nbsp;&lt;BR /&gt; //Turn off PLL&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG |= SYSCON_PDRUNCFG_SYSPLL_PD_MASK;&lt;BR /&gt; //Select system OSC for PLL (0=IRC, 1=OSC, 3=CLKIN)&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKSEL = 1;&lt;BR /&gt; //Update PLL source selection - Page 41&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKUEN = 0;&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKUEN = 1;&lt;BR /&gt; //Configure PLL - 60MHz Main CLK - 30MHz System CLK&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCTRL |= SYSCON_SYSPLLCTRL_MSEL(4) | SYSCON_SYSPLLCTRL_PSEL(1);&lt;BR /&gt; //Set System clk divider&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKDIV = 2;&lt;BR /&gt; //Turn on PLL&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~SYSCON_PDRUNCFG_SYSPLL_PD_MASK;&lt;BR /&gt; //Wait for PLL to lock&lt;BR /&gt; while (SYSCON-&amp;gt;SYSPLLSTAT != 1) {&lt;BR /&gt; }&lt;BR /&gt; //Change main CLK to PLL output - Page 41&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKSEL = SYSCON_MAINCLKSEL_SEL(3);&lt;BR /&gt; //Update clock source - Page 41&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKUEN = 0;&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKUEN = 1;&lt;BR /&gt; //Turn off IOCON&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKCTRL &amp;amp;= ~SYSCON_SYSAHBCLKCTRL_IOCON_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've also tried with the internal oscillator, and it yields the same result. If I however go down to 24MHz, everything seems to work as intended, and across temperature variations too. In my case I don't need it to run at the full 30MHz,&amp;nbsp; but I was curious why it didn't work, so I thought I would ask here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any input is appreciated :smileysilly:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Kenneth&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Oct 2019 22:24:39 GMT</pubDate>
    <dc:creator>kenneth880320</dc:creator>
    <dc:date>2019-10-19T22:24:39Z</dc:date>
    <item>
      <title>LPC824 running 30MHz - Unstable PLL?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944144#M37587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a project where I just happened to run a LPC824 at 30MHz with an external 12MHz crystal. According to the user manual (UM10800) this setup is supported, and it does seem to work "sometimes".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture1.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92898i723C1D428C4D8608/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.JPG" alt="Capture1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I say sometimes because as soon as the micro controller becomes just slightly warm (Only talking about 35c here) and you reset it, it wont lock the PLL anymore and it gets stuck trying to lock.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've included my code below, written in MCUXpresso with the SDK for the LPC824, just in case it is me doing something wrong:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void SysCLKSET() {&lt;BR /&gt; //Configure XTAL pins&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKCTRL |= (SYSCON_SYSAHBCLKCTRL_IOCON_MASK | SYSCON_SYSAHBCLKCTRL_SWM_MASK);&lt;BR /&gt; IOCON-&amp;gt;PIO[IOCON_INDEX_PIO0_9] = 0;&lt;BR /&gt; IOCON-&amp;gt;PIO[IOCON_INDEX_PIO0_8] = 0;&lt;BR /&gt; //Enable XTAL pins&lt;BR /&gt; SWM0-&amp;gt;PINENABLE0 &amp;amp;= ~(SWM_PINENABLE0_XTALIN_MASK | SWM_PINENABLE0_XTALOUT_MASK);&lt;BR /&gt; //Set freq range&lt;BR /&gt; SYSCON-&amp;gt;SYSOSCCTRL = 0;&lt;BR /&gt; //Turn on system OSC (XTAL)&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~(SYSCON_PDRUNCFG_SYSOSC_PD_MASK);&lt;BR /&gt; for(uint16_t delay = 0; delay &amp;lt; 8000; delay++)&lt;BR /&gt; __asm("nop");&amp;nbsp;&lt;BR /&gt; //Turn off PLL&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG |= SYSCON_PDRUNCFG_SYSPLL_PD_MASK;&lt;BR /&gt; //Select system OSC for PLL (0=IRC, 1=OSC, 3=CLKIN)&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKSEL = 1;&lt;BR /&gt; //Update PLL source selection - Page 41&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKUEN = 0;&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCLKUEN = 1;&lt;BR /&gt; //Configure PLL - 60MHz Main CLK - 30MHz System CLK&lt;BR /&gt; SYSCON-&amp;gt;SYSPLLCTRL |= SYSCON_SYSPLLCTRL_MSEL(4) | SYSCON_SYSPLLCTRL_PSEL(1);&lt;BR /&gt; //Set System clk divider&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKDIV = 2;&lt;BR /&gt; //Turn on PLL&lt;BR /&gt; SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~SYSCON_PDRUNCFG_SYSPLL_PD_MASK;&lt;BR /&gt; //Wait for PLL to lock&lt;BR /&gt; while (SYSCON-&amp;gt;SYSPLLSTAT != 1) {&lt;BR /&gt; }&lt;BR /&gt; //Change main CLK to PLL output - Page 41&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKSEL = SYSCON_MAINCLKSEL_SEL(3);&lt;BR /&gt; //Update clock source - Page 41&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKUEN = 0;&lt;BR /&gt; SYSCON-&amp;gt;MAINCLKUEN = 1;&lt;BR /&gt; //Turn off IOCON&lt;BR /&gt; SYSCON-&amp;gt;SYSAHBCLKCTRL &amp;amp;= ~SYSCON_SYSAHBCLKCTRL_IOCON_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've also tried with the internal oscillator, and it yields the same result. If I however go down to 24MHz, everything seems to work as intended, and across temperature variations too. In my case I don't need it to run at the full 30MHz,&amp;nbsp; but I was curious why it didn't work, so I thought I would ask here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any input is appreciated :smileysilly:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Kenneth&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Oct 2019 22:24:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944144#M37587</guid>
      <dc:creator>kenneth880320</dc:creator>
      <dc:date>2019-10-19T22:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 running 30MHz - Unstable PLL?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944145#M37588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="349123" data-username="kenneth880320@hotmail.com" href="https://community.nxp.com/people/kenneth880320@hotmail.com" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 11.9994px;"&gt;Kenneth Johansen&lt;/A&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tested your issue on my LPC824 demo board.&lt;/P&gt;&lt;P&gt;Clock path:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93333i20C7582D0DFA7647/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my testing code is attached. the code is to blink on board LED D1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the board is running with this code without any issue. I reset board for 10 times, the board still function well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suggest you refer or test my demo, if you can find any issue on your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 08:50:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944145#M37588</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-10-21T08:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 running 30MHz - Unstable PLL?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944146#M37589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jun&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've taken a look at your provided code, and I don't see where you setup the frequency of the board to run 30MHz? In my SDK, calling&amp;nbsp;BOARD_InitBootClocks() will only setup the board to run at 12MHz and not 30MHz as seen below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93062iD070F32D1FC20F2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, I &lt;EM&gt;can&lt;/EM&gt; get my code to run and lock the PLL, but as soon as I raise the temperature, and then reset the board, it will stop being able to lock the PLL. My problem is both a factor of resetting and temperature, so you can't just test it with a board without increasing the temperature and then trying to reset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:18:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944146#M37589</guid>
      <dc:creator>kenneth880320</dc:creator>
      <dc:date>2019-10-21T12:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 running 30MHz - Unstable PLL?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944147#M37590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kenneth,&lt;/P&gt;&lt;P&gt;This time, I test board with external system osc&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93663iA28163390C2E4B01/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my attached demo,&amp;nbsp;CLOCK_SetCoreSysClkDiv(2U) is to set&amp;nbsp;SYSAHBCLKDIV as 2, thus system clock = 60M/2=30MHZ&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93713i5853CC30DE3F72C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested code with 35-40c environment, no reset issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you test my code with two more other board, if this problem is same? can you also test it with nxp demo board?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2019 08:01:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-running-30MHz-Unstable-PLL/m-p/944147#M37590</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-10-22T08:01:13Z</dc:date>
    </item>
  </channel>
</rss>

