PWM with processor expert KL43z?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

PWM with processor expert KL43z?

跳至解决方案
1,709 次查看
christopherira
Contributor III

Hi,

 

I'm using frdm-kl43z and processor expert. I'm trying to set up a simple pwm output for pin E24. I'm using component fsl_tpm.

131440_131440.pngpastedImage_1.png

 

I've configured the component as follows:

131439_131439.pngpastedImage_0.png

132017_132017.pngpastedImage_3.png

 

Not sure how to set the duty cycle, but I initialized the frequency as 250 kHz:

132018_132018.pngpastedImage_4.png

 

And just trying to initialize the output, I wrote this code:

132019_132019.pngpastedImage_5.png

Is this correct?

 

Thanks!

标签 (1)
0 项奖励
回复
1 解答
1,455 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christopher,

- About the duty cycle , you  can configure it at here:

pastedImage_0.png

- About the initialize code , after you generated the code , you  can find the initialize code at here :

pastedImage_1.png

you needn't write the initialize code by yourself .

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 项奖励
回复
3 回复数
1,456 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christopher,

- About the duty cycle , you  can configure it at here:

pastedImage_0.png

- About the initialize code , after you generated the code , you  can find the initialize code at here :

pastedImage_1.png

you needn't write the initialize code by yourself .

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 项奖励
回复
1,456 次查看
christopherira
Contributor III

That's very helpful thank you. Additionally, how would I tell the processor to send the output or not send the output? Do I do that through a normal fsl_gpio?

Thanks!

Chris

0 项奖励
回复
1,456 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Chris,

You don't need add fsl_gpio component.

In the fsl_tpm  component , we can configure the channel to out put PWM:

pastedImage_0.png

If you select "Auto initialization " , after generate code , then run the project , it can out put PWM.

And if do not select this option , you can initialize and start it by yourself use the methods , and use the method

of "TPM_DRV_Deinit"  shouts down it .

I recommend you first  select the "Auto initialization " , then run the project , check whether can out put the signal you need .

Hope it helps

Alice

0 项奖励
回复