FTM changing FTMx_CxV

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

FTM changing FTMx_CxV

1,114 次查看
wojtek_84
Contributor I

Hi,

I'm using FTM3 on channel 0 to generate PWM signal. Processor expert was use to setup the timer. It works ok.

Now I want to change FTM3_C0V register in my app. Changing value of this register does not change the puls width.

I noticed that such action works:

FTM3_SC &= ~(1<<3);
FTM3_C0V = value
FTM3_SC |= (1<<3);

Do I really need to stop the timer to chanche C0V value?

Regards.

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

868 次查看
EarlOrlando
Senior Contributor II

Dear Wojciech Serek,

You don't need to stop the timer to change the FTMx_CnV value. Please be sure that you write to this register the counts needed until the channel match and not the duty cycle of the PWM.

The next snapshot is from the K64 reference manual when you can see how the PWM period and the duty cycle is computed.

pastedImage_0.png

I hope this helps. I remain at your service.

Best regards,

Earl Orlando Ramírez-Sánchez.