Generate PWM with 20Hz with K27

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

Generate PWM with 20Hz with K27

634件の閲覧回数
christophosterl
Contributor I

Hi,

i'm struggeling to generate a pwm with 20Hz and a duty cycle of 50%. Running the clock with 120Mhz, i get a bus clock speed of 60Mhz. Even with the maximum prescaler of 128 I'm far away from 20Hz (cause the compare value would be > 16bit).

When I'm to use the fixed frequeny clock (MCGFFCLK) by setting C1[IREFS] to 1 and set the Clock Source Selection [CLKS] to 2, I do not get any output (when triggering the pin with a scope).

Do you have any hints for me what I've forgotten or could you tell me a different/better way to solve this?

Thanks and best regards!

ラベル(1)
0 件の賞賛
返信
1 返信

564件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi christophosterloh,

I try to import the ftm_simple_pwm example of MCUXpresso SDK_2.4.1_MK27FN2M0Axxx15.
After modify the configurations using the Peripherals Tool in MCUXpresso IDE, I can get 20Hz PWM at FTM3_CH1 pin on FRDM-K28F board.

Peripherals PWM 20Hz.png

main.png

Best Regards,

Robin

 

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

0 件の賞賛
返信