FTM changing FTMx_CxV

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

FTM changing FTMx_CxV

1,248件の閲覧回数
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 返信

1,002件の閲覧回数
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.