<?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>topic Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR. in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775099#M15451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matej,&lt;/P&gt;&lt;P&gt;PoC- Proof of Concept..i was trying with the Hall sensor 120 degree sample code to understand the sample codes' functionality on the starter kit&lt;/P&gt;&lt;P&gt;When i say it affects the ADC0 conversion ISR i mean the ISR is skipped.It does not come at a regular interval of 50 usec(as expected),but after every 100 or say 115 usec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the sample code the following chunk of code is present in the AppInit function :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Load 0% duty cycle&lt;BR /&gt; dutyCycle = 0;&lt;BR /&gt; // Select commutation sector (all transistors OFF)&lt;BR /&gt; cmtSector = 6;&lt;BR /&gt; &lt;BR /&gt; // Select pattern&lt;BR /&gt; PMFCFG2 = 0x40 + MaskVal[cmtSector];&lt;BR /&gt; PMFOUTC_OUTCTL = OutCtl[cmtSector]; &lt;BR /&gt; // TIM ch0 output toggle on compare to force commutation&lt;BR /&gt; TIM0TCTL2_OL0 = 1; &lt;BR /&gt; TIM0TCTL2_OM0 = 0;&lt;BR /&gt; // Force commutation (apply PMF MASK/Control configuration)&lt;BR /&gt; TIM0CFORC_FOC0 = 1; &lt;BR /&gt; // Disable TIM ch0 output compare action to do not generate &lt;BR /&gt; // force commutation (async_event), when TIM counter TCNT reaches value 0&lt;BR /&gt; TIM0TCTL2_OL0 = 0; &lt;BR /&gt; TIM0TCTL2_OM0 = 0;&lt;BR /&gt; &lt;BR /&gt; //Load duty cycle&lt;BR /&gt; PMFVAL0 = dutyCycle;&lt;BR /&gt; // Switch list when next reload event (apply PWM duty cycle)&lt;BR /&gt; PTUC_PTULDOK = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the same chunk is added to AppStop ,then the&amp;nbsp;ADC0done_ISR interrupt interval which is of 50usec is affected.(it is skipped).Comes after 100usec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I cannot understand is how adding this particular chunk of code in which forceful commutation is performed(&amp;nbsp;&lt;SPAN&gt;TIM0CFORC_FOC0 = 1;&amp;nbsp;) affects the above said ISR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Mar 2018 06:04:23 GMT</pubDate>
    <dc:creator>pratibhasurabhi</dc:creator>
    <dc:date>2018-03-01T06:04:23Z</dc:date>
    <item>
      <title>Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775097#M15449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was performing a PoC on the NXP MTRCKTSBNZVM128 Kit for motor rotation using Hall sensor 120 commutation algorithm.&lt;/P&gt;&lt;P&gt;During the course of PoC i found out that the whenever forceful commutation(TIM0CFORC_FOC0 = 1 ) is performed( say in APP_STOP) when motor is idle,it affects the ADC0 conversion done ISR (50 usec ISR).&lt;/P&gt;&lt;P&gt;Can someone please explain as to why this occurs.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 06:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775097#M15449</guid>
      <dc:creator>pratibhasurabhi</dc:creator>
      <dc:date>2018-02-27T06:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775098#M15450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;could you please be more specific on what does the PoC mean? And also what means that "it affects the ADC0 conversion done ISR"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matej&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2018 16:52:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775098#M15450</guid>
      <dc:creator>pachamatej</dc:creator>
      <dc:date>2018-02-28T16:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775099#M15451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matej,&lt;/P&gt;&lt;P&gt;PoC- Proof of Concept..i was trying with the Hall sensor 120 degree sample code to understand the sample codes' functionality on the starter kit&lt;/P&gt;&lt;P&gt;When i say it affects the ADC0 conversion ISR i mean the ISR is skipped.It does not come at a regular interval of 50 usec(as expected),but after every 100 or say 115 usec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the sample code the following chunk of code is present in the AppInit function :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Load 0% duty cycle&lt;BR /&gt; dutyCycle = 0;&lt;BR /&gt; // Select commutation sector (all transistors OFF)&lt;BR /&gt; cmtSector = 6;&lt;BR /&gt; &lt;BR /&gt; // Select pattern&lt;BR /&gt; PMFCFG2 = 0x40 + MaskVal[cmtSector];&lt;BR /&gt; PMFOUTC_OUTCTL = OutCtl[cmtSector]; &lt;BR /&gt; // TIM ch0 output toggle on compare to force commutation&lt;BR /&gt; TIM0TCTL2_OL0 = 1; &lt;BR /&gt; TIM0TCTL2_OM0 = 0;&lt;BR /&gt; // Force commutation (apply PMF MASK/Control configuration)&lt;BR /&gt; TIM0CFORC_FOC0 = 1; &lt;BR /&gt; // Disable TIM ch0 output compare action to do not generate &lt;BR /&gt; // force commutation (async_event), when TIM counter TCNT reaches value 0&lt;BR /&gt; TIM0TCTL2_OL0 = 0; &lt;BR /&gt; TIM0TCTL2_OM0 = 0;&lt;BR /&gt; &lt;BR /&gt; //Load duty cycle&lt;BR /&gt; PMFVAL0 = dutyCycle;&lt;BR /&gt; // Switch list when next reload event (apply PWM duty cycle)&lt;BR /&gt; PTUC_PTULDOK = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the same chunk is added to AppStop ,then the&amp;nbsp;ADC0done_ISR interrupt interval which is of 50usec is affected.(it is skipped).Comes after 100usec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I cannot understand is how adding this particular chunk of code in which forceful commutation is performed(&amp;nbsp;&lt;SPAN&gt;TIM0CFORC_FOC0 = 1;&amp;nbsp;) affects the above said ISR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 06:04:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775099#M15451</guid>
      <dc:creator>pratibhasurabhi</dc:creator>
      <dc:date>2018-03-01T06:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775100#M15452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The reason would be the timing of the application.&lt;/P&gt;&lt;P&gt;If the code is presented in the AppInit function, it is probably called just once. Actually, if I download the Hall-sensor-based application from the NXP web, I can see the "&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;TIM0CFORC_FOC0 = 1;" only in the transition functions, thus also called once between two states (e.g. in "void AppStopToAlignment(void)" ). The only exception is forcing the commutation in the timer event&amp;nbsp;"TIMchan1_ISR".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;In contrast to that, you have placed the code in the AppStop state, which is a function called within the main "while" loop, thus called over and over, with no time span in between. Since there is also the PTUC_PTULDOK = 1 command, I can imagine the ADC is being restarted so many times that it&amp;nbsp;can skip some conversions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Actually, with the lates package available at the NXP web, I can place your code in the AppStop and I still see the ADC interrupt being called every 50 us. However, the motor will not run since your code makes changes not compatible with the rest of the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Personally, I can see no benefit in placing the whole code into the AppStop state. If you are about to implement the in-speed start-up, the Hall sensors interface should be used to detect the speed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I hope&amp;nbsp;I have explained it at least a bit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Matej&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 07:55:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775100#M15452</guid>
      <dc:creator>pachamatej</dc:creator>
      <dc:date>2018-03-05T07:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775101#M15453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matej,&lt;/P&gt;&lt;P&gt;Thank you for the explanation provided.&lt;/P&gt;&lt;P&gt;So do you mean to say the combination of forceful commutation occurring over and over again (while loop ) and the bit PTULDOK being set might be the reason behind the ADC ISR being skipped.Is my undersatnding correct.&lt;/P&gt;&lt;P&gt;Also in your reply you have mention in the Hall Sensor based application from the NXP web,you found the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;FOC0 set only in transition function (&lt;SPAN&gt;AppStopToAlignment)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The sample code which is present with me does not have any transition function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;As per my knowledge the BEMF sample code has the AppStopToAlignment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Is it correct? If not can you please share the Hall sample code which is present with you?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:05:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775101#M15453</guid>
      <dc:creator>pratibhasurabhi</dc:creator>
      <dc:date>2018-03-05T13:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Forceful commutation hampering ADC0 Conversion done(50 usec) ISR.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775102#M15454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Yes, you understand it correctly. The mechanism for the BLDC case is, the ADC will skip the conversion if the on-going conversion is interrupted. This situation occurs when an asynchronous commutation is forced (thus in every BLDC commutation).&lt;/P&gt;&lt;P&gt;The NXP provides demo codes for the devKits - available for you to download at&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/pages/3-phase-sensorless-bldc-development-kit-with-s12-magniv-s12zvm:MTRCKTSBNZVM128" title="https://www.nxp.com/pages/3-phase-sensorless-bldc-development-kit-with-s12-magniv-s12zvm:MTRCKTSBNZVM128"&gt;3-phase Sensorless BLDC Development Kit|NXP&lt;/A&gt;&amp;nbsp;. Please go to the Download section and use&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/downloads/en/board-support-packages/MTRCKTSBNZVM128_SW.exe" title="https://www.nxp.com/downloads/en/board-support-packages/MTRCKTSBNZVM128_SW.exe"&gt;https://www.nxp.com/downloads/en/board-support-packages/MTRCKTSBNZVM128_SW.exe&lt;/A&gt;&amp;nbsp;to download the package (of both sensorless and hall sensor based applications).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matej&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:54:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Forceful-commutation-hampering-ADC0-Conversion-done-50-usec-ISR/m-p/775102#M15454</guid>
      <dc:creator>pachamatej</dc:creator>
      <dc:date>2018-03-07T13:54:49Z</dc:date>
    </item>
  </channel>
</rss>

