TMP0 and center aligned PWM

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

TMP0 and center aligned PWM

1,563 Views
miroslavmartise
Contributor I

Hello everybody,

I am playing with FRDM-KL25Z at the moment, namely with Init_TMP component and blue LED. If I want to set up the mode of channels as a Center-aligned PWM, output signal is not produced farther away. But if I change it to Edge-aligned PWM, it works fine and LED lights.

In attachment you can see screenshot of my current setting.

Is there any bug, or so? This puzzles me.....

Thank you.

0 Kudos
Reply
5 Replies

1,341 Views
miroslavmartise
Contributor I

Hi Alice,

I would like to thank you for your advice and help.I highly appreciate it. Center-aligned PWM is working properly at the moment :-)

Have a nice day.

Miroslav

0 Kudos
Reply

1,342 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Miroslav

Welcome !

BR

Alice

0 Kudos
Reply

1,342 Views
miroslavmartise
Contributor I

Hello Alice,

in attached .rar file you can find my project. It should be noted that I am not the author of entire project, main structure was downloaded from this community forum. I have only changed setting of TPM0 to center-aligned PWM.....

Have a nice day,

Miroslav

0 Kudos
Reply

1,342 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Miroslav,

I test your project on my side , find there is a bug in the generated code of Init_TPM.

Please add these code in the file of "TPM0.C"

 TPM0_C0SC = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSB_MASK);‍‍

and disable the original code of TPM0_C0SC :

pastedImage_1.png

After change the code,  please  choose " Don't Write Generated Component Modules":

pastedImage_2.png

Then build , run ...

I also attached the project which I changed .

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,342 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Miroslav,

Could you please share your project to me , I will check it on my side .

BR

Alice

0 Kudos
Reply