<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: clock cycle activity for LPC1114 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808961#M32479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One reason for code executing more slowly than you expect is that the code is executing out of Flash, which can introduce wait-states.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2018 09:11:39 GMT</pubDate>
    <dc:creator>converse</dc:creator>
    <dc:date>2018-11-28T09:11:39Z</dc:date>
    <item>
      <title>clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808959#M32477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;I am now working with the LPC1114 which utilizes the ARM CORTEX M0 architecture. I have one question about the instruction set summary of the ARMv6M Thumb instruction set. I want to know what the processor does during each single clock cycle for each instruction. For example, if I have the following code where I want to write something to the GPIO0DATA register to change the level of the IO output (Actually toggle PIO0_3)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;loop&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;LDR R0, =(0x50003FFC); GPIO0DATA Base + 0x3FFC, address 0x5000 3FFC&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;LDR R1, [R0];&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;MOVS R2, #(1&amp;lt;&amp;lt;3);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;; Store the value of R1 into GPIO0DATA&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;EORS R1, R1, R2;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;STR R1, [R0];&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;B loop&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Question 1:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Let's say the first clock cycle is when the chip fetches the LDR R0, =(0x50003FFC) instruction.&amp;nbsp; what the chip does in the following clock cycles? Also if there is any reference that could explain it, that will be really helpful.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Question 2:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;I find that the time between PIO0_3 is toggled every 15 cycles. However, based on the instruction set summary, it should be 11 cycles (LDR/STR takes two cycles and MOVS, EORS takes 1 cycle, B takes 3 cycles),&amp;nbsp;anyone knows why? If there is a timing diagram to explain it, that would be great!&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2018 23:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808959#M32477</guid>
      <dc:creator>heaton_1991</dc:creator>
      <dc:date>2018-11-27T23:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808960#M32478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Hi, Liao,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;I suppose that you can modify your code as following to save instruction cycle time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;LDR R0, =(0x50003FFC); GPIO0DATA Base + 0x3FFC, address 0x5000 3FFC&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;loop:LDR R1, [R0];&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;MOVS R2, #(1&amp;lt;&amp;lt;3);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;; Store the value of R1 into GPIO0DATA&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;EORS R1, R1, R2;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;STR R1, [R0];&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;B loop&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000; font-size: small;"&gt;&lt;SPAN&gt;Because the R0 is not changed in the loop, so you can move loop label in the next line to save cycle time.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000; font-size: small;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Question 1:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Let's say the first clock cycle is when the chip fetches the LDR R0, =(0x50003FFC) instruction.&amp;nbsp; what the chip does in the following clock cycles? Also if there is any reference that could explain it, that will be really helpful.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;The line &lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;LDR R0, =(0x50003FFC)&amp;nbsp; is a macro, it is replaced with two movs instruction. As you know that&lt;SPAN&gt; the Cortex-M0 core instruction is word(32 bits) or half word(16 bits),because the operand&amp;nbsp;0x50003FFC is 32 bits so it is replaced by two moves instructions.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Question 2:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #000000; background-color: #ffffff; font-size: small;" /&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;I find that the time between PIO0_3 is toggled every 15 cycles. However, based on the instruction set summary, it should be 11 cycles (LDR/STR takes two cycles and MOVS, EORS takes 1 cycle, B takes 3 cycles),&amp;nbsp;anyone knows why? If there is a timing diagram to explain it, that would be great!&lt;SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;I do not know where you get the cycle time of each instruction, anyway, because of pipeline, maybe the jump instruction B occupies multiple cycles. The Cortex-M0 is ARM IP, I suggest you ask ARM company directly, we have not detailed doc about the core.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;&lt;SPAN&gt;Hope it can help you&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: small;"&gt;&lt;SPAN&gt;Xiangjun Rong&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 06:02:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808960#M32478</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2018-11-28T06:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808961#M32479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One reason for code executing more slowly than you expect is that the code is executing out of Flash, which can introduce wait-states.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 09:11:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808961#M32479</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2018-11-28T09:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808962#M32480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Rong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mentioned that "The line LDR R0, =(0x50003FFC)  is a macro, it is&lt;/P&gt;&lt;P&gt;replaced with two movs instruction", Could you please explain what the two&lt;/P&gt;&lt;P&gt;movs instructions are?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Haohao.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xiangjun.rong &amp;lt;admin@community.nxp.com&amp;gt; 于2018年11月28日周三 上午1:03写道：&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;NXP Community&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg&amp;gt;&lt;/P&gt;&lt;P&gt;Re: clock cycle activity for LPC1114&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from xiangjun.rong&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.nxp.com/people/xiangjun.rong?et=watches.email.thread&amp;gt;&lt;/P&gt;&lt;P&gt;in &lt;STRONG&gt;LPC Microcontrollers&lt;/STRONG&gt; - View the full discussion&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.nxp.com/message/1085134?commentID=1085134&amp;amp;et=watches.email.thread#comment-1085134&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 17:41:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808962#M32480</guid>
      <dc:creator>heaton_1991</dc:creator>
      <dc:date>2018-11-28T17:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808963#M32481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Liao,&lt;/P&gt;&lt;P&gt;Anyway, the LDR Rd=constant is a pseudo-instruction, maybe different compiler deal with in different way.&lt;/P&gt;&lt;P&gt;This is the part I find in DUI0801E_armasm_user_guide.pdf&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.7 Load immediate values using LDR Rd, =const&lt;BR /&gt;The LDR Rd,=const pseudo-instruction generates the most efficient single instruction to load any 32-bit&lt;BR /&gt;number.&lt;BR /&gt;You can use this pseudo-instruction to generate constants that are out of range of the MOV and MVN&lt;BR /&gt;instructions.&lt;BR /&gt;The LDR pseudo-instruction generates the most efficient single instruction for the specified immediate&lt;BR /&gt;value:&lt;BR /&gt;• If the immediate value can be constructed with a single MOV or MVN instruction, the assembler&lt;BR /&gt;generates the appropriate instruction.&lt;BR /&gt;• If the immediate value cannot be constructed with a single MOV or MVN instruction, the assembler:&lt;BR /&gt;— Places the value in a literal pool (a portion of memory embedded in the code to hold constant&lt;BR /&gt;values).&lt;BR /&gt;— Generates an LDR instruction with a PC-relative address that reads the constant from the literal&lt;BR /&gt;pool.&lt;BR /&gt;For example:&lt;BR /&gt;LDR rn, [pc, #offset to literal pool]&lt;BR /&gt;; load register n with one word&lt;BR /&gt;; from the address [pc + offset]&lt;BR /&gt;You must ensure that there is a literal pool within range of the LDR instruction generated by the&lt;BR /&gt;assembler.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 07:34:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808963#M32481</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2018-11-29T07:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: clock cycle activity for LPC1114</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808964#M32482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Rong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help! I really appreciate it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xiangjun.rong &amp;lt;admin@community.nxp.com&amp;gt; 于2018年11月29日周四 上午2:35写道：&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;NXP Community&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg&amp;gt;&lt;/P&gt;&lt;P&gt;Re: clock cycle activity for LPC1114&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from xiangjun.rong&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.nxp.com/people/xiangjun.rong?et=watches.email.thread&amp;gt;&lt;/P&gt;&lt;P&gt;in &lt;STRONG&gt;LPC Microcontrollers&lt;/STRONG&gt; - View the full discussion&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.nxp.com/message/1085904?commentID=1085904&amp;amp;et=watches.email.thread#comment-1085904&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 16:58:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/clock-cycle-activity-for-LPC1114/m-p/808964#M32482</guid>
      <dc:creator>heaton_1991</dc:creator>
      <dc:date>2018-11-29T16:58:31Z</dc:date>
    </item>
  </channel>
</rss>

