fsl_ftm bug ?!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_ftm bug ?!

455 Views
ahmedhrabi
Contributor III

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

Labels (1)
0 Kudos
Reply
1 Reply

301 Views
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 Kudos
Reply