Tool/software: Code Composer Studio
Greetings! I`m watching the InstaSPIN examples. In the hal.c file the HAL_setupPWMs function sets only channel A ->
// setup the Action-Qualifier Output A Register (AQCTLA)
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
and channel is forced high
// setup the Action-qualifier Continuous Software Force Register
// (AQCSFRC)
EPWM_setActionQualifierContSWForceAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_B,
EPWM_AQ_SW_OUTPUT_HIGH);
I`ve noticed in the code is used function HAL_writePWMData(halHandle, &pwmData), but it doesn`t contain any code allowing a switch between A and B. Or I don`t know about it. So if I`m running a PWM on channel A and I need to switch to channel B what should I do? Where in the code is this done? And what value of pwmData registers such change? Because in the examples pwmData.Vabc_pu.value[0] = 0.0 should force 50% duty cycle. So I suppose negative value will drop the duty cycle below 50% and vice versa.
Thanks!