<?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>[Basic Question] The speed of nRF51822 when executing instructions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8377/basic-question-the-speed-of-nrf51822-when-executing-instructions</link><description>Hi, recently I&amp;#39;m looking at some computer architecture books. 
 So my question could be easy or silly. 
 I tried to search more but I couldn&amp;#39;t find many. 
 The nRF51822 is based on Cortex-M0. So it has 56 instructions. 
 **/**********************</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 26 Jul 2015 08:24:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8377/basic-question-the-speed-of-nrf51822-when-executing-instructions" /><item><title>RE: [Basic Question] The speed of nRF51822 when executing instructions</title><link>https://devzone.nordicsemi.com/thread/30393?ContentTypeID=1</link><pubDate>Sun, 26 Jul 2015 08:24:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e2756b5-4902-4d6c-b7b8-47d1e2aab3d4</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;I didn&amp;#39;t thought about the ARM 6M reference manual. Thanks for letting me know.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;About Q4,&lt;/strong&gt; it sure is slow when comparing with the baud rate (115200) and time of one cycle.&lt;/p&gt;
&lt;p&gt;However, let me change the question a little bit.&lt;/p&gt;
&lt;p&gt;Suppose I attached a 3-axis digital gyroscope (&lt;a href="http://www.st.com/web/en/resource/technical/document/datasheet/DM00036465.pdf"&gt;L3GD20
&lt;/a&gt; for example) to the PCA10001.&lt;/p&gt;
&lt;p&gt;Using SPI, with the clock speed of 10 MHz, reading a value will take 1.6 * 10^-8 sec.&lt;/p&gt;
&lt;p&gt;(Since it uses 16 cycles.) After reading it, it need extra calculation to use it.&lt;/p&gt;
&lt;p&gt;However, since the nRF51822 does not have FPU (Floating Point Unit),&lt;/p&gt;
&lt;p&gt;I expected that the calculating time will be longer than 1.6 * 10^-8 sec.&lt;/p&gt;
&lt;p&gt;As you said, multiply will take much longer and if the program uses floating points, I thought it will take more.&lt;/p&gt;
&lt;p&gt;So, in this case, won&amp;#39;t there be a slight delay to earn the value?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [Basic Question] The speed of nRF51822 when executing instructions</title><link>https://devzone.nordicsemi.com/thread/30394?ContentTypeID=1</link><pubDate>Sun, 26 Jul 2015 07:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad1e1c59-5a26-43fb-a27f-534dc79d5ea6</guid><dc:creator>Chinook</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Exact timings of instructions execution are given in the Cortex-M0 Technical Reference Manual. Taken branches execute in three cycles. Loads and stores add one cycle to the number of registers loaded/stored, pops loading pc take 3 additional cycles. For loads and stores you also have to add number of wait states for peripheral accesses. In my belief it&amp;#39;s 2 wait states for all Nordic peripherals except RTC, for that it&amp;#39;s 3 wait states. All other instructions including mul (nRF51 uses fast multiplier option) take 1 cycle. You can easily measure execution time of a sequence of instructions using a timer. Start a timer with zero prescaler and trigger capture tasks just before and after the instruction sequence, then subtract corresponding captured values and subtract 4 for one of the TASKS_CAPTURE accesses.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;nRF51 runs at a fixed frequency of 16MHz, so instruction execution time is N/16 uS, where N is the duration of execution stage of that instruction.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;nRF51 has no wait states for RAM (except for conflicting accesses) and FLASH (except during program or erase) accesses, pipeline stages perfectly overlap and so you don&amp;#39;t have to bother with the pipeline.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [Basic Question] The speed of nRF51822 when executing instructions</title><link>https://devzone.nordicsemi.com/thread/30392?ContentTypeID=1</link><pubDate>Sun, 26 Jul 2015 06:20:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cf9ca98-2bd8-42c3-8a02-967f94aed446</guid><dc:creator>RK</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;no - many instructions take 1 cycle, some take more, multiply takes quite a few and the load store multiple takes time depending on how many registers you&amp;#39;re stacking. That&amp;#39;s all in the ARM 6M reference manual.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One cycle is 1/16 microsecond and many instructions take one cycle. They used 14 because there&amp;#39;s overhead in the rest of the loop to make an accurate delay (or not so accurate if you read other posts)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;no you don&amp;#39;t need to consider the pipeline. With the nRF52 you do have to consider the wait states on the flash and the pipeline comes into play there as it may stall, also the write buffer introduces cycles of delay here and there, the nrf51 doesn&amp;#39;t have those issues.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I have no idea and don&amp;#39;t really understand the question and UART rates are so much slower than the clock frequency of the chip I can&amp;#39;t see it would matter.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>