Initial PWM output value with eFlexPWM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Initial PWM output value with eFlexPWM

Jump to solution
587 Views
zorrotz
Contributor III

Hi,

Working with eFlexPWM of MCXA132, I want to modify the initial value for PWM23.
For that I do next steps:


1. SM1CTRL2[PWM23_INIT] = 1

2. SM1CTRL2[FRCEN] = 1
    SM1CTRL2[FORCE] = 1    (note that SM1CTRL2[FORCE_SEL] is 000)

3. MCTRL[RUN] = 010

But first PWM cycle always starts with output at level 0.

Where can be the problem?

Thanks in advance

Labels (1)
0 Kudos
Reply
1 Solution
468 Views
zorrotz
Contributor III

Hello,

I have found my mistake.

The reference manual has this note:

"If MCTRL[LDOK] is not set, setting MCTRL[RUN] also sets the STS[RF] flag. To prevent a CPU interrupt request, clear INTEN[RIE] before setting MCTRL[RUN]."

I am using STS[RF] to end PWM cycle, but I clear STS[RF] before doing MCTRL[RUN] = 1.

 

Thanks

View solution in original post

0 Kudos
Reply
2 Replies
468 Views
zorrotz
Contributor III

Hello,

I have found my mistake.

The reference manual has this note:

"If MCTRL[LDOK] is not set, setting MCTRL[RUN] also sets the STS[RF] flag. To prevent a CPU interrupt request, clear INTEN[RIE] before setting MCTRL[RUN]."

I am using STS[RF] to end PWM cycle, but I clear STS[RF] before doing MCTRL[RUN] = 1.

 

Thanks

0 Kudos
Reply
524 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @zorrotz 

 

To help us analyze the issue, could you please share your complete project with us?

Thank you.

 

BR

Alice

0 Kudos
Reply