Hi everyone,
I'am using the sdk 2.0 on a k64 board. I used the fsl_ftm driver for generating a pwm signal. Well for the FTM0 ch2 with a frequency of 100Khz everything works normal. But for a lower frequency (100hz) the pwm don't work and i don't get any output signal !
So i think that there's a bug in the fsl_ftm driver.
Even when i have updated the driver with this part of code everything goes wrong:
reg |= (FTM_CnSC_ELSA(chnlParams->level) | FTM_CnSC_ELSB(chnlParams->level));
Then we fixed it and changed to use the current one, which is corrected now.
/* Setup the active level */
reg |= (uint32_t)(chnlParams->level << FTM_CnSC_ELSA_SHIFT);
BR,
HR.A
Hi, Ahmed,
Obviously, it is a bug. Because the line
reg |= (FTM_CnSC_ELSA(chnlParams->level) | FTM_CnSC_ELSB(chnlParams->level));
can set both ELSA/ELSB bits, or clear both ELSA/ELSB bits. It is impossible to set one bit and clear another bit, because the two macro use the same variable:
chnlParams->level
BR
Xiangjun Rong