<?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 Using SYSCTL_PLLCLKSRC_RTC32K to set clock to 32KHz in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-SYSCTL-PLLCLKSRC-RTC32K-to-set-clock-to-32KHz/m-p/554830#M14835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am currently looking at using the RTC 32KHz oscillator on an LPC11u68 to run the main clock and when I switch the system PLL source to SYSCTL_PLLCLKSRC_RTC32K the system hangs and I need to use ISP reset to clear the device to reconnect. I have initially got the system running off an external oscillator (also works from IRC oscillator) and then when I try to switch to the slow clock things break.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the LPCOpen library with the following code to switch the main clock:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RTC); Chip_Clock_EnableRTCOsc(); Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_PLLIN); Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_RTC32K);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the call to void Chip_SetupXtalClocking(void) to set the initial clock (that seems to work fine).&lt;/P&gt;&lt;P&gt;Is there something I am missing? According to the datasheet, this is all I need to do to use the RTC 32 KHz oscillator for the system clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Jul 2016 06:03:56 GMT</pubDate>
    <dc:creator>safarmer</dc:creator>
    <dc:date>2016-07-09T06:03:56Z</dc:date>
    <item>
      <title>Using SYSCTL_PLLCLKSRC_RTC32K to set clock to 32KHz</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-SYSCTL-PLLCLKSRC-RTC32K-to-set-clock-to-32KHz/m-p/554830#M14835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am currently looking at using the RTC 32KHz oscillator on an LPC11u68 to run the main clock and when I switch the system PLL source to SYSCTL_PLLCLKSRC_RTC32K the system hangs and I need to use ISP reset to clear the device to reconnect. I have initially got the system running off an external oscillator (also works from IRC oscillator) and then when I try to switch to the slow clock things break.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the LPCOpen library with the following code to switch the main clock:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RTC); Chip_Clock_EnableRTCOsc(); Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_PLLIN); Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_RTC32K);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the call to void Chip_SetupXtalClocking(void) to set the initial clock (that seems to work fine).&lt;/P&gt;&lt;P&gt;Is there something I am missing? According to the datasheet, this is all I need to do to use the RTC 32 KHz oscillator for the system clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2016 06:03:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-SYSCTL-PLLCLKSRC-RTC32K-to-set-clock-to-32KHz/m-p/554830#M14835</guid>
      <dc:creator>safarmer</dc:creator>
      <dc:date>2016-07-09T06:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using SYSCTL_PLLCLKSRC_RTC32K to set clock to 32KHz</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-SYSCTL-PLLCLKSRC-RTC32K-to-set-clock-to-32KHz/m-p/554831#M14836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Shane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What board are you using? It should be working with those lines that you added. I took periph_clkout example from LPCOpen (LPCXpresso 11u68 Board Rev C) and made next modifications on main function:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14702567221227024 jive_text_macro" data-hasrefreshed="true" data-renderedposition="111.80000305175781_8_1192_320" jivemacro_uid="_14702567221227024" modifiedtitle="true"&gt;&lt;P&gt;SystemCoreClockUpdate();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Board_Init();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Board_LED_Set(0, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable clock for RTC */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RTC);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_EnableRTCOsc();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_RTC32K);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_PLLIN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable and setup SysTick Timer at a 100Hz rate */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SysTick_Config(SystemCoreClock / 100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* WDT oscillator freq = 0.6MHz divided by 64 = 9.375khz */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_SetWDTOSC(WDTLFO_OSC_0_60, 64);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable the power to the WDT */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_SYSCTL_PowerUp(SYSCTL_SLPWAKE_WDTOSC_PD);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Configure PIN0.1 for CLKOUT */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 1, IOCON_FUNC1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Setup CLKOUT pin for specific clock with a divider of 1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_Clock_SetCLKOUTSource(SYSCTL_CLKOUTSRC_MAINSYSCLK, 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I was able to measure the 32.768 kHz on P0.1 pin:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="2016-08-03_15-40-00.jpg"&gt;&lt;IMG alt="2016-08-03_15-40-00.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/1306i08513B547C402164/image-size/large?v=v2&amp;amp;px=999" title="2016-08-03_15-40-00.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can give a try to do same modifications on periph_clkout example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:39:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-SYSCTL-PLLCLKSRC-RTC32K-to-set-clock-to-32KHz/m-p/554831#M14836</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2020-11-02T13:39:47Z</dc:date>
    </item>
  </channel>
</rss>

