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.
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!