AnsweredAssumed Answered

FlexPWM Force event to update mask status?

Question asked by duanemattern on Dec 2, 2016
Latest reply on Dec 6, 2016 by Petr Stancik

I'm using a TRK-MPC5604P kit and I have PWM Modules 2 & 3 (A&B) running on Port G, for 4 independent center-aligned PWM signals.   I'm using FreeMaster to change a state variable to update some PWM values on the fly.

 

 

I'm trying to figure out a good/best way to turn channels on and off without affecting the other channels and also being synchronized.     I know I can set duty cycles to zero, but I'd rather not do that.  I currently have two options, but I want to know if there is a side affect using the Force logic.  Basically I'm trying to see how the MASK register works and to understand if  I should be using it for this purpose.

 

Method1:  change the mask, which appears to requires a force event to take affect

         FLEXPWM_0.MASK.R = 0x00C0;             //Turns off B ch in mod2.  Didn't turn off ch A, but don't know why?
         FLEXPWM_0.SUB[2].CTRL2.B.FORCE = 1;

 

Method2:  changed the enable for the individual channel.

         FLEXPWM_0.OUTEN.R = 0x0C00;       //0000-1100-0000-0000     leave on A, turns off both B ch in modules 2&3

 

The OUTEN method works fine and I can use that. I'm just wonder when MASK is used.

Outcomes