2346863_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2346863_en-US

2346863_en-US

mxca154 pwm fault configuration issue

hello. would like to ask why it is necessary to configure pwm for fault output. It is not possible to output without configuring it.

What are the functions PWM_SetupFaults, PWM_SetupFaultDisableMap?

What do these enumerated quantities mean?

/*! @brief List of PWM fault disable mapping selections */
typedef enum _pwm_fault_disable
{
    kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */
    kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */
    kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */
    kPWM_FaultDisable_3 = (1U << 3)  /*!< Fault 3 disable mapping */
} pwm_fault_disable_t;


MCXAMCXCMotor ControlRe: mxca154 pwm fault配置问题

Hi @1668834026

PWM_SetupFaults() configures the behavior of the fault input itself.

PWM_SetupFaultDisableMap() configures which faults can disable which PWM output.


/*! @brief List of PWM fault disable mapping selections */
typedef enum _pwm_fault_disable
{
    kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */
    kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */
    kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */
    kPWM_FaultDisable_3 = (1U << 3)  /*!< Fault 3 disable mapping */
} pwm_fault_disable_t;

You can refer to the user manual 31.5.17
Fault Disable Mapping Register 0 (SM0DISMAP0 - SM2DISMAP0)

Snipaste_2026-04-09_18-39-09.png

 The corresponding bit = 1 in the DISMAP register is an explicit software permission for this FAULT to turn off the PWM output.

BR

Harry.


Re: mxca154 pwm fault配置问题

Hi @1668834026

Ok, I'll check it out and get back to you.

BR

Harry.

Re: mxca154 pwm fault配置问题

hello, keep asking a few questions!

1. flexpwm has four fault inputs. What are the four inputs? And do I have to configure all four faults to use pwm?

/*! @brief List of PWM fault selections */
typedef enum _pwm_fault_input
{
    kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */
    kPWM_Fault_1,      /*!< Fault 1 input pin */
    kPWM_Fault_2,      /*!< Fault 2 input pin */
    kPWM_Fault_3       /*!< Fault 3 input pin */
} pwm_fault_input_t;

2. pwm_fault_param_t has a variable enableCombinationalPath, do I need to enable this variable to take effect after setting the fault? If not, will it cause pwm not to output.

/*! @brief Structure is used to hold the parameters to configure a PWM fault */
typedef struct _pwm_fault_param
{
    pwm_fault_clear_t faultClearingMode;   /*!< Fault clearing mode to use */
    bool faultLevel;                       /*!< true: Logic 1 indicates fault;
                                                false: Logic 0 indicates fault */
    bool enableCombinationalPath;          /*!< true: Combinational Path from fault input is enabled;
                                                false: No combination path is available */
    pwm_fault_recovery_mode_t recoverMode; /*!< Specify when to re-enable the PWM output */
} pwm_fault_param_t;

Re: mxca154 pwm fault配置问题

Hello, can you read the questions at the back of the post?

Re: mxca154 pwm fault配置问题

Hi @1668834026

1.

/*! @brief List of PWM fault selections */
typedef enum _pwm_fault_input
{
    kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */
    kPWM_Fault_1,      /*!< Fault 1 input pin */
    kPWM_Fault_2,      /*!< Fault 2 input pin */
    kPWM_Fault_3       /*!< Fault 3 input pin */
} pwm_fault_input_t;

These 4 faults are not 4 different faults, but 4 equal and independent "hardware fault input channels".

2. "There is a variable in pwm_fault_param_t that is enableCombinationalPath, do I need to enable this variable to take effect after setting the fault? If not enabled will it cause pwm to not output."

Snipaste_2026-04-13_18-01-02.png

Please check this register. enableCombinationalPath only affects the way the fault takes effect, it does not affect whether the PWM can be output or not.

BR

Harry.



タグ(1)
評価なし
バージョン履歴
最終更新日:
‎04-15-2026 02:49 AM
更新者: