How to synchronize PWM output

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

How to synchronize PWM output

Jump to solution
464 Views
a8Chcx
Contributor V

Hi,

I am using K64F FlexTimer channel0 as my PWM output. I am using PE to configure channel0 as output compare with toggle output.

I disable the software output control and interrupt...

In my main rountine, I just change  FTM0_MOD register to get the different PMW output(50/50) every second. It works fine. The only problem is that PWM out frequency can be changed in middle.

Could you tell me how to control the loading point of the new value, like always after complete PWM output?

Another question: Is it possible to change the polarity of channel0?

Thanks,

Christie

0 Kudos
1 Solution
362 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christie,

(1) Do you want to change the frequency of PWM ? if yes , update the MOD register we can refer to the RM here :

(2) About change the polarity of channel0 ,  we can use  "ELSnB "and "ELSnA" :

( 40.3.6 Channel (n) Status And Control (FTMx_CnSC)  )

pastedImage_2.png

pastedImage_1.png

Hope it helps

Alice

View solution in original post

0 Kudos
1 Reply
363 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christie,

(1) Do you want to change the frequency of PWM ? if yes , update the MOD register we can refer to the RM here :

(2) About change the polarity of channel0 ,  we can use  "ELSnB "and "ELSnA" :

( 40.3.6 Channel (n) Status And Control (FTMx_CnSC)  )

pastedImage_2.png

pastedImage_1.png

Hope it helps

Alice

0 Kudos