<?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 does the nRF52840 indicate when HFXO is stable?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30699/how-does-the-nrf52840-indicate-when-hfxo-is-stable</link><description>I&amp;#39;m trying to measure the startup time of the 32 MHz XTAL at the pins XC1 and XC2. Often a microcontroller will indicate in a register that the XTAL and internal PLL are stable either through an event, or interrupt, or status register. 
 How does the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Feb 2018 15:59:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30699/how-does-the-nrf52840-indicate-when-hfxo-is-stable" /><item><title>RE: How does the nRF52840 indicate when HFXO is stable?</title><link>https://devzone.nordicsemi.com/thread/121448?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 15:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89e1b5ba-bf4a-4786-8d7a-82c282df1fd5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The simplest may be something like shown below,&amp;nbsp;you may also check that HFCLKSTAT register if external crystal is running:&lt;br /&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_1_0_18_2_3#register.HFCLKSTAT"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_1_0_18_2_3#register.HFCLKSTAT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Stop external HFCLK if it&amp;#39;s already running
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTOP = 1;        
    nrf_delay_us(1000); // Just some random delay to ensure it&amp;#39;s stopped    
    
    // Start HFCLK 
    // Note: The BLE softdevice require that the startup time is &amp;lt;1.5ms   
    NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;    
    while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
        ;    
    NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
    
    // External HFCLK is now running&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>