<?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: ETPU - Setting TRR in Engine Control</title>
    <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396917#M20101</link>
    <description>&lt;P&gt;Hi John, thank you for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mert.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jan 2022 22:29:11 GMT</pubDate>
    <dc:creator>mertk</dc:creator>
    <dc:date>2022-01-10T22:29:11Z</dc:date>
    <item>
      <title>ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396709#M20097</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently working on eTPU - AN4907 Engine Control demo. In the etpuc_crank.c (CRANK function), I saw the below function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mertk_1-1641805517450.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/167135iB7CC4356753D978A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mertk_1-1641805517450.png" alt="mertk_1-1641805517450.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;mertk_1-1641805517450.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I understand the purpose of the function and I know we should set TRR for every tooth after the synchronization. However, &lt;EM&gt;&lt;STRONG&gt;I am struggling the understanding why we are shifting&amp;nbsp;the mach register left by 9.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The below image shows the TRR register of the eTPU for MPC5644A microcontroller.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mertk_2-1641805706163.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/167137i19D354C9B7632461/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mertk_2-1641805706163.png" alt="mertk_2-1641805706163.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;mertk_2-1641805706163.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In order to make clear everything, I want to give an example which the values are taken from the random point of the demo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;tooth_period = 272024 (in TCR1)&lt;/P&gt;&lt;P&gt;crank_local.tcr2_ticks_per_tooth = 100 (default value in demo)&lt;/P&gt;&lt;P&gt;First, we should process the "integer part of TRR";&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;tooth_period / crank_local.tcr2_ticks_per_tooth = 272024 / 100 = 2720 (rounding down - MACH register will be equal to the 24 which is called as remainder)&lt;/LI&gt;&lt;LI&gt;After the division in order to put the 2720 (integer part) to related bit field in the TRR register we should shift it left by 9. =&amp;gt; 2720 &amp;lt;&amp;lt; 9 = 1392640 (0x154000 in hex)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Secondly, we should process the "fractional part of TRR";&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;mach (which is equal to the 24) &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;&amp;lt; 9&lt;/FONT&gt; &lt;/STRONG&gt;= 12288&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;After the shifting mach register, in order to convert the remainder to the fraction we divide the shifted mach with crank_local.tcr2_ticks_per_tooth =&amp;gt; 12288 / 100 = 122 (0x7A in hex - rounding down)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Lastly, add them to get TRR value =&amp;gt; 0x154000 + 0x7A = 0x15407A&lt;/P&gt;&lt;P&gt;Normally, if we do NOT work on bits, I should expect the presentation of the fraction part of TRR is 24/100 where it means that mach / crank_local.tcr2_ticks_per_tooth. As you can notice, there is no shifting in the mach! However in aspect of bits, if divide 24 to 100, we will get 0 (zero). So, this is not gonna be work.&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;U&gt;&lt;STRONG&gt;So, why we are shifting mach (remainder) by 9 where I mark it with red color? Is this related with the design of the eTPU?&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I tried to explain more clearly, hope you understand what I ask. Also, I read &lt;STRONG&gt;24.5.7.4.1 Calculating the angle tick period integer and fraction &lt;/STRONG&gt;section in RM of MPC5644A.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 10:29:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396709#M20097</guid>
      <dc:creator>mertk</dc:creator>
      <dc:date>2022-01-10T10:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396734#M20099</link>
      <description>&lt;P&gt;Oh, I've struggle that question for 2-3 days and when I checking my question. I noticed something &lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Again, we assume that, &lt;STRONG&gt;tooth_period = 272024&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;crank_local.tcr2_ticks_per_tooth = 100.&lt;/STRONG&gt;&amp;nbsp;In the integer part, we are shifting the division result left by 9. But, what is the result value of division? It is 2720 (tooth_period / crank_local.tcr2_ticks_per_tooth). This number can be found also if the tooth_period = 272000. I mean, we are losing the effect of the last two digit (two digit beucase we divide with 100) of the tooth period. Because we didn't shift the tooth_period, we shift the result of the division!&lt;/P&gt;&lt;P&gt;Therefore, in order to preserve the importance of the value of 24 (actually it's remainder right &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt; ), we should shift the remainder left by 9! Then we can divide it again the crank_local.tcr2_ticks_per_tooth to get raction part of the trr.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it is understandable. If I am true, I would like to know that, so I am still looking forward for your helps friends.&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mert.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 11:42:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396734#M20099</guid>
      <dc:creator>mertk</dc:creator>
      <dc:date>2022-01-10T11:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396846#M20100</link>
      <description>&lt;P&gt;I believe your description is accurate.&amp;nbsp; The initial tooth period cannot be shifted left before the first division because in many cases (slower engine speeds) overflow would result, thus the decomposition into two divides.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 17:16:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396846#M20100</guid>
      <dc:creator>johndiener</dc:creator>
      <dc:date>2022-01-10T17:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396917#M20101</link>
      <description>&lt;P&gt;Hi John, thank you for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mert.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 22:29:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1396917#M20101</guid>
      <dc:creator>mertk</dc:creator>
      <dc:date>2022-01-10T22:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1446587#M21001</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192760"&gt;@mertk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you please let me know where to obtain "&lt;SPAN&gt;etpuc_crank.c" file. all i can find in AN4907SW is "etpu_crank.c".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Arjun&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 18:21:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1446587#M21001</guid>
      <dc:creator>arjunraveendran</dc:creator>
      <dc:date>2022-04-20T18:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1447238#M21012</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/101793"&gt;@arjunraveendran&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can download the example project (&lt;A href="https://services.ashware.com/Download_Files/EngineControl_AN4907.zip" target="_blank"&gt;NXP AN4907 Engine Control Library&lt;/A&gt;) from the below link;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.ashware.com/Software" target="_blank"&gt;https://www.ashware.com/Software&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mert.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 12:01:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1447238#M21012</guid>
      <dc:creator>mertk</dc:creator>
      <dc:date>2022-04-21T12:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: ETPU - Setting TRR in Engine Control</title>
      <link>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1447710#M21016</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192760"&gt;@mertk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the resources.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 07:58:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/ETPU-Setting-TRR-in-Engine-Control/m-p/1447710#M21016</guid>
      <dc:creator>arjunraveendran</dc:creator>
      <dc:date>2022-04-22T07:58:23Z</dc:date>
    </item>
  </channel>
</rss>

