PWM with processor expert KL43z?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

PWM with processor expert KL43z?

ソリューションへジャンプ
1,122件の閲覧回数
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 解決策
868件の閲覧回数
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 返答(返信)
869件の閲覧回数
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 件の賞賛
返信
869件の閲覧回数
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 件の賞賛
返信
869件の閲覧回数
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 件の賞賛
返信