<?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>Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27166/can-internal-rc-be-used-for-ble-comms</link><description>MS76SF2_SCH_V12.pdf Hi,
I am using SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL); for ble_Stack_init() because the off the shelf board (not from Nordic) goes into a never ending loop when SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Oct 2017 00:57:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27166/can-internal-rc-be-used-for-ble-comms" /><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106991?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 00:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0427cd5b-3f22-4dbe-9ace-c41455f4a9bd</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, thanks for the response. If there is no LFCLK crystal connected in the board, then, we are left with only one option, which is, using internal RC oscillator. right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106998?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 00:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97b1550e-3566-4369-ba44-978002affaf5</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, as you can see in the attached schematics from the 3rd party manufacturer, there is no external 32KHz oscillator. There is only 16MHz oscillator. Will this be the reason why &amp;quot;SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);&amp;quot; never returns back - because there is no LF Xtal oscillator(32KHz)? In this case, would this : &amp;quot;SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, NULL);&amp;quot; be the best option to use? (Since you do not recommend starting 16MHZ xtal oscillator first - use this as HF clock and then use SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106997?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 00:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edcf368d-1c3b-41c6-899d-35b43e6aa3bc</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, To give you an update, this is what happens when I call &amp;quot;SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);&amp;quot; in s110, SDK10.0 version the program flow never returns back. When I hit the halt button and see under Peripherals, System Viewer, clock (in keil), I see the following: LFCLKRUN: STATUS: 1: Triggered = Task LFCLKSTART has been triggered; LFCLKSTAT: 0x00010000: SRC: 0: RC = Internal 32KHz RC Oscillator running and generating the LFCLK clock (THIS NEEDS TO BE 1: XTAL - EXTERNAL 32KHZ XTAL OSCILLATOR RUNNING, right?); STATE: 1: Running = LFCLK clock running; LFCLKSRCCOPY = 0x00000001: SRC: 1: Xtal = External 32KHz crystal. LFCLKSRC: 0x00000001: SRC = 1: Xta; = External 32KHz crystal; XTALFREQ = 0xFFFFFFFF&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106996?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 23:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bc198e4-7c8e-49d3-8139-c8a909f2ed08</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi, RK, thanks for your reply. Sorry, I have troubles understanding your previous answer. According to the nrf51 reference manual, LFCLKSRC can be one of the following: 0: Internal 32KHz RC oscillator; 1: External 32KHz crystal; 2: Internal 32KHz synthesiser from HFCLK system clock.
And I am left with (I use SDK 10.0 and s110) only one of the following options to be used in SOFTDEVICE_HANDLER_INIT. All the following options are LF. If I want to use LF external crystal, then, I need 32KHz connected across XL1 and XL2, right? Or, I could use 16MHz (which is the external crystal connected across XC1 and XC2) and use this as my HFCLK and use internal 32HZ synthesiser to synthesise the LF clock needed for SOFTDEVICE_HANDLER_INIT from external crystal, 16MHz, right? In other words, how can I use 16MHz external crystal to feed the required LF crystal clock (as needed by SOFTDEVICE_HANDLER_INIT)?:&lt;/p&gt;
&lt;p&gt;/&lt;strong&gt;@brief Possible lfclk oscillator sources. */
enum NRF_CLOCK_LFCLKSRCS
{
NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM,                       /&lt;/strong&gt;&amp;lt; LFCLK Synthesized from HFCLK.                    */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_500_PPM,                        /**&amp;lt; LFCLK crystal oscillator 500 PPM accuracy.       */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_250_PPM,                        /**&amp;lt; LFCLK crystal oscillator 250 PPM accuracy.       */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_150_PPM,                        /**&amp;lt; LFCLK crystal oscillator 150 PPM accuracy.       */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_100_PPM,                        /**&amp;lt; LFCLK crystal oscillator 100 PPM accuracy.       */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_75_PPM,                         /**&amp;lt; LFCLK crystal oscillator 75 PPM accuracy.        */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_50_PPM,                         /**&amp;lt; LFCLK crystal oscillator 50 PPM accuracy.        */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_30_PPM,                         /**&amp;lt; LFCLK crystal oscillator 30 PPM accuracy.        */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_20_PPM,                         /**&amp;lt; LFCLK crystal oscillator 20 PPM accuracy.        */&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION,        /**&amp;lt; LFCLK RC oscillator, 250ms  calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION,        /**&amp;lt; LFCLK RC oscillator, 500ms  calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION,       /**&amp;lt; LFCLK RC oscillator, 1000ms calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION,       /**&amp;lt; LFCLK RC oscillator, 2000ms calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION,       /**&amp;lt; LFCLK RC oscillator, 4000ms calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION,       /**&amp;lt; LFCLK RC oscillator, 8000ms calibration interval.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_1000MS_CALIBRATION,  /**&amp;lt; LFCLK RC oscillator. Temperature checked every 1000ms, if changed above a threshold, a calibration is done.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_2000MS_CALIBRATION,  /**&amp;lt; LFCLK RC oscillator. Temperature checked every 2000ms, if changed above a threshold, a calibration is done.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION,  /**&amp;lt; LFCLK RC oscillator. Temperature checked every 4000ms, if changed above a threshold, a calibration is done.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION,  /**&amp;lt; LFCLK RC oscillator. Temperature checked every 8000ms, if changed above a threshold, a calibration is done.*/&lt;/p&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_16000MS_CALIBRATION, /**&amp;lt; LFCLK RC oscillator. Temperature checked every 16000ms, if changed above a threshold, a calibration is done.*/&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106995?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 23:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7707032a-cc7b-406a-981f-de70355951c0</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;I have manually started the external HF clock using the following:
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
	{
	}    
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At this stage, using the peripherals/system viewer/clock tool in Keil, I am able to see that: EVENTS_HFCLKSTARTED = 1; HFCLKRUN: STATUS=1 : Triggered = Task HFCLKSTART has been triggered; HFCLKSTAT:0x00010001: SRC: 1: Xtal= External 16MHz/32MHz crystal oscillator running and generating the HFCLK. State: 1: Running = HFCLK clock running; XTALFREQ: 0xFFFFFFFF; XTALFREQ = 0xFF (meaning 16MHz clock according to nRF51 reference manual).
So, Now, I know that the external 16MHz clock has been started. Also I checked the pin 37 and 38 of the nrf51 and I can see ~16.2MHz clock. BUt, now when I call the following:
SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL); The program flow never comes back.. Any ideas as how to debug?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106994?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 23:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f21664e6-56e1-461d-aab5-4baedc1828e1</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, thanks for the reply. Sorry, about the previous answer. Will it be OK if I use this: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, NULL);? Meanwhile, I will try to figure out why I am not able to use external crystal. Any help in figuring out how to use external crystal would be of much help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106993?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 11:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdf4b2a4-8a12-4e96-b673-eb973162d137</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;as I pointed out earlier - synthsizing the LF clock from the HF clock is NOT recommended by Nordic and they don&amp;#39;t (as far as I know) test that configuration. You should use the crystal OR the RC LF clock which the softdevice keeps aligned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106992?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 05:59:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:023df72a-02da-47e6-92fe-7936119ee78b</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, you are right. After I used start up code, it worked. This is what I did:&lt;/p&gt;
&lt;p&gt;Step 1: Start HF clock (from Xtal ) manually by doing this:
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
	{
	}    
	//till this manually start HFClk
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Step 2: Synthesise the LF clock from the started HF clock by doing this:
// Initialize SoftDevice.
SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106990?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 02:10:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21a68925-91b2-4a9f-807f-e08cee98449a</guid><dc:creator>nordicdev</dc:creator><description>&lt;p&gt;Hi RK, Thanks for the response. The same code that was working on one of our custom made boards is not working on the off the shelf product from a 3rd party. So, I came to a conclusion that the loading capacitors are not right in the off the shelf product. Is there any example/code snippet where I could start the crystal using clock drivers and check the frequency? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can Internal RC be used for BLE comms?</title><link>https://devzone.nordicsemi.com/thread/106989?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2017 02:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d58761fb-2bfb-4b2a-8858-d0b325120a77</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You can use the RC  mode, the HFCLK synth one is not recommended.&lt;/p&gt;
&lt;p&gt;You should also work out why the external crystal isn&amp;#39;t working. Write a bit of code to start it by using the clock drivers and check the frequency.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>