<?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 and OUTMASK register update for BLDC Motor Control in S32K</title>
    <link>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2357061#M58233</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;there is little difference between MOD/CTIN/CnV and&amp;nbsp;OUTMASK/INVCTRL/SWOCTRL registers synchronization.&amp;nbsp;&lt;BR /&gt;While the first group allow an update of registers with buffered value on selected loading points the second one not and update happens on SW/HW trigger.&lt;/P&gt;
&lt;P&gt;See OUTMASK/SWOCTRL register synchronization flowcharts in respective chapters of the device RM for more info.&lt;BR /&gt;47.5.13.7 OUTMASK register synchronization&lt;BR /&gt;47.5.13.9 SWOCTRL register synchronization&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2026 08:21:57 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2026-04-28T08:21:57Z</dc:date>
    <item>
      <title>SWOCTRL and OUTMASK register update for BLDC Motor Control</title>
      <link>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2356716#M58225</link>
      <description>&lt;P&gt;I am using the following configuration to update SWOCTRL and OUTMASK registers using Software trigger.&lt;BR /&gt;What I have come to understand by reading Reference manual and application manuls is that with PWM enhanced synchronization, the registers can be updated at loading point which I expect to be End of a Time period of PWM. But what I have observed is that the registers are updated as soon as software trigger is set to HIGH.&amp;nbsp;&lt;BR /&gt;In one applicaiton manual, i also read which confused me and hence my question, is the concept of loading point is that an at of PWM an ISR is called and we update the registers over there rather than we change the registers at an arbitrary location and they are updated at the end of PWM.&lt;BR /&gt;&lt;BR /&gt;Please let me know if there is anything unclear in the question. I am attaching the following picture. The Yellow signal shows where the ISR started, the Green line goes LOW where the software trigger is set. Phase Switch is a point when Blue signal goes LOW, and the Pink signal goes HIGH. And the Red signal at the bottom shows the whole time period of the PWM signal which 50uS(20KHz)&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phase_Switch.BMP" style="width: 800px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383731iC2E9764794D6B46E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phase_Switch.BMP" alt="Phase_Switch.BMP" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    const ftm_user_config_t flexTimer_pwm_InitConfig_new =
    {
        {
            true,  // Software trigger state            -- ENABLED
            false,  // Hardware trigger 1 state         -- DISABLED
            false,  // Hardware trigger 2 state         -- DISABLED
            false,  // Hardware trigger 3 state         -- DISABLED
            true,   // Max loading point state          -- update at counter = MOD
            false,   // Min loading point state          -- update at counter = 0 (CNTIN)
            FTM_SYSTEM_CLOCK, // Update mode for INVCTRL register
            FTM_PWM_SYNC,     // Update mode for SWOCTRL register -- SW sync only
            FTM_PWM_SYNC,     // Update mode for OUTMASK register -- SW sync only
            FTM_SYSTEM_CLOCK, // Update mode for CNTIN register
            true,   // Automatic clear of the trigger   -- auto clear after sync fires
            FTM_WAIT_LOADING_POINTS, // Synchronization point -- wait for loading point
        },
        FTM_MODE_EDGE_ALIGNED_PWM,
        FTM_CLOCK_DIVID_BY_128,
        FTM_CLOCK_SOURCE_SYSTEMCLK,
        FTM_BDM_MODE_00,
        false,
        true
    };

    FTM_DRV_SetSync(3, &amp;amp;(flexTimer_pwm_InitConfig_new.syncMethod));         // Update the FTM 3 Synchronization Configuration



// the following function updates the registers in an ISR routine
uint8_t private_hal_mc_actuate_set_pwm_mask(uint8_t ui8OutMask, uint16_t ui16SwCtrl)
{

    // Apply Mask
    FTM3-&amp;gt;OUTMASK = (uint32_t)ui8OutMask;
    FTM3-&amp;gt;SWOCTRL = (uint32_t)ui16SwCtrl;
    FTM3-&amp;gt;SYNC |= FTM_SYNC_SWSYNC_MASK;
    return 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2026 20:06:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2356716#M58225</guid>
      <dc:creator>Qazi</dc:creator>
      <dc:date>2026-04-27T20:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL and OUTMASK register update for BLDC Motor Control</title>
      <link>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2357061#M58233</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;there is little difference between MOD/CTIN/CnV and&amp;nbsp;OUTMASK/INVCTRL/SWOCTRL registers synchronization.&amp;nbsp;&lt;BR /&gt;While the first group allow an update of registers with buffered value on selected loading points the second one not and update happens on SW/HW trigger.&lt;/P&gt;
&lt;P&gt;See OUTMASK/SWOCTRL register synchronization flowcharts in respective chapters of the device RM for more info.&lt;BR /&gt;47.5.13.7 OUTMASK register synchronization&lt;BR /&gt;47.5.13.9 SWOCTRL register synchronization&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 08:21:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2357061#M58233</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2026-04-28T08:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL and OUTMASK register update for BLDC Motor Control</title>
      <link>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2357108#M58236</link>
      <description>&lt;P&gt;Ok that makes sense. You saved me from a lot of headache. Thank you so much &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 09:12:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2357108#M58236</guid>
      <dc:creator>Qazi</dc:creator>
      <dc:date>2026-04-28T09:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: SWOCTRL and OUTMASK register update for BLDC Motor Control</title>
      <link>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2358080#M58253</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;Earlier, I was using the following configuration. With this configuration SYNCHOM is set to 0. I faced a problem that the commutation continues to work for 1 hour to 1 day but during this time period, their used to come a time where the BLDC motor used to be stopped. After debugging, I found out that the OUTMASK gets updated but SWOCTRL used to be on the old value. And that lead to Motor Bridge in a state where no LOW side MOSFET is active and hence the motor stopped. With the new configuration I mentioned above, it is working fine for over a weak now. Could you shed some light on what could have gone wrong.&lt;BR /&gt;Our understanding was that maybe the clock was on the boundary when OUTMASK is updated and SWOCTRL is left behind but it still doesnt explain that with next clock boundary, it should also get updated, but it didn't.&lt;BR /&gt;It would be awesome if you have an answer for it &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    const ftm_user_config_t  flexTimer_pwm_InitConfig =
    {
        {
            true,   // Software trigger state
            false,  // Hardware trigger 1 state
            false,  // Hardware trigger 2 state
            false,  // Hardware trigger 3 state
            true, // Max loading point state
            false, // Min loading point state
            FTM_SYSTEM_CLOCK, // Update mode for INVCTRL register
            FTM_SYSTEM_CLOCK, // Update mode for SWOCTRL register
            FTM_SYSTEM_CLOCK, // Update mode for OUTMASK register
            FTM_SYSTEM_CLOCK, // Update mode for CNTIN register
            true, // Automatic clear of the trigger
            FTM_WAIT_LOADING_POINTS, //  Synchronization point
        },
        FTM_MODE_EDGE_ALIGNED_PWM, //!&amp;lt; Mode of operation for FTM
        FTM_CLOCK_DIVID_BY_128, // FTM clock prescaler
        FTM_CLOCK_SOURCE_SYSTEMCLK,   // FTM clock source
        FTM_BDM_MODE_00, // FTM debug mode
        false, // Interrupt state
        true // Initialization trigger
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 19:19:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SWOCTRL-and-OUTMASK-register-update-for-BLDC-Motor-Control/m-p/2358080#M58253</guid>
      <dc:creator>Qazi</dc:creator>
      <dc:date>2026-04-28T19:19:59Z</dc:date>
    </item>
  </channel>
</rss>

