<?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: LPC812-MAX, LPCOpen problem with 12MHz XTAL, could not get it working</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574210#M18984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpc_bloke on Wed Jul 29 01:10:19 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is all very well documented in chapter 4 of the user manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to enable clock to IOCON and SWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Power up the crystal oscilator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wait a bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set the PLL multiplier and dividers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Route the PLL clock input to the crystal OSC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wait for the PLL to lock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Select the PLL output and the CPU clock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Correctly set up the AHB clock divisors&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The function you are looking for was called SystemInit and it is usually called before main is called in the system startup code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I currently run an LPC812 and 28MHz as I needed a specific divisor and this was the best clock frequency I found to meet my needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could most likely get a 30MHz CPU clock from either 12MHz or 10MHz and the PLL and multiply and divide to suit you needs within the range documented in the user manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:13:56 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:13:56Z</dc:date>
    <item>
      <title>LPC812-MAX, LPCOpen problem with 12MHz XTAL, could not get it working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574207#M18981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by riscy00 on Wed May 06 08:13:34 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCxpresso 7.7.2 (most recent) along with most recent library (installed last week). I use LINK2 board on SWD port. The setup working fine with UART, Systick and blinker working (derived from LPCOpen)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have LPC812-MAX and wish to use external crystal as clock source instead of IRC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My attempt, was to first power up using IRC and then switch over to external XTAL (12Mhz). I use LPCOpen Chip_SetupXtalClocking(); but ended up crashes (no LED blinking and debug provide error).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I copied over some code from Chip_SetupXtalClocking() to my routine as shown below, it crashed only when statement is excuted Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_SYSOSC);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I power down and power up (without debug) and the LED is not blinking, so the clock failed to get thro the PPL block. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two possibility, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; The onboard XTAL did not tick (defective hardware)..I have not checked XTALOUT yet (I'm on vacation). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Undocumented procedure how to do this correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i forget to add, I have changed the jumper SJ2 and SJ3 to connect XTAL to LPC812 on MAX board. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have followed the datasheet to configure the port correctly. &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 SysClock_LPC812_Swicth_To_XTAL(void)
{
//------------------------------------------------Enable the clock to the Switch Matrix
&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_SWM_EnableFixedPin(SWM_FIXED_XTALIN);
&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_SWM_EnableFixedPin(SWM_FIXED_XTALOUT);
//-----------------------------------------------Disable the clock to the Switch Matrix to save power
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @briefSets pull-up or pull-down mode for a pin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @parampIOCON: The base of IOCON peripheral on the chip
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @parampin: Pin number
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @parammode: Mode (Pull-up/Pull-down mode)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @returnNothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @noteDo not use with pins PIO10 and PIO11.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */
&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_IOCON_PinSetMode(LPC_IOCON, IOCON_PIO8, PIN_MODE_INACTIVE);
&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_IOCON_PinSetMode(LPC_IOCON, IOCON_PIO9, PIN_MODE_INACTIVE);

//Code copied over from Chip_SetupXtalClocking(); to investigate source of crashes.

/* EXT oscillator &amp;lt; 15MHz */
Chip_Clock_SetPLLBypass(false, false);

/* Turn on the SYSOSC by clearing the power down bit */
Chip_SYSCTL_PowerUp(SYSCTL_SLPWAKE_SYSOSC_PD);

/* Select the PLL input to the external oscillator */
Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_SYSOSC);

// PPL code to be included once above is fixed (will not crash). 
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) Do you have example code that shown external clock is used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(2) Is there other element missing from above code?&lt;/SPAN&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 20:13:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574207#M18981</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: LPC812-MAX, LPCOpen problem with 12MHz XTAL, could not get it working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574208#M18982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by riscy00 on Thu May 07 22:20:42 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bump, any helper?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:13:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574208#M18982</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: LPC812-MAX, LPCOpen problem with 12MHz XTAL, could not get it working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574209#M18983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fjrg76 on Tue Jul 28 22:55:54 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas? I'm suffering from the same issue&amp;nbsp; :((&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Fchanging-main-frequency-clock" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/changing-main-frequency-clock&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:13:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574209#M18983</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: LPC812-MAX, LPCOpen problem with 12MHz XTAL, could not get it working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574210#M18984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpc_bloke on Wed Jul 29 01:10:19 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is all very well documented in chapter 4 of the user manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to enable clock to IOCON and SWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Power up the crystal oscilator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wait a bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set the PLL multiplier and dividers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Route the PLL clock input to the crystal OSC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wait for the PLL to lock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Select the PLL output and the CPU clock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Correctly set up the AHB clock divisors&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The function you are looking for was called SystemInit and it is usually called before main is called in the system startup code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I currently run an LPC812 and 28MHz as I needed a specific divisor and this was the best clock frequency I found to meet my needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could most likely get a 30MHz CPU clock from either 12MHz or 10MHz and the PLL and multiply and divide to suit you needs within the range documented in the user manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:13:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC812-MAX-LPCOpen-problem-with-12MHz-XTAL-could-not-get-it/m-p/574210#M18984</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:13:56Z</dc:date>
    </item>
  </channel>
</rss>

