<?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: Time_Delay tick duration error</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Time-Delay-tick-duration-error/m-p/585299#M16601</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_time_delay() is blocking function, which puts the calling task to the timeout queue. When timeout exceeds for the task ( measured by the BSP tick timer interrupt ) the task is put back to ready queue. Then , RTOS scheduler runs and selects next active task to run depending on scheduling rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on what are other ready tasks at the moment and their priorities and what interrupts are running at the moment. _time_delay() is specified to guarantee minimum time, not maximum. Maximum depends on the application. That is normal RTOS behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what you mentioned is a normal hehaviour.&lt;/P&gt;&lt;P&gt;Have a nice weekend!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Sep 2016 07:15:42 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2016-09-02T07:15:42Z</dc:date>
    <item>
      <title>Time_Delay tick duration error</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Time-Delay-tick-duration-error/m-p/585298#M16600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have K60 Tower board: _K60P144M150SF3RM. CodeWarrior Version 10.6.4. MQX 4.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found that the system timer tick has a big deviation. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a task with priority 4 as highest in the project. In the task, just loop a counter with _time_delay(10):&lt;/P&gt;&lt;P&gt;void CAN_Task(uint32_t initial_data) {&lt;BR /&gt;volatile int iCanTaskCount = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;while (1) {&lt;BR /&gt;_time_delay(10);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //it seems that one cylce = 14.93 ms time, or 1 tick = 1.493 ms &lt;BR /&gt;iTaskCount++;&lt;BR /&gt;PRINT_MSG("%x: %d\r\n", iTaskCount);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//RESULT:&lt;/P&gt;&lt;P&gt;FOR 60SECONDS time duration, iTaskCount= 4018.&lt;/P&gt;&lt;P&gt;If the timer is accurrate, then the output of the iTaskCount shall be 6000.&lt;/P&gt;&lt;P&gt;That is huge error. Is it a software issue, or the system oscillator has error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;David Zhou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:04:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Time-Delay-tick-duration-error/m-p/585298#M16600</guid>
      <dc:creator>davidzhou</dc:creator>
      <dc:date>2016-09-01T21:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Time_Delay tick duration error</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Time-Delay-tick-duration-error/m-p/585299#M16601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_time_delay() is blocking function, which puts the calling task to the timeout queue. When timeout exceeds for the task ( measured by the BSP tick timer interrupt ) the task is put back to ready queue. Then , RTOS scheduler runs and selects next active task to run depending on scheduling rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on what are other ready tasks at the moment and their priorities and what interrupts are running at the moment. _time_delay() is specified to guarantee minimum time, not maximum. Maximum depends on the application. That is normal RTOS behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what you mentioned is a normal hehaviour.&lt;/P&gt;&lt;P&gt;Have a nice weekend!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:15:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Time-Delay-tick-duration-error/m-p/585299#M16601</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2016-09-02T07:15:42Z</dc:date>
    </item>
  </channel>
</rss>

