<?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>LPC MicrocontrollersのトピックRe: Problem with the main oscillator</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524147#M6783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xianghuiwang on Mon Apr 27 18:58:38 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi，&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you need to switch the main clock to IRC before powering down the pll if the pll was used with the IRC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Use CLKOut pin to confirm this is correct. Then switch to use main oscillator to feed the pll. You can reference the LPCOpen sample project for this portion of the implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:05:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:05:59Z</dc:date>
    <item>
      <title>Problem with the main oscillator</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524145#M6781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Patrick_W on Thu Apr 16 05:58:31 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's me again. After debugging my board with the IRC i wanted to switch to the main osc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i wrote a function which i call at the beginning of the main function. In this function i wanted to set up the oscillator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and deactivate the PLL0 (i don't need it). The CPU should just be clocked by the main osci. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void MAIN_CLK_without_PLL(bool f_15_25MHz)
{
//first step PLL0 Setup Sequence
if(Chip_Clock_IsMainPLLConnected())
{
Chip_Clock_DisablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_CONNECT);//disconnect PLL0
}
//second step in PLL0 Setup Sequence
if(Chip_Clock_IsMainPLLEnabled())
{
Chip_Clock_DisablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_ENABLE);//deactivat PLL0
}
//third step in PLL0 Setup Sequence

if(f_15_25MHz)
{
LPC_SYSCTL-&amp;gt;SCS |= SYSCTL_OSCRANGE_15_25;//Oscillator got a frequencie between 15 and 25 MHz
}else{
LPC_SYSCTL-&amp;gt;SCS &amp;amp;= ~SYSCTL_OSCRANGE_15_25;
 }

LPC_SYSCTL-&amp;gt;SCS |= SYSCTL_OSCEC;//activate main oscillator
while(!Chip_Clock_IsCrystalEnabled()) {}//wait till oscillator is started correc

Chip_Clock_SetCPUClockDiv(0);//set the cpu prescaller to 1 
Chip_Clock_SetMainPLLSource(SYSCTL_PLLCLKSRC_MAINOSC);

//for testing deliver the clock on CLKOUT

Chip_IOCON_PinMux(LPC_IOCON, PORT_1, PIN_27, IOCON_MODE_INACT, IOCON_FUNC1);
Chip_Clock_SetCLKOUTSource(SYSCTL_CLKOUTSRC_CPU, 1);
Chip_Clock_EnableCLKOUT();
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After i tried this with several crystals (24MHz and 14.7456MHz) and measured on the CLKOUT Pin the frequency always had been wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The crystall is connected to two 18pF Capacities.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have i made a error in setting up the oscillator? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:05:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524145#M6781</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the main oscillator</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524146#M6782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Patrick_W on Thu Apr 16 06:02:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh i forgot to say that i am working on an LPC1763&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:05:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524146#M6782</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the main oscillator</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524147#M6783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xianghuiwang on Mon Apr 27 18:58:38 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi，&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you need to switch the main clock to IRC before powering down the pll if the pll was used with the IRC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Use CLKOut pin to confirm this is correct. Then switch to use main oscillator to feed the pll. You can reference the LPCOpen sample project for this portion of the implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:05:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-the-main-oscillator/m-p/524147#M6783</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:05:59Z</dc:date>
    </item>
  </channel>
</rss>

