Found a PWM bug in KExx driver V1.2.1: If we set PTB2 as FTM0, PWM output to PTB2 but also PTA1. It seems be workable as below modification.
1. Swap the code in “SIM_RemapFTM0CH0ToPTB3” and “SIM_RemapFTM0CH0ToPTA1” to have the correct register setting.
Ex:
SIM->PINSEL &= ~SIM_PINSEL_FTM0PS0_MASK;
to
SIM->PINSEL |= SIM_PINSEL_FTM0PS0_MASK;
In __STATIC_INLINE void SIM_RemapFTM0CH0ToPTB3(void) of sim.h.(Actually PTB2 is the correct name rather than PTB3)
2. Change channels = 1 in FTM_PWMInit() of ftm.c as below picture:
Hello,
Indeed, there is a bug presented on the PWM KEx driver V1.2.1.
I really appreciate your contribution.
This bug has been submitted to the Developers Team in order to fix the issue.
Once again, thank you for your contribution.
Best Regards,
David Diaz.