<?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のトピックNeed advice for a beginner</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154256#M647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, guys.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I just&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;started working with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;operating systems. And MQX is my first one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;&lt;SPAN&gt;Recently I learned to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;do some&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;simple things&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;with the help of&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;examples and application notes. It'&lt;SPAN&gt;s an exciting&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;process&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;And I have one question. What is the best way to organaize regular execution of task every 1 ms (its execution time is about 150us)? I tried to do that in such way:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;if (_timer_create_component(7, 1500) != MQX_OK) printf ("  Timer initializing error\n");else printf(" Timer initialize\n");_time_init_ticks(&amp;amp;ticks, 0);_time_add_msec_to_ticks(&amp;amp;ticks, 1);//_time_add_sec_to_ticks(icks, 1);SPI_timer = _timer_start_periodic_at_ticks(led_driver_task, 0, TIMER_ELAPSED_TIME_MODE, &amp;amp;ticks, &amp;amp;ticks);&lt;/PRE&gt;&lt;P&gt;It's work fine only when i use the seconds/(hundreds of ms) as a period.&amp;nbsp;&lt;IMG alt=":smileyfrustrated:" class="emoticon emoticon-smileyfrustrated" id="smileyfrustrated" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-frustrated.gif" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;And in such way:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;task(){  while(1){    my_function(&amp;amp;trans_matrix[0][0][0]);    _time_delay(1);  }}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;How would you&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;have done&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;this&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in my place?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;Regards, Rasul&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;P.S. How is my English?&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; Is it too many mistakes here?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 08:57:49 GMT</pubDate>
    <dc:creator>Rox</dc:creator>
    <dc:date>2020-10-29T08:57:49Z</dc:date>
    <item>
      <title>Need advice for a beginner</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154256#M647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, guys.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I just&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;started working with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;operating systems. And MQX is my first one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;&lt;SPAN&gt;Recently I learned to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;do some&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;simple things&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;with the help of&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;examples and application notes. It'&lt;SPAN&gt;s an exciting&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;process&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;And I have one question. What is the best way to organaize regular execution of task every 1 ms (its execution time is about 150us)? I tried to do that in such way:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;if (_timer_create_component(7, 1500) != MQX_OK) printf ("  Timer initializing error\n");else printf(" Timer initialize\n");_time_init_ticks(&amp;amp;ticks, 0);_time_add_msec_to_ticks(&amp;amp;ticks, 1);//_time_add_sec_to_ticks(icks, 1);SPI_timer = _timer_start_periodic_at_ticks(led_driver_task, 0, TIMER_ELAPSED_TIME_MODE, &amp;amp;ticks, &amp;amp;ticks);&lt;/PRE&gt;&lt;P&gt;It's work fine only when i use the seconds/(hundreds of ms) as a period.&amp;nbsp;&lt;IMG alt=":smileyfrustrated:" class="emoticon emoticon-smileyfrustrated" id="smileyfrustrated" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-frustrated.gif" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;And in such way:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;task(){  while(1){    my_function(&amp;amp;trans_matrix[0][0][0]);    _time_delay(1);  }}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;How would you&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;have done&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;this&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in my place?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;Regards, Rasul&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 12px;"&gt;P.S. How is my English?&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; Is it too many mistakes here?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154256#M647</guid>
      <dc:creator>Rox</dc:creator>
      <dc:date>2020-10-29T08:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need advice for a beginner</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154257#M648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did it.&lt;/P&gt;&lt;P&gt;Using ISR from second timer MTIM2.&lt;/P&gt;&lt;P&gt;I think it is a best decision.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2012 22:17:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154257#M648</guid>
      <dc:creator>Rox</dc:creator>
      <dc:date>2012-04-15T22:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need advice for a beginner</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154258#M649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again!&lt;/P&gt;&lt;P&gt;My problem was solved by following change in the MQX source code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;uint_32 _mcf51CN_timer_init_freq (........){  ............  // calculating prescale and rate  ............  /* set registers */  /* mtim_ptr-&amp;gt;MTIMCLK = ((uint_8) prescale);   mtim_ptr-&amp;gt;MTIMMOD = (uint_8) rate - 1;   mtim_ptr-&amp;gt;MTIMSC = MCF51XX_MTIMSC_TRST_MASK | (unmask_timer ? MCF51XX_MTIMSC_TOIE_MASK : 0); */  mtim_ptr-&amp;gt;MTIMCLK = 0x07;       // this value and value below are manualy calculated with process expert  mtim_ptr-&amp;gt;MTIMMOD = 0xF3;   mtim_ptr-&amp;gt;MTIMSC = MCF51XX_MTIMSC_TRST_MASK | (unmask_timer ? MCF51XX_MTIMSC_TOIE_MASK : 0);}&lt;/PRE&gt;&lt;P&gt;My project is already finished, and it works fine.&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;But I noticed that some timer functions like _time_delay() didn't worked properly. Generated time durations was changed. This is not a critical issue for my project.&lt;/P&gt;&lt;P&gt;And I understand that this is because of my change of MQX source code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question: Can this change cause any other problems except described above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any answer would be greatly appreciated!!&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MQX 3.6 was used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Need-advice-for-a-beginner/m-p/154258#M649</guid>
      <dc:creator>Rox</dc:creator>
      <dc:date>2020-10-29T08:57:51Z</dc:date>
    </item>
  </channel>
</rss>

