I'm developing an application wherein we need finer granularity on the PWM output than a strict duty cycle (0-100) will give us. I've run into a snag wherein directly setting the FTM2_C1V register seems to do nothing. Calling `FTM_UpdatePwmDutycycle` followed by `FTM_SetSoftwareTrigger` works fine. When I inspect these functions it appears that all `FTM_UpdatePwmDutycycle` basically does is set the value of FTMx_CnV, and `FTM_SetSoftwareTrigger` sets SYNC. If I directly set FTM2_C1V in my code and then make the same call `FTM_SetSoftwareTrigger` nothing happens. Why? What do I need to do to get this working?
FTM_UpdatePwmDutycycle(FTM2, (ftm_chnl_t)1, kFTM_EdgeAlignedPwm, dutyCycle);
Does not work:
FTM2->CONTROLS.CnV = (uint32_t)cnt;
My FTM initialization follows the example in ftm_pwm_twochannel.c