<?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>Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20628/using-external-16mhz-help-with-code</link><description>Hi all!
I&amp;#39;m a beginner developer.
I start my work with nrf51822, download examples e.t.c
Now I try to download my code in real PCB with external 16MHz crystal.
Code worked on a kit but doesnot work on a real PCB.
I think this is due to incorrect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Mar 2017 07:10:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20628/using-external-16mhz-help-with-code" /><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80415?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 07:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baca77c3-25e4-4a9e-9048-7ec642b39770</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The chip will assume that a 16 MHz crystal is being used. If a 32 MHz crystal is being used, it will have to be set explicitly.&lt;/p&gt;
&lt;p&gt;From what I can see, when looking at nrf_drv_clock, the setting CLOCL_CONFIG_XTAL_FREQ is not referenced/used by the driver..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80413?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 12:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469d950a-c96c-4998-8389-3f35664d096c</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;If I understood correctly what you mean&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80412?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 12:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56e15665-73bf-4397-ab4f-af0d627e7156</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;I tested external cristal and changed it. I use oscilloscope and see clocks if I activated in nrf_drv_config header or didnot see if i delete string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define CLOCK_CONFIG_XTAL_FREQ          NRF_CLOCK_XTALFREQ_16MHz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define CLOCK_CONFIG_XTAL_FREQ          NRF_CLOCK_XTALFREQ_Default
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I dont know what are differences between this strings.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80411?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 11:40:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10ef327f-2ace-42b5-96a9-db50638007f6</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I have uploaded code for checking that the HKCLK can be started. Could you test it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80407?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 13:12:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08465051-98ba-47fa-9245-66ac8769f082</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;I downloaded code (uart-test) I some changed it and PCB started to spam some text in putty.
But I donot use the stack in this code. If I try to use another examples (Scan and Spam or Service example), I cant see my PCB in ether and my kit donot work to with this examples. Maybe I dont downloaded the stack.
How can I test it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80414?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 11:44:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1b25f3f-53f3-4fa7-8559-f132a702820d</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Good that it works with SDK 11. Although I cannot see any reason why it should not work for SDK 12. ) With SDK 12, did you remember to test the project for nRF51? )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80410?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 10:35:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d9dea1-fdaa-4132-a931-c2104eae2bf6</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;I did it, maybe something wrong with sdk 12.
Because I downloaded code for uart with sdk11 in my PCB , changed external clock on RC clock and it is work.
Will try to use sdk11 and my code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80403?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:853dfebb-9aef-47b4-b46e-f7adb4a23d55</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Did you check if the crystal is within the specification? And double checked the value of the two capacitors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80409?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 09:39:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84497372-1cb4-4653-983e-02e842d86b54</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;Thank you for your advice.
I removed R32, сrystal still does not work.
Some later try to change capacitors. but my colleague checked our calculation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80408?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 07:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64998f43-e6c4-4eec-8586-1f47cfee5b00</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;R32 shuold be removed. Could you verify that the crystal is within the specifications in the Product Specification, chapter 8.1.2. Could you also double check that the value of C17 and C18 is correctly calculated according to the formula I linked to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80406?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 14:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:965f2115-60cf-45e9-a8f1-10a0cd746f8e</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;This is part of shematic  with cristal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80405?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 13:59:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a3960c7-495b-427a-91e8-eaef40b51653</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Cristall.bmp" alt="Cristall.jpg" /&gt;(/attachment/4d92daaba009da4f99f6c92ba0af1332)(/attachment/aaafb5120a63aeeaed73ba22d6cc9806)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80404?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 13:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f656793-5743-4fc3-90bc-cb92f2253733</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Could you upload the schematic with the part related to the crystal? The value of the decoupling capacitors should be according to &amp;quot;crystal and load capacitors&amp;quot; section in &lt;a href="https://devzone.nordicsemi.com/tutorials/35/"&gt;this&lt;/a&gt; tutorial.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80402?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 12:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53a7b11d-bba2-4025-8529-9bdec3daa679</guid><dc:creator>Diman142222</dc:creator><description>&lt;p&gt;Cristal is HC-49SM 16MHz
capacitors: 33pF
And parallel with Cristal I connect resistor 1M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using External 16MHz (help with code)</title><link>https://devzone.nordicsemi.com/thread/80401?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 09:46:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97c12daf-8ffe-4072-afd1-25f114909ebb</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;No code is needed for activating the external 16 MHz crystal. When you need the crystal, it should be sufficient to just start it.&lt;/p&gt;
&lt;p&gt;Could you double check that the crystal on your board is mounted correctly, i.e. not shifted by 90 degrees for example?&lt;/p&gt;
&lt;p&gt;Which 16 MHz crystal do you use? And what is the value of the decoupling capacitors for the crystal?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 28.03.2017:&lt;/strong&gt; The attached example shows how to easily check that the HFCLK can be started. The example is made from SDK 12.2, and should be placed in the following folder: ..\nRF5_SDK_12.2.0_f012efa\examples\peripheral : &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/clock_5F00_122023_5F00_devzone_5F00_clock_5F00_start.zip"&gt;clock_122023_devzone_clock_start.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The code for checking that the HFCLK is starting is the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;

while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
{
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>