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.

TMS320F280039: Driverlib bug found in function "EPWM_clearDigitalCompareCaptureStatusFlag"

Part Number: TMS320F280039
Other Parts Discussed in Thread: C2000WARE

I was wondering why my Code does not work when configuring the DigitalCompareCounterCaptureMode to "disableClearMode". In this mode, the user is supposed to reset the capture flag by DriverLib function "EPWM_clearDigitalCompareCaptureStatusFlag".  I was not able to clear the status flag with this function, because the function is implemented wrongly.

Wrong code from Driverlib C2000Ware_6_00_01_00 in file epwm.h:

static inline void
EPWM_clearDigitalCompareCaptureStatusFlag(uint32_t base)
{
    //
    // Check the arguments
    //
    ASSERT(EPWM_isBaseValid(base));

    //
    // Clear digital compare capture status flag
    //
    EALLOW;
    HWREGH(base + EPWM_O_DCCAPCTL) &= ~EPWM_DCCAPCTL_CAPCLR;
    EDIS;
}

 

Correct code:

static inline void
EPWM_clearDigitalCompareCaptureStatusFlag(uint32_t base)
{
    //
    // Check the arguments
    //
    ASSERT(EPWM_isBaseValid(base));

    //
    // Clear digital compare capture status flag
    //
    EALLOW;
    HWREGH(base + EPWM_O_DCCAPCTL) |= EPWM_DCCAPCTL_CAPCLR;
    EDIS;
}

 

Please correct the driverlib in the next release!