<?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>MPC5xxxのトピックHow do I use IC function of eTPU correctly?</title>
    <link>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411436#M830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,guys. now I get a problem.&lt;/P&gt;&lt;P&gt;First, I configure&amp;nbsp; eTPU channel 24/25/26/27 as input capture,the code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; errorCode = fs_etpu_ic_init(24, FS_ETPU_PRIORITY_HIGH, ETPU_IC_MODE_CONT, FS_ETPU_TCR1, ETPU_IC_ANY_EDGE, 1);&lt;/P&gt;&lt;P&gt;then, I used these channels to calculate the pulse width (T),the principal is &lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; background-color: #fafafa;"&gt;as shown below, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;picture1:&lt;/STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="39649_39649.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120402i4BA909C509B270FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="39649_39649.png" alt="39649_39649.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37658i9C3F512CC6BE3EBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; line-height: 18px; background-color: #fafafa;"&gt;and the code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if( edge ==&amp;nbsp; CONF_EDGE_RISING ) &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numTcntEnd = 0x00FFFFFFUL &amp;amp; (uint32)fs_etpu_ic_read_final_time(24);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(numTcntStart&amp;nbsp; &amp;lt;= numTcntEnd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PW = numTcntEnd - numTcntStart;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PW = 0x00FFFFFFUL - numTcntStart + numTcntEnd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numTcntStart = 0x00FFFFFFUL &amp;amp; (uint32)fs_etpu_ic_read_final_time(24);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Later, when MCU was running, PW is calculated correctly.&lt;/P&gt;&lt;P&gt;But when I&amp;nbsp; configure&amp;nbsp; eTPU channel 0/1/2/3 as QOM output, and were performed in interrupt2(see picture1),then &lt;SPAN style="color: #e23d39;"&gt;PW is calculated &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; background-color: #fafafa;"&gt;&lt;SPAN style="color: #e23d39;"&gt;mistakenly sometimes&lt;/SPAN&gt;. The code of set qom output is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ETPU.CHAN[0].SCR.B.CIS=1; &lt;/P&gt;&lt;P&gt;errorCode=fs_etpu_qom_init(0,FS_ETPU_PRIORITY_HIGH ,FS_ETPU_QOM_SINGLE_SHOT,FS_ETPU_TCR1,CONF_IGN_IDLE,FS_ETPU_QOM_IMMEDIATE ,0,1,2,event.Ign[x]);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's very strange, and I get no idea to solve it, can you help me?&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your attention!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2015 22:23:47 GMT</pubDate>
    <dc:creator>gexiaocheng</dc:creator>
    <dc:date>2015-06-18T22:23:47Z</dc:date>
    <item>
      <title>How do I use IC function of eTPU correctly?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411436#M830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,guys. now I get a problem.&lt;/P&gt;&lt;P&gt;First, I configure&amp;nbsp; eTPU channel 24/25/26/27 as input capture,the code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; errorCode = fs_etpu_ic_init(24, FS_ETPU_PRIORITY_HIGH, ETPU_IC_MODE_CONT, FS_ETPU_TCR1, ETPU_IC_ANY_EDGE, 1);&lt;/P&gt;&lt;P&gt;then, I used these channels to calculate the pulse width (T),the principal is &lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; background-color: #fafafa;"&gt;as shown below, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;picture1:&lt;/STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="39649_39649.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120402i4BA909C509B270FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="39649_39649.png" alt="39649_39649.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37658i9C3F512CC6BE3EBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; line-height: 18px; background-color: #fafafa;"&gt;and the code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if( edge ==&amp;nbsp; CONF_EDGE_RISING ) &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numTcntEnd = 0x00FFFFFFUL &amp;amp; (uint32)fs_etpu_ic_read_final_time(24);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(numTcntStart&amp;nbsp; &amp;lt;= numTcntEnd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PW = numTcntEnd - numTcntStart;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PW = 0x00FFFFFFUL - numTcntStart + numTcntEnd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numTcntStart = 0x00FFFFFFUL &amp;amp; (uint32)fs_etpu_ic_read_final_time(24);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Later, when MCU was running, PW is calculated correctly.&lt;/P&gt;&lt;P&gt;But when I&amp;nbsp; configure&amp;nbsp; eTPU channel 0/1/2/3 as QOM output, and were performed in interrupt2(see picture1),then &lt;SPAN style="color: #e23d39;"&gt;PW is calculated &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 12px; background-color: #fafafa;"&gt;&lt;SPAN style="color: #e23d39;"&gt;mistakenly sometimes&lt;/SPAN&gt;. The code of set qom output is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ETPU.CHAN[0].SCR.B.CIS=1; &lt;/P&gt;&lt;P&gt;errorCode=fs_etpu_qom_init(0,FS_ETPU_PRIORITY_HIGH ,FS_ETPU_QOM_SINGLE_SHOT,FS_ETPU_TCR1,CONF_IGN_IDLE,FS_ETPU_QOM_IMMEDIATE ,0,1,2,event.Ign[x]);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's very strange, and I get no idea to solve it, can you help me?&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your attention!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 22:23:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411436#M830</guid>
      <dc:creator>gexiaocheng</dc:creator>
      <dc:date>2015-06-18T22:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use IC function of eTPU correctly?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411437#M831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you describe some details about faulty behavior? What number have you obtained? Have you tried to change channel priorities?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 08:09:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411437#M831</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2015-07-01T08:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use IC function of eTPU correctly?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411438#M832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had already solved it, thank you for your attention!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 23:01:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-do-I-use-IC-function-of-eTPU-correctly/m-p/411438#M832</guid>
      <dc:creator>gexiaocheng</dc:creator>
      <dc:date>2015-07-09T23:01:54Z</dc:date>
    </item>
  </channel>
</rss>

