<?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のトピックRe: Using eTImer function for counting low speed signals</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Using-eTImer-function-for-counting-low-speed-signals/m-p/1781696#M24682</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;1) where is this code called in fact? From some interrupt?&lt;BR /&gt;What about to try to use eTimer Watchdog timer to monitor for stalled count?&lt;/P&gt;
&lt;P&gt;2) this will be due to capture FIFO watermark I think.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jan 2024 12:33:08 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2024-01-02T12:33:08Z</dc:date>
    <item>
      <title>Using eTImer function for counting low speed signals</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Using-eTImer-function-for-counting-low-speed-signals/m-p/1777291#M24648</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;We have used eTimer function for our speed and direction monitoring since long time. Now we have troubles when we monitor (relative) slow signals. The signal period could be 80 or 240ms. Attached is my configuration. I have used some prescalers to adjust the proper counting range. If overflow happens, it means that for about 850ms I have got no edges and I will determine the stop status (0 speed). The quadrature mode has been used. The priority of eTimer ICF interrupt has been set as 14, which is the highest in the software configuration. There are two problems:&lt;/P&gt;&lt;P&gt;- By a very little chance, no direction can be determined during rotation. I build counter difference of&amp;nbsp;CNTR register to get the direction. In my application if I get no direction during rotation, I will set a fatal error, which will kill the system. It is weird that for fast signals (10ms period) I never had this issue.&lt;/P&gt;&lt;P&gt;l_uscounter = (UINT16)ETIMER_0.CH[0].CNTR.R;&lt;BR /&gt;l_sscountdelta = (INT16)(l_uscounter - h_usSrec_spdircounter);&lt;BR /&gt;//check if the rotation direction can be determined by the quadrature counter,&amp;nbsp;calculation tolerance is 2&lt;BR /&gt;if ((l_sscountdelta &amp;gt; 0) &amp;amp;&amp;amp; (l_sscountdelta &amp;lt; 3))&lt;BR /&gt;g_usSrec_spdir = 1; //forward&lt;BR /&gt;else if ((l_sscountdelta &amp;gt; -3) &amp;amp;&amp;amp; (l_sscountdelta &amp;lt; 0))&lt;BR /&gt;g_usSrec_spdir = 2; //backward&lt;BR /&gt;else&lt;BR /&gt;g_usSrec_spdir = 0; //stopped or no direction&lt;BR /&gt;//record the counter value of quadrature mode&lt;BR /&gt;h_usSrec_spdircounter = l_uscounter;&lt;BR /&gt;g_usSrec_spdircounter_old = h_usSrec_spdircounter;&lt;/P&gt;&lt;P&gt;- From 0 speed to accelerate, the first 2-4 edges cannot trigger the ICF interrupt. This has been already&amp;nbsp; mentioned by someone in community forum.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 16:35:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Using-eTImer-function-for-counting-low-speed-signals/m-p/1777291#M24648</guid>
      <dc:creator>yixin</dc:creator>
      <dc:date>2023-12-19T16:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using eTImer function for counting low speed signals</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Using-eTImer-function-for-counting-low-speed-signals/m-p/1781696#M24682</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;1) where is this code called in fact? From some interrupt?&lt;BR /&gt;What about to try to use eTimer Watchdog timer to monitor for stalled count?&lt;/P&gt;
&lt;P&gt;2) this will be due to capture FIFO watermark I think.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 12:33:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Using-eTImer-function-for-counting-low-speed-signals/m-p/1781696#M24682</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-01-02T12:33:08Z</dc:date>
    </item>
  </channel>
</rss>

