<?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 different runtime duration for LPC1313 in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544464#M8716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by orhan.dirik on Tue Nov 13 02:02:38 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using LPC1313FBD48 as the control MCU in our new medical design. For&amp;nbsp; some safety reason we would like to measure the runtime duration of&amp;nbsp; deterministic code piece. In the attached archive, at main.c a loop runs for&amp;nbsp; 150000 times and a timer is used for measuring this duration. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is&amp;nbsp; we get different timer counts when changing the code BEFORE the timer starts.&amp;nbsp; For example, when we use SysInit() function in main.c the timer counts 318753&amp;nbsp; each time we run the code. However, when we comment out the function and&amp;nbsp; uncomment the part above it, the timer counts 312503. Please note that, the code&amp;nbsp; piece above SysInit is the same as SysInit function itself. All in all, timer&amp;nbsp; counts differ due to previous codes that do not even start the timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can can&amp;nbsp; we get rid of this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:19:45 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:19:45Z</dc:date>
    <item>
      <title>different runtime duration for LPC1313</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544464#M8716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by orhan.dirik on Tue Nov 13 02:02:38 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using LPC1313FBD48 as the control MCU in our new medical design. For&amp;nbsp; some safety reason we would like to measure the runtime duration of&amp;nbsp; deterministic code piece. In the attached archive, at main.c a loop runs for&amp;nbsp; 150000 times and a timer is used for measuring this duration. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is&amp;nbsp; we get different timer counts when changing the code BEFORE the timer starts.&amp;nbsp; For example, when we use SysInit() function in main.c the timer counts 318753&amp;nbsp; each time we run the code. However, when we comment out the function and&amp;nbsp; uncomment the part above it, the timer counts 312503. Please note that, the code&amp;nbsp; piece above SysInit is the same as SysInit function itself. All in all, timer&amp;nbsp; counts differ due to previous codes that do not even start the timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can can&amp;nbsp; we get rid of this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:19:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544464#M8716</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: different runtime duration for LPC1313</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544465#M8717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Tue Nov 13 05:37:32 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know which version and which optimization your project is running (you didn't post your complete project ;)),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; but i would strongly suggest to tell your compiler how to handle 'dummy'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Changing your code to&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile unsigned int counter, result, dummy;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;might give you a more stable result through different optimization settings :):)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:19:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544465#M8717</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: different runtime duration for LPC1313</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544466#M8718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by orhan.dirik on Tue Nov 13 07:32:39 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Making the variables did not work. However the problem is solved for different optimization levels other than level-0, thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On the other hand, it is little bit confusing now, since level-0 means no optimization I would not expects such a behavior. Having full control over the firmware was my motivation by selecting level-0, but it seems that turning of all optimizations does not provide the control I expected. I also attached the whole project. Any comments?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:19:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544466#M8718</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: different runtime duration for LPC1313</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544467#M8719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Tue Nov 13 07:52:29 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: orhan.dirik&lt;/STRONG&gt;&lt;BR /&gt;Any comments?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 This is a Keil project, so believe it or not I'm talking about LPCXpresso (in LPCXpresso Forum) ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 It's difficult to determinate what a compiler is doing and how it's working in detail. Different compilers behave different. Especially usage of 'volatile' is different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#3 Delay functions with loops should of course be replaced by timer functions :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:19:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544467#M8719</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: different runtime duration for LPC1313</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544468#M8720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by orhan.dirik on Tue Nov 13 07:59:09 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for your explanations :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:19:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/different-runtime-duration-for-LPC1313/m-p/544468#M8720</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:19:47Z</dc:date>
    </item>
  </channel>
</rss>

