<?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>MQX Software SolutionsのトピックRe: Bug report: _time_delay() not the good delay.</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340304#M10967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact we should use time_delay to appy "at least" the specified time.&lt;/P&gt;&lt;P&gt;SO to have a periodic task, a simple way will be to call _time_delay(task_Period -1)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 06:22:13 GMT</pubDate>
    <dc:creator>arnogir</dc:creator>
    <dc:date>2015-01-14T06:22:13Z</dc:date>
    <item>
      <title>Bug report: _time_delay() not the good delay.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340302#M10965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made some test because task period seem to me so long..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I with test MQX 4.1 and only one task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Task:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14211638335744461" jivemacro_uid="_14211638335744461"&gt;
&lt;P&gt; /*Port initialization */&lt;/P&gt;
&lt;P&gt;[...]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;for&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; (;;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt; /* Toggle led */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; /* ****** Here instruction which toggle Led ****/
&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #642880; font-size: 10pt;"&gt;_time_delay&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;(X);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;}
&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I measured the SIgnal on the Led and measure the period for different value of "X" passed in _time_delay();.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X= 1&amp;nbsp;&amp;nbsp; measured time = 10ms &lt;BR /&gt;X= 5&amp;nbsp;&amp;nbsp; measured time = 10ms&lt;/P&gt;&lt;P&gt;X= 10&amp;nbsp;&amp;nbsp; measured time = 15ms&lt;/P&gt;&lt;P&gt;X = 12&amp;nbsp;&amp;nbsp; measured time = 20ms&lt;/P&gt;&lt;P&gt;X = 100&amp;nbsp;&amp;nbsp; measured time = 105ms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For information, BSP_ALARM_FREQUENCY&amp;nbsp; = 200&amp;nbsp;&amp;nbsp; (5ms)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, the time is always delayed by 5ms. (When asked time is a multiple of BSP_ALARM_FREQUENCY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you think of this? How can I make _time_delay exactly the asked time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:54:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340302#M10965</guid>
      <dc:creator>arnogir</dc:creator>
      <dc:date>2015-01-13T15:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bug report: _time_delay() not the good delay.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340303#M10966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arno,&lt;/P&gt;&lt;P&gt;If you need to have the &lt;U&gt;time&lt;/U&gt;delay(ms); more accurate you can increase the BSP_ALARM_FREQUENCY (max is 1000) or implement a routine to take advantage of one of the on-chip timers that could generate and ISR and set an event flag for your application to continue.&lt;/P&gt;&lt;P&gt;In general the &lt;U&gt;time&lt;/U&gt;delay(ms); is ensuring your application will block for at least the number of ms you enter as a minimum and not a maximum.  The ms is converted to TICKS in the function call and rounded up one TICK.  The TICK is the heartbeat of the RTOS and is synchronice.  Many internal timers and services use it to determine when another task should be blocked or unblocked.  Then the scheduler will run to determine which task is the highest priority ready to run task.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 20:11:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340303#M10966</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-01-13T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bug report: _time_delay() not the good delay.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340304#M10967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact we should use time_delay to appy "at least" the specified time.&lt;/P&gt;&lt;P&gt;SO to have a periodic task, a simple way will be to call _time_delay(task_Period -1)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 06:22:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Bug-report-time-delay-not-the-good-delay/m-p/340304#M10967</guid>
      <dc:creator>arnogir</dc:creator>
      <dc:date>2015-01-14T06:22:13Z</dc:date>
    </item>
  </channel>
</rss>

