fsl_ftm bug ?!

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

fsl_ftm bug ?!

832 次查看
ahmedhrabi
Contributor IV

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

标签 (1)
0 项奖励
回复
1 回复

678 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复