Generate PWM with 20Hz with K27

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

Generate PWM with 20Hz with K27

636 次查看
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 回复

566 次查看
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 项奖励
回复