Yi Min Hsu

Bug Report: PWM bug in KExx driver V1.2.1

Discussion created by Yi Min Hsu Employee on Feb 26, 2015
Latest reply on Mar 26, 2015 by David Diaz Marin

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)

圖片 1.jpg

 

2. Change channels = 1 in FTM_PWMInit() of ftm.c as below picture:

圖片 2.jpg

Outcomes