This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28P65X: ePWM signals not taken out in two CPU project

Part Number: LAUNCHXL-F28P65X
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Hi, 

I am facing an issue with a test project on the LAUNCHXL-F28P65X board using both CPUs where I set up an ePWM channel (which is working on a single CPU project) but get no output on the pins of ePWM channel 5 (GPIO 8 and 9).

I setup the project using the Sysconfig tool. My general configuration is:

  • CCS version: 12.6
  • Compiler version: 22.6.1
  • SysConfig version: 1.20.0
  • Eval board: LAUNCHXL F28P65X

The ePWM functionality is totally independent from the other functionality I added to both CPUs. The definition of the ePWM is resulting in the following source code in the board.c/.h. The ePWM5 is reserved per default to CPU1. The ePWM peripheral is enabled in device.c.

Any ideas why I do not get output signals on GPIO 8 and 9 for my ePWM5?

board.h:

//
// EPWM5 -> myEPWM0 Pinmux
//
//
// EPWM5_A - GPIO Settings
//
#define GPIO_PIN_EPWM5_A 8
#define myEPWM0_EPWMA_GPIO 8
#define myEPWM0_EPWMA_PIN_CONFIG GPIO_8_EPWM5_A
//
// EPWM5_B - GPIO Settings
//
#define GPIO_PIN_EPWM5_B 9
#define myEPWM0_EPWMB_GPIO 9
#define myEPWM0_EPWMB_PIN_CONFIG GPIO_9_EPWM5_B

//*****************************************************************************
//
// EPWM Configurations
//
//*****************************************************************************
#define myEPWM0_BASE EPWM5_BASE
#define myEPWM0_TBPRD 500
#define myEPWM0_COUNTER_MODE EPWM_COUNTER_MODE_UP_DOWN
#define myEPWM0_TBPHS 250
#define myEPWM0_CMPA 275
#define myEPWM0_CMPB 200
#define myEPWM0_CMPC 0
#define myEPWM0_CMPD 0
#define myEPWM0_DBRED 0
#define myEPWM0_DBFED 0
#define myEPWM0_TZA_ACTION EPWM_TZ_ACTION_HIGH_Z
#define myEPWM0_TZB_ACTION EPWM_TZ_ACTION_HIGH_Z
#define myEPWM0_INTERRUPT_SOURCE EPWM_INT_TBCTR_DISABLED

board.c:

