<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to enable external clock</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75426/how-to-enable-external-clock</link><description>Hi, 
 
 In our board, GPIO 0, 1 is connected to external oscillator(32.768KHZ). 
 And I wish to use this oscillator instead of local oscillator. 
 CLOCK_CONFIG_LF_SRC is already set to 1. But It might need further configuration. 
 Please let me know how</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 May 2021 07:46:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75426/how-to-enable-external-clock" /><item><title>RE: How to enable external clock</title><link>https://devzone.nordicsemi.com/thread/310933?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 07:46:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44de8ae3-23b7-4a09-ad16-73dca16f7030</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The CLOCK_CONFIG_LF_SRC setting will only have an effect if you use the SDK clock driver, but it doesn&amp;#39;t look like the ESB example use this driver. Another option to using the driver is to start the the crystal oscillator directly as shown in the code snippet below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void clocks_start( void )
{
    // Start HFCLK and wait for it to start.
    NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);

    // Start LFXO and wait for it to start
    NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos;
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>