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.

TMS320F280049C: CLA interrupt priority

Part Number: TMS320F280049C
Other Parts Discussed in Thread: TMS320F280049

Tool/software:

I would like to inquire about the interrupt priority in PFC CLA using TMS320F280049 MCU as follows. Please review it.

-. Inquiry content:

    1. Inquiry on setting interrupt priority in CLA

    2. SDFM sensing interrupt priority, how to execute without interference from PWM control interrupt

ttplpfc_clatask.cla

   __attribute__((interrupt))  void Cla1Task1 ( void )  // CLA_TRIGGER_SDFM1DRINT1, frequency 1.2Mhz, execution time 417ns

   __attribute__((interrupt))  void Cla1Task2 ( void )  // CLA_TRIGGER_EPWM3INT, frequency 100khz, execution time 833ns

Thanks and regards,

Jang

  • Hi Jang,

    I am reviewing the thread. I will get back to you shortly.

    Thanks,
    Susmitha

  • Hello Susmitha,

    Could you share your feedback? 

    Thank you for your help in advance. 

    Best regards,

    Yiseo Shin

  • Hi Yiseo,

    I apologize for the delay. CLA tasks already have built-in priorities: 

    "Task 1 has the highest priority and task 8 has the lowest priority. The Type-2 CLA offers the option of setting the lowest priority task, for example, task 8, as a background task that, once triggered, runs continuously until the user either terminates the task or resets the CLA or the device. The remaining tasks, 1 through 7, maintain the priority levels and interrupt the background task when triggered."

    The F28004x has a Type 2 CLA, so you can optionally configure Task 8 as a background task that can nest other tasks inside of it. Similar to interrupts on the C28x, tasks 1-7 will otherwise run to completion and cannot be nested. The CLA will always execute the highest priority task that is both enabled and flagged. It appears in your case that even though the ePWM task is lower priority, it is interfering with the execution of the SDFM task.

    The best way I can think of to resolve this is to split up your ePWM task functionality into 2 (or more) tasks that have shorter execution times than the time between SDFM triggers. For example, task 2 can be triggered by the ePWM and task 3 can be software triggered by task 2. You could have task 2 initially disable task 3 in the MIER register, then re-enable task 3 inside task 1.

    This way even if an ePWM task is executed between SDFM tasks, it will finish execution before it can delay the next SDFM task. Then, after the next SDFM task finishes executing, task 3 is enabled and executed to finish out the needed ePWM functionality.

    Best Regards,

    Delaney

  • Hello Delaney

    Thank you.

    I understand the solution.

    As an additional question, if I use two CLA_TRIGGER_SDFM1DRINT1, CLA_TRIGGER_SDFM1DRINT2 for interleaving current sensing, can I use it without interrupt interference?

    __attribute__((interrupt)) void Cla1Task1 ( void ) // CLA_TRIGGER_SDFM1DRINT1, frequency 1.2Mhz, execution time 417ns

    __attribute__((interrupt)) void Cla1Task2 ( void ) // CLA_TRIGGER_SDFM1DRINT2, frequency 1.2Mhz, execution time 417ns

    Best Regards,

    Jang

  • Hi Jang,

    If you are asking about using just those two tasks exactly out of phase with each other, you will want to make sure the execution time of both is shorter than the period/2 so that one task isn't finishing execution when the next is triggered.

    If you are asking about doing those two tasks also with the ePWM task(s), you will definitely see some interference. I would in that case suggest splitting up the ePWM task and also the SDFM tasks into separate tasks (or shortening the tasks so the execution time is shorter).

    Best Regards,

    Delaney