AnsweredAssumed Answered

SDK 2.0 PWM configuration, ¿bug?

Question asked by Antonio Muñoz on Sep 21, 2016
Latest reply on Oct 6, 2016 by Antonio Muñoz

Hi, I've been working with SDK 2.0 for kinetis MK22FA12..  

In the archive fsl_ftm.c it seems to be a bug when configuring PWM (high-true or low true selection).

The result of this:

reg &= ~(FTM_CnSC_MSA_MASK | FTM_CnSC_MSB_MASK | FTM_CnSC_ELSA_MASK | FTM_CnSC_ELSB_MASK);

reg |= (FTM_CnSC_ELSA(chnlParams->level) | FTM_CnSC_ELSB(chnlParams->level));

when level is kFTM_HighTrue (2U)

is always ELSA = ELSB = 0,  i.e. 00 

 

down below, in the same file there is another line that looks better:

reg |= ((uint32_t)chnlParams->level << FTM_CnSC_ELSA_SHIFT) & (FTM_CnSC_ELSA_MASK | FTM_CnSC_ELSB_MASK);

 

Is this ok or I'm missing something ?

 

Thanks in advance.

Outcomes