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.

C2000WARE: Processing time of driverlib APIs

Expert 7150 points

Part Number: C2000WARE

Tool/software:

Hello Experts,

EPWM functions require high processing load and do not finish in the expected time. After investigating the cause, EPWM_setMinDeadBandDelay() takes about 250ns to 500ns per call.
* We measured with an oscilloscope using GIPOpin.

Is there any data about the processing time of each function?
Are there any processing time-consuming conditions (e.g., calling the same function multiple times) and the workarounds?

The workarounds we are considering are as follows:
- Keep the previous values so as not to reset the settings that have not changed (avoid unnecessary settings).
- Do not use debug settings and do not detect errors.
Please let us know if you have any other workarounds.

The functions that will be used are as follows:
- EPWM_setActionQualifierAction()
- EPWM_setMinDeadBandDelay()
- EPWM_setGlobalLoadOneShotLatch()
- EPWM_setCounterCompareValue()
- EPWM_setPhaseShift()
- EPWM_getTimeBaseCounterValue()
- CMPSS_setRampDirectionHigh()
- CMPSS_setRampReferenceHigh()
- CMPSS_setRampStepHigh()
- CMPSS_enableLatchResetOnPWMSYNCHigh()
- GPIO_writePin()
- GPIO_readPin()
- ADC_isBusy()
- ADC_readResult()

Best regards,
Ken

  • Hi Experts,

    Could you please answer the questions above?

    Best regards,
    Ken

  • Hi, KenF. Could you let me know which device the customer is using and are they seeing this delay for all the APIs that you have mentioned?

    Thanks and Regards,
    Masood

  • Hi Masood,

    Could you let me know which device the customer is using 
    They are using F28P65.

    are they seeing this delay for all the APIs that you have mentioned?
    Not all APIs. They would like to know if there are APIs that take a long time to process in the above APIs.

    Best regards,
    Ken

  • Hi, KenF,

    Summary of our findings are listed below:

    The latency is being added because of the ASSERT conditions and function call and return(function not being inline).

    1) Change to O1 optimization. O1 optimization gives the best results. Function processing time is 20ns.
    2) No optimization+ Assert: It gives the worst result, processing time being 432ns.
    3) No optimization + No Assert: Removed ASSERT statement improves it. Here the time is 190ns.
    4) No optimization + No Assert + No If-else: If further optimization is required, we can create two separate functions without if else. This can further improve the result by 3-4 clock cycles.

    Thanks and regards,
    Masood.