<?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: SWOCTRL register seems locked in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079554#M57490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a workaround for my application. I was going to use the SW control to drive the enable pin of the driver chip either high (under software) or low (masked). This allows the driver control to be coincident with the PWM with the same write to the OUTMASK register at the moment of motor commutation. However, the same effect can be achieved by simply writing a compare value to the CnV register which exceeds that of the MOD register, which will force it to remain high when unmasked.&lt;/P&gt;&lt;P&gt;This doesn't resolve the original SWOCTRL issue, but I'm spinning a motor!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2020 21:58:25 GMT</pubDate>
    <dc:creator>malcolmmacdonald</dc:creator>
    <dc:date>2020-06-11T21:58:25Z</dc:date>
    <item>
      <title>SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079551#M57487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MCUXpresso 11.1.1, MKV42F64, barebone, PE Micro Multilink.&lt;/P&gt;&lt;P&gt;I'm trying to set up FTM0 for a straightforward 3-phase drive. Having traversed the minefield of IF statements in the Reference Manual for the synchronization, I still can't update the Software Control (SWOCTRL) register. However, the issue isn't the output, it's trying to change the buffer itself.&lt;/P&gt;&lt;P&gt;I have tried:&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;SWOCTRL = 0x0000yyyyU;&lt;/P&gt;&lt;P&gt;FTM_SetSoftwareCtrlVal(FTM0, 0, true);&lt;/P&gt;&lt;P&gt;FTM_SetSoftwareCtrlEnable(FTM0, 1, true);&lt;/P&gt;&lt;P&gt;Even if I try to do a direct register update while in a breakpoint, the result always comes back all zeros, as if it is a write-only register.&lt;/P&gt;&lt;P&gt;All the other registers update fine, as far as I have explored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 18:17:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079551#M57487</guid>
      <dc:creator>malcolmmacdonald</dc:creator>
      <dc:date>2020-06-10T18:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079552#M57488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="223959" data-username="malcolmmacdonald" href="https://community.nxp.com/people/malcolmmacdonald" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 11.9994px;"&gt;Malcolm Macdonald&lt;/A&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;How do you check the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;FTM0-&amp;gt;SWOCTRL value?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&amp;nbsp; &amp;nbsp;I check the RM this chapter:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;39.5.11 PWM synchronization&lt;BR /&gt;The PWM synchronization provides an opportunity to update the MOD, CNTIN, CnV,&amp;nbsp;OUTMASK, INVCTRL and SWOCTRL registers with their buffered value and force the&amp;nbsp;FTM counter to the CNTIN register value.&lt;BR /&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;BR /&gt;The legacy PWM synchronization (SYNCMODE = 0) is a&amp;nbsp;subset of the enhanced PWM synchronization (SYNCMODE =&lt;BR /&gt;1). Thus, only the enhanced PWM synchronization must be&amp;nbsp;used.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&amp;nbsp; So, do you use the &lt;SPAN&gt;enhanced PWM synchronization?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;The SWOCTRL register can be updated at each rising edge of system clock (SWOC = 0)&lt;BR /&gt;or by the enhanced PWM synchronization (SWOC = 1 and SYNCMODE = 1) according&lt;BR /&gt;to the following flowchart.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;Please also check&amp;nbsp;Figure 39-58. SWOCTRL register synchronization flowchart&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;Do you follow the flowchart?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;If you still have questions about it, please kindly let me know.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 06:31:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079552#M57488</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-06-11T06:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079553#M57489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, Kerry.&lt;/P&gt;&lt;P&gt;Yes, I am using SYNCMODE = 1&lt;/P&gt;&lt;P&gt;I am looking for the result principally by looking at the register's value at a breakpoint. The problem isn't the synchronization of the transfer from the buffer contents to the working register (although that is quite confusing in itself, by comparison to, say, the eFlexPWM which I am very familiar with through other projects), but changing the value in the buffer in the first place.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 12:23:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079553#M57489</guid>
      <dc:creator>malcolmmacdonald</dc:creator>
      <dc:date>2020-06-11T12:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079554#M57490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a workaround for my application. I was going to use the SW control to drive the enable pin of the driver chip either high (under software) or low (masked). This allows the driver control to be coincident with the PWM with the same write to the OUTMASK register at the moment of motor commutation. However, the same effect can be achieved by simply writing a compare value to the CnV register which exceeds that of the MOD register, which will force it to remain high when unmasked.&lt;/P&gt;&lt;P&gt;This doesn't resolve the original SWOCTRL issue, but I'm spinning a motor!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079554#M57490</guid>
      <dc:creator>malcolmmacdonald</dc:creator>
      <dc:date>2020-06-11T21:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079555#M57491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="223959" data-username="malcolmmacdonald" href="https://community.nxp.com/people/malcolmmacdonald" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: underline; font-size: 1.286rem;"&gt;Malcolm Macdonald&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Do you totally follow this flowchart to update the SWOCTLRL?&lt;/P&gt;&lt;P&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/112658iE751E626AD562802/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;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 02:59:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079555#M57491</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-06-12T02:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079556#M57492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see the issue, now. As I understand, a read/write buffer means exactly that - you can write and then read back the register value. The synchronization step would then be when that register value is passed into the logic itself.&lt;/P&gt;&lt;P&gt;This is not how SWOCTRL (and maybe other registers in the FTM) works. You have to write to the buffer and then perform the synchronization before the value you have just written can be read. If I write the SWSYNC bit in the flow diagram above, after setting SWOC, SYNCMODE &amp;amp; SWSOC and writing to SWOCTRL, the read value in SWOCTRL is correct. The description in 39.4.26 reads "This register has a write buffer. The fields are updated by the SWOCTRL register synchronization." is technically correct, but only after finding out how the register &lt;EM&gt;really&lt;/EM&gt; works! Most people, I think, would read that as the contents written to the register would be buffered until synchronization (which is true and desirable), but not understand that the buffer is before the read register itself. I can see why this could be a desirable functionality, but it needs explaining!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:28:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079556#M57492</guid>
      <dc:creator>malcolmmacdonald</dc:creator>
      <dc:date>2020-06-12T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL register seems locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079557#M57493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="223959" data-username="malcolmmacdonald" href="https://community.nxp.com/people/malcolmmacdonald" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: underline; font-size: 1.286rem;"&gt;Malcolm Macdonald&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for the updated information.&lt;/P&gt;&lt;P&gt;If you read the NXP appliation note: AN4560&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN4560.pdf" title="https://www.nxp.com/docs/en/application-note/AN4560.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN4560.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; There has the examples, it also update the buffer at first, then do the synchronization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px currentcolor; font-size: 14px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2020 09:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SWOCTRL-register-seems-locked/m-p/1079557#M57493</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-06-15T09:58:16Z</dc:date>
    </item>
  </channel>
</rss>

