<?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>change clock speed nrf52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15093/change-clock-speed-nrf52</link><description>I have some troubles to understand the system clock functionality.
I am using a Module from Rigado which uses the nRF52 and has an external 32Mhz osc. on board. 
 In the nrv_drv_config.h file follwing value is set for the HFCLK controller. 
 #define</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Jul 2016 10:59:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15093/change-clock-speed-nrf52" /><item><title>RE: change clock speed nrf52</title><link>https://devzone.nordicsemi.com/thread/57648?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 10:59:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c8bd3a-4196-4ed4-84b0-1111a33afe2f</guid><dc:creator>TY</dc:creator><description>&lt;p&gt;Great that explains what I am experiencing.&lt;/p&gt;
&lt;p&gt;Since I am sure now that the nRF52 is running on full speed. I can focus on making my code faster in order to handle the interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change clock speed nrf52</title><link>https://devzone.nordicsemi.com/thread/57647?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 10:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01a26fcc-2d0a-4803-ba94-fef74edb9794</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;ok so 500kHz, that&amp;#39;s the time for a full cycle so you&amp;#39;re getting one toggle every 1us, so that&amp;#39;s closer. With the clock running at 64MHz that&amp;#39;s about 64 instructions per toggle. I just eyeballed the compiled code and rough-counted the instructions as something like 32, that includes all the entry/exit code for the routine as well as the actual toggle.&lt;/p&gt;
&lt;p&gt;So if my count&amp;#39;s right, we&amp;#39;re about a factor of 2 off. But you&amp;#39;re running from flash, that might introduce a wait state. I&amp;#39;m not convinced by that statement partly because there&amp;#39;s cache RAM on the chip to deal with that exact thing. That simple code should prime the cache and get it running with 0 wait states. If you have however an average of 1 wait state, there&amp;#39;s your factor of two.&lt;/p&gt;
&lt;p&gt;Hmm .. checks manual. I think the cache isn&amp;#39;t enabled by default. Try that one thing, &lt;code&gt;NRF_NVMC-&amp;gt;ICACHECNF = 0x01&lt;/code&gt;. See what happens.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change clock speed nrf52</title><link>https://devzone.nordicsemi.com/thread/57646?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 09:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bef09c16-0a98-4a64-8a17-64b9544ba2b2</guid><dc:creator>TY</dc:creator><description>&lt;p&gt;This all my code:
err_code = nrf_drv_clock_init();
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(1)
{
	nrf_gpio_pin_toggle(LED_4);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And I am measuring the frequency with an Tektronix oscilloscope.
I had on button poll left which I have deleted now and now I am getting close to 500 Khz.&lt;/p&gt;
&lt;p&gt;The gcc optimaziation is off, how can I see the instructions count.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/500hz.jpg" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change clock speed nrf52</title><link>https://devzone.nordicsemi.com/thread/57645?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 09:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ae93987-4304-4500-b8c0-4ea9460c6e1f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You can&amp;#39;t change the system clock, it&amp;#39;s 64MHz and that&amp;#39;s it.&lt;/p&gt;
&lt;p&gt;How are you measuring 300kHz on the LED pin? I just compiled nrf_gpio_pin_toggle() and counted the instructions and it&amp;#39;s about 30, call it 32, so if all you have is that in a loop there&amp;#39;s no way you can be getting 300kHz, should be 6 times that, that is really all your code,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(1)
    nrf_gpio_pin_toggle( LED_4);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>