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.
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.
I hope this helps. I remain at your service.
Best regards,
Earl Orlando Ramírez-Sánchez.