<?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 lpc54618: XTAL crystal frequency not coming on CLKOUT in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/lpc54618-XTAL-crystal-frequency-not-coming-on-CLKOUT/m-p/751056#M4124</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 am using lpc54618 eval board, I was checking CLKOUT on oscilloscope using following code for BOARD_BootClockRUN but still was unable to see clock output on scope...&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;If I use :- &lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(&lt;/SPAN&gt;kOSC32K_OSC_to_CLKOUT); /*!&amp;lt; Switch CLKOUT to OSC32K_OSC */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;Or :- &lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kMAIN_CLK_to_CLKOUT&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;I get proper clkout on scope&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;I dont get output for :- &lt;SPAN style="color: #000000; font-size: medium; font-family: monospace;"&gt;CLOCK_AttachClk(kEXT_CLK_to_CLKOUT); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: medium; font-family: monospace;"&gt;/*!&amp;lt; Switch CLKOUT to EXT_CLK */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;********************** Configuration BOARD_BootClockRUN ***********************&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* clang-format off */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;!!Configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;name: BOARD_BootClockRUN&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;called_from_default_init: true&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;outputs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: CLKOUT_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FRO12M_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FROHF_clock.outFreq, value: 48 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FXCOMs_CLK32K_clock.outFreq, value: 32.768 kHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: MAIN_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: System_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;settings:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: SYSCON.CLKOUTSELA.sel, value: SYSCON._clk_in}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;sources:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: RTC.rtc_32k_osc.outFreq, value: 32.768 kHz, enabled: true}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: SYSCON._clk_in.outFreq, value: 12 MHz, enabled: true}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* clang-format on */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* Variables for BOARD_BootClockRUN configuration&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* Code for BOARD_BootClockRUN configuration&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; BOARD_BootClockRUN(&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up the clock sources */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up FRO */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_DisablePD(kPDRUNCFG_PD_FRO_EN); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Ensure FRO is on */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch to FRO 12MHz first to ensure we can change voltage without accidentally&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;being below the voltage for current speed */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_DisablePD(kPDRUNCFG_PD_SYS_OSC); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Enable System Oscillator Power */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SYSCON-&amp;gt;SYSOSCCTRL = ((SYSCON-&amp;gt;SYSOSCCTRL &amp;amp; ~SYSCON_SYSOSCCTRL_FREQRANGE_MASK) | SYSCON_SYSOSCCTRL_FREQRANGE(0U)); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set system oscillator range */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_SetVoltageForFreq(12000000U); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set voltage for the one of the fastest clock outputs: System clock output */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetFLASHAccessCyclesForFreq(12000000U); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set FLASH wait states for core */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up RTC OSC */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_EnableClock(kCLOCK_Rtc); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Enable the RTC peripheral clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;RTC-&amp;gt;CTRL &amp;amp;= ~RTC_CTRL_SWRESET_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Make sure the reset bit is cleared */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;RTC-&amp;gt;CTRL &amp;amp;= ~RTC_CTRL_RTC_OSC_PD_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Setup RTC oscillator */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SYSCON-&amp;gt;RTCOSCCTRL = SYSCON_RTCOSCCTRL_EN_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Setup RTC oscillator clock source availability to other modules */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up dividers */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Reset divider counter and set divider to value 1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivClkOut, 0U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;true&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Reset CLKOUTDIV divider counter and halt it */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivClkOut, 1U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set CLKOUTDIV divider to value 1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up clock selectors - Attach clocks to the peripheries */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch MAIN_CLK to FRO12M */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kEXT_CLK_to_CLKOUT); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch CLKOUT to EXT_CLK */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* Set SystemCoreClock variable. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P&gt;In Main function following code is used&lt;/P&gt;&lt;P&gt;{......&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_DisableClock(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_ClockOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; CLOCK_EnableClock(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_ClockOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; sourceClockFreq = CLOCK_GetClockOutClkFreq();&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;//CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, sourceClockFreq / EXAMPLE_SPI_BAUDRATE - 1U, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; CLOCK_SetClkDiv(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_DivClkOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;, sourceClockFreq / EXAMPLE_CLKOUT_BAUDRATE, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;......}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;Please let me know any suggestions or modifications to code to get CLKOUT from external crystal.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Nov 2017 13:38:31 GMT</pubDate>
    <dc:creator>subodhmankar</dc:creator>
    <dc:date>2017-11-30T13:38:31Z</dc:date>
    <item>
      <title>lpc54618: XTAL crystal frequency not coming on CLKOUT</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/lpc54618-XTAL-crystal-frequency-not-coming-on-CLKOUT/m-p/751056#M4124</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 am using lpc54618 eval board, I was checking CLKOUT on oscilloscope using following code for BOARD_BootClockRUN but still was unable to see clock output on scope...&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;If I use :- &lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(&lt;/SPAN&gt;kOSC32K_OSC_to_CLKOUT); /*!&amp;lt; Switch CLKOUT to OSC32K_OSC */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;Or :- &lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kMAIN_CLK_to_CLKOUT&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;I get proper clkout on scope&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;I dont get output for :- &lt;SPAN style="color: #000000; font-size: medium; font-family: monospace;"&gt;CLOCK_AttachClk(kEXT_CLK_to_CLKOUT); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: medium; font-family: monospace;"&gt;/*!&amp;lt; Switch CLKOUT to EXT_CLK */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;********************** Configuration BOARD_BootClockRUN ***********************&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* clang-format off */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;!!Configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;name: BOARD_BootClockRUN&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;called_from_default_init: true&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;outputs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: CLKOUT_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FRO12M_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FROHF_clock.outFreq, value: 48 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: FXCOMs_CLK32K_clock.outFreq, value: 32.768 kHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: MAIN_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: System_clock.outFreq, value: 12 MHz}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;settings:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: SYSCON.CLKOUTSELA.sel, value: SYSCON._clk_in}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;sources:&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: RTC.rtc_32k_osc.outFreq, value: 32.768 kHz, enabled: true}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;- {id: SYSCON._clk_in.outFreq, value: 12 MHz, enabled: true}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* clang-format on */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* Variables for BOARD_BootClockRUN configuration&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;* Code for BOARD_BootClockRUN configuration&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;******************************************************************************/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; BOARD_BootClockRUN(&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up the clock sources */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up FRO */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_DisablePD(kPDRUNCFG_PD_FRO_EN); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Ensure FRO is on */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch to FRO 12MHz first to ensure we can change voltage without accidentally&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #3f7f5f;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;being below the voltage for current speed */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_DisablePD(kPDRUNCFG_PD_SYS_OSC); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Enable System Oscillator Power */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SYSCON-&amp;gt;SYSOSCCTRL = ((SYSCON-&amp;gt;SYSOSCCTRL &amp;amp; ~SYSCON_SYSOSCCTRL_FREQRANGE_MASK) | SYSCON_SYSOSCCTRL_FREQRANGE(0U)); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set system oscillator range */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;POWER_SetVoltageForFreq(12000000U); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set voltage for the one of the fastest clock outputs: System clock output */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetFLASHAccessCyclesForFreq(12000000U); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set FLASH wait states for core */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up RTC OSC */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_EnableClock(kCLOCK_Rtc); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Enable the RTC peripheral clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;RTC-&amp;gt;CTRL &amp;amp;= ~RTC_CTRL_SWRESET_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Make sure the reset bit is cleared */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;RTC-&amp;gt;CTRL &amp;amp;= ~RTC_CTRL_RTC_OSC_PD_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Setup RTC oscillator */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SYSCON-&amp;gt;RTCOSCCTRL = SYSCON_RTCOSCCTRL_EN_MASK; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Setup RTC oscillator clock source availability to other modules */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up dividers */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Reset divider counter and set divider to value 1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivClkOut, 0U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;true&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Reset CLKOUTDIV divider counter and halt it */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_SetClkDiv(kCLOCK_DivClkOut, 1U, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: small; font-family: monospace;"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set CLKOUTDIV divider to value 1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Set up clock selectors - Attach clocks to the peripheries */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch MAIN_CLK to FRO12M */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;CLOCK_AttachClk(kEXT_CLK_to_CLKOUT); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/*!&amp;lt; Switch CLKOUT to EXT_CLK */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;/* Set SystemCoreClock variable. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;SPAN style="font-size: small; font-family: monospace;"&gt;SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P&gt;In Main function following code is used&lt;/P&gt;&lt;P&gt;{......&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;CLOCK_DisableClock(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_ClockOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; CLOCK_EnableClock(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_ClockOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; sourceClockFreq = CLOCK_GetClockOutClkFreq();&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; font-family: monospace;"&gt;//CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, sourceClockFreq / EXAMPLE_SPI_BAUDRATE - 1U, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt; CLOCK_SetClkDiv(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; font-family: monospace;"&gt;&lt;EM&gt;kCLOCK_DivClkOut&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;, sourceClockFreq / EXAMPLE_CLKOUT_BAUDRATE, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;......}&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0cm; line-height: 100%;"&gt;&lt;SPAN style="color: #000000; font-size: small; font-family: monospace;"&gt;Please let me know any suggestions or modifications to code to get CLKOUT from external crystal.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 13:38:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/lpc54618-XTAL-crystal-frequency-not-coming-on-CLKOUT/m-p/751056#M4124</guid>
      <dc:creator>subodhmankar</dc:creator>
      <dc:date>2017-11-30T13:38:31Z</dc:date>
    </item>
  </channel>
</rss>

