Hello Mac,
I found that I could not update the FTM Duty Cycle, so I placed the Init Code into a function and that did update the Duty Cycle. I discovered that the following code is needed to update Duty. I am puzzled why the counter must be stopped.
/* FTM2_SC: TOF=0,TOIE=0,CPWMS=0,CLKS=0,PS=0 */
FTM2_SC = 0x00U; /* Stop the counter */
FTM2_C4V = CH4_Val; // update Duty
FTM2_C5V = CH5_Val; // update Duty
/* FTM2_SC: TOF=0,TOIE=1,CLKS=1,PS=0 */
FTM2_SC = (FTM2_SC & (unsigned char)~(unsigned char)0x97U) | (unsigned char)0x48U;
Any thoughts on that?
Thanks,
David