Other Parts Discussed in Thread: C2000WARE
Hi TI Team,
We are using the 28384S processor and driverlib from C2000Ware_4_01_00_00, and performance of the driverlib seems to be slow.
Background: We are running a very high speed control loop in the multiple 10s of kHz frequency. In previous projects before the introduction of driverlib, we would set the count for duty cycle by directly writing to the EPWM registers themselves like EPwm1Regs.CMPA.all = count;. Now with driverlib we are doing this by calling EPWM_setCounterCompareValue.
Ran a test to set 10 PWM registers like this:
HWREGH(EPWM5_BASE + EPWM_O_CMPA + EPWM_COUNTER_COMPARE_A + 0x1U) = myCountForDutyCycle;
vs.
EPWM_setCounterCompareValue(EPWM5_BASE, EPWM_O_CMPA, myCouuntForDutyCycle);
The 10 direct writes take ~270nsec vs the 10 calls to driverlib function takes ~1.8usec, basically a 6x timing increase.
Are we using the driverlib correctly?
Are we missing something in terms of optimization for this library?