AnsweredAssumed Answered

MPC5643L FlexPWM DISMAP question

Question asked by zili on Dec 17, 2016
Latest reply on Dec 20, 2016 by zili

Hi, I just recently got my hands on the demo kit and started reading through the example code. There are two questions for the following section of code. 

// Switch on all FlexPWM channels
SWITCH_ALL_PWM_ON(M1.uni3PeriphCfg.flexPwmBaseAddr);

 

// Enable FlexPWMA/FlexPWMB fault protection
FAULT_PROTECT_PWMA_ON(M1.uni3PeriphCfg.flexPwmBaseAddr);
FAULT_PROTECT_PWMB_ON(M1.uni3PeriphCfg.flexPwmBaseAddr);

 

// Switch off all FlexPWM channels
SWITCH_ALL_PWM_OFF(M1.uni3PeriphCfg.flexPwmBaseAddr);

First, is it required to switch on FlexPWM channels first before configuring DISMAP? It's not mentioned in the MPC5643L reference manual in nowhere. If so, why?

 

Second, the subfunction of FAULT_PROTECT_PWMA_ON actually clears DISA in DISMAP. However, if DISA is zero, the fault protection is disabled as seen in figure 25-27 and following quote.

The PWMA output will be turned off if there is a logic 1 on a FAULTx input and a 1 in the corresponding
bit of the DISA field. 

But the comment of the code indicates it is for enabling fault protection?

 

Many thanks.

Outcomes