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.

TMS320F28379D: CLA-task is to slow due to if-statement

Part Number: TMS320F28379D


Hi,

I am trying to find a efficient way to change CLA tasks without the end of CLA task interrupt. As source for the CLA tasks I am using ePWM interrupts (all are triggered by EPWM1 interrupt). During different sections of the PWM, the CLA tasks shall execute different commands. Therefore, I was trying to give each PWM section an own CLA task to execute. The problem seems to be, that the necessary registers for changing the CLA task is not writeable by the CLA itself. Then I tried to use for all PWM sections together a single Task and execute portion of the code (so that the CLA task 1 owns the code of all other CLA task and depending to the PWM section a different portion of the CLA task 1 is executed). To decide which portion of code will be executed I tried to use if-statements and switch and case statements, but both increasing the execution time of the CLA task strongly. This makes the CLA task execution to long for its use.

My questions are:

Is there a way, to change CLA tasks of the same source dynamically by a CLA task itself without the CPU being involved?

Is there an efficient way to execute different sections of one CLA task, without slowing the CLA down immensely (several 100ns are too long)?

Thanks in advance!

Michael

  • Hi Michael,

    Here are some suggestions:

    1. Have you turned on optimization? The level should be set to at least -O2 and for performance purpose set the preference for speed instead of size.

    2. One other question,  if the PWM is triggering the various CLA tasks, then why does the CLA or C28 need to trigger the task? If software trigger is required then, the C28 side can use the IACK to software trigger multiple tasks at once, the task with the highest priority (lowest number) will be executed first and once that completes the next pending highest priority task will be executed so and and so forth.

    3. Only the C28 can map a function to a CLA task. Dynamically changing this on the C28 will not give good performance.

    4. I am linking the software development guide which has an FAQ section as well. Please refer to this as well.

    https://software-dl.ti.com/C2000/docs/cla_software_dev_guide/index.html

    Thanks,

    Ashwini