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.
I've configured the component as follows:
Not sure how to set the duty cycle, but I initialized the frequency as 250 kHz:
And just trying to initialize the output, I wrote this code:
Is this correct?
Thanks!
解決済! 解決策の投稿を見る。
Hello Christopher,
- About the duty cycle , you can configure it at here:
- About the initialize code , after you generated the code , you can find the initialize code at here :
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!
-----------------------------------------------------------------------------------------------------------------------
Hello Christopher,
- About the duty cycle , you can configure it at here:
- About the initialize code , after you generated the code , you can find the initialize code at here :
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!
-----------------------------------------------------------------------------------------------------------------------
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
Hello Chris,
You don't need add fsl_gpio component.
In the fsl_tpm component , we can configure the channel to out put PWM:
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