//*****************************************************************************
//
// EPWM Configurations
//
//*****************************************************************************
void EPWM_init(){
EPWM_setClockPrescaler(myEPWM0_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_4);
EPWM_setTimeBasePeriod(myEPWM0_BASE, 500);
EPWM_setTimeBaseCounter(myEPWM0_BASE, 0);
EPWM_setTimeBaseCounterMode(myEPWM0_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_enablePhaseShiftLoad(myEPWM0_BASE);
EPWM_setPhaseShift(myEPWM0_BASE, 250);
EPWM_setSyncInPulseSource(myEPWM0_BASE, EPWM_SYNC_IN_PULSE_SRC_DISABLE);
EPWM_setCounterCompareValue(myEPWM0_BASE, EPWM_COUNTER_COMPARE_A, 275);
EPWM_setCounterCompareShadowLoadMode(myEPWM0_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
EPWM_setCounterCompareValue(myEPWM0_BASE, EPWM_COUNTER_COMPARE_B, 200);
EPWM_setCounterCompareShadowLoadMode(myEPWM0_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
EPWM_setActionQualifierT2TriggerSource(myEPWM0_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);
EPWM_enableGlobalLoadRegisters(myEPWM0_BASE, EPWM_GL_REGISTER_AQCTLA_AQCTLA2);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
EPWM_enableGlobalLoadRegisters(myEPWM0_BASE, EPWM_GL_REGISTER_AQCTLB_AQCTLB2);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(myEPWM0_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
EPWM_setRisingEdgeDelayCountShadowLoadMode(myEPWM0_BASE, EPWM_RED_LOAD_ON_CNTR_ZERO);
EPWM_disableRisingEdgeDelayCountShadowLoadMode(myEPWM0_BASE);
EPWM_setFallingEdgeDelayCountShadowLoadMode(myEPWM0_BASE, EPWM_FED_LOAD_ON_CNTR_ZERO);
EPWM_disableFallingEdgeDelayCountShadowLoadMode(myEPWM0_BASE);
}

Best Regards

Patrik

  • Hi Patrik,

    I suspect a pinMux issue, could you help me with the project details, is it a "system" project or 2 single core projects? Also, is EPWM 5 being used in both CPUs?

    thanks and regards,

    Madhava

  • Hi Madhava, 

    thanks for your reply.

    The project is a collection of three CCS projects with a general multi project and one for each CPU. I took the projects from the C2000Ware 5.2.0 (it was the IPC dual core example). The ePWM is only used in CPU1 and the necessary GPIOs (#8 and #9) are defined and only used in this CPU using the PinMux section in the Sysconfig for the ePWM. 

    Because the default usage of a peripheral is on CPU1 I do not change anything here. The peripheral is also enabled and the access control for this is the default, means "Full access for both read and write".

  • Hi Patrik,

    Thank you for your response! I tried using the IPC_basic_syscfg_multi example. I have added an EPWM5 in the CPU1 and checked the pinmux_init() in board.c. The following are my observations.

    1. The pinmux init is always in cpu1. even if the peripheral, in this case EPWM is added from CPU1 or CPU2.
    2. I noticed the code you have shared doesn't have the pinmux_init() function. could you check.

    the pinmux_init() code has the following lines, note that this is always present in CPU1, irrespective of which core sysconfig the peripheral is added in. 

        //
        // EPWM5 -> myEPWM0 Pinmux
        //
        GPIO_setPinConfig(myEPWM0_EPWMA_PIN_CONFIG);
        GPIO_setPadConfig(myEPWM0_EPWMA_GPIO, GPIO_PIN_TYPE_STD);
        GPIO_setQualificationMode(myEPWM0_EPWMA_GPIO, GPIO_QUAL_SYNC);
    
        GPIO_setPinConfig(myEPWM0_EPWMB_PIN_CONFIG);
        GPIO_setPadConfig(myEPWM0_EPWMB_GPIO, GPIO_PIN_TYPE_STD);
        GPIO_setQualificationMode(myEPWM0_EPWMB_GPIO, GPIO_QUAL_SYNC);

    The following are my queries regarding your setup. Could you please provide this information as well.

    1. Are the EPWM configurations done in CPU1 or CPU2 ?
    2. Is there a pinmux_init() function generated for the EPWM in interest ?
    3. If pinmux_init() is genereated, is the Core with the pinmux_init() ran before the core with the EPWM configurations added?


    Thanks and regards,
    Madhava

  • Hi Madhava, 

    The PinMux_init() is called as fist item in the Board_init() of CPU1 where exactly your mentioned code is stated.

    Regarding your other questions:

    1. The configuration of the PWM is done in CPU1

    2. There is a PinMux_init() function generated where the used GPIOs are configured

    3. The PinMux_init() function is the first called function in the Board_Init() function

    The generated PinMux_init() function is working because all other configured GPIOs are working properly.

    Regards

    Patrik

    #include "board.h"

    //*****************************************************************************
    //
    // Board Configurations
    // Initializes the rest of the modules.
    // Call this function in your application if you wish to do all module
    // initialization.
    // If you wish to not use some of the initializations, instead of the
    // Board_init use the individual Module_inits
    //
    //*****************************************************************************
    void Board_init()
    {
    EALLOW;

    PinMux_init();
    SYSCTL_init();
    SYNC_init();
    ASYSCTL_init();
    MEMCFG_init();
    ADC_init();
    CAN_init();
    CPUTIMER_init();
    EPWM_init();
    GPIO_init();
    IPC_SYSCFG_init();
    INTERRUPT_init();

    EDIS;
    }

    //*****************************************************************************
    //
    // PINMUX Configurations
    //
    //*****************************************************************************
    void PinMux_init()
    {
    //
    // PinMux for modules assigned to CPU1
    //

    //
    // ANALOG -> myANALOGPinMux0 Pinmux
    //
    // Analog PinMux for A0/DACA_OUT
    GPIO_setPinConfig(GPIO_227_GPIO227);
    // AIO -> Analog mode selected
    GPIO_setAnalogMode(227, GPIO_ANALOG_ENABLED);
    // Analog PinMux for B1/DACC_OUT
    GPIO_setPinConfig(GPIO_234_GPIO234);
    // AIO -> Analog mode selected
    GPIO_setAnalogMode(234, GPIO_ANALOG_ENABLED);
    //
    // CANA -> myCAN0 Pinmux
    //
    GPIO_setPinConfig(myCAN0_CANRX_PIN_CONFIG);
    GPIO_setPadConfig(myCAN0_CANRX_GPIO, GPIO_PIN_TYPE_STD | GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(myCAN0_CANRX_GPIO, GPIO_QUAL_ASYNC);

    GPIO_setPinConfig(myCAN0_CANTX_PIN_CONFIG);
    GPIO_setPadConfig(myCAN0_CANTX_GPIO, GPIO_PIN_TYPE_STD | GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(myCAN0_CANTX_GPIO, GPIO_QUAL_ASYNC);

    //
    // EPWM5 -> myEPWM Pinmux
    //
    GPIO_setPinConfig(myEPWM_EPWMA_PIN_CONFIG);
    GPIO_setPadConfig(myEPWM_EPWMA_GPIO, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(myEPWM_EPWMA_GPIO, GPIO_QUAL_SYNC);

    GPIO_setPinConfig(myEPWM_EPWMB_PIN_CONFIG);
    GPIO_setPadConfig(myEPWM_EPWMB_GPIO, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(myEPWM_EPWMB_GPIO, GPIO_QUAL_SYNC);

    // GPIO13 -> myGPIO0 Pinmux
    GPIO_setPinConfig(GPIO_13_GPIO13);
    // GPIO25 -> myCPU1Toggle_GPIO0 Pinmux
    GPIO_setPinConfig(GPIO_25_GPIO25);
    //
    // PinMux for modules assigned to CPU2
    //

    //
    // SCIB -> mySCIB Pinmux
    //
    GPIO_setPinConfig(mySCIB_SCIRX_PIN_CONFIG);
    GPIO_setPadConfig(mySCIB_SCIRX_GPIO, GPIO_PIN_TYPE_STD | GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(mySCIB_SCIRX_GPIO, GPIO_QUAL_ASYNC);

    GPIO_setPinConfig(mySCIB_SCITX_PIN_CONFIG);
    GPIO_setPadConfig(mySCIB_SCITX_GPIO, GPIO_PIN_TYPE_STD | GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(mySCIB_SCITX_GPIO, GPIO_QUAL_ASYNC);


    }