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.

TMS320F28374S: The time order in which CLATASKs are executed

Part Number: TMS320F28374S


Tool/software:

Hellow:

I have a question about different CLATASKs as bellow:

I am currently using CLAtask2 and CLAtask3 in my projects,

task2 is forcibly triggered by the IACK instruction after sampling is completed in the ADC interrupt

Task3 Triggered by a PWM frequency higher than the adc interrupt rate.

Part of the CLA configuration is as follows:

Cla1Regs.MCTL.bit.IACKE = 1; 
Cla1Regs.MIER.all = 0x00FF;

PieCtrlRegs.PIEIER11.all = 0xFFFF;

IER |= M_INT11;

DmaClaSrcSelRegs.CLA1TASKSRCSEL1.bit.TASK3 = 38U;  

During debugging, I found that the number of times task3 was triggered was affected by the execution time of task2 tasks.

In the data book I see that CLA tasks cannot be nested, so when one task is executing, the other task has to wait for its completion.

Is that right? If so, does that mean that I can't achieve the desired goal with two CLA tasks, or can I solve the problem in another way.

THANK YOU!

  • Hello,

    This is correct, a CLA task cannot be nested. See the arbitration rules below:

    The lower a task is numerically, the higher its priority is. So, your task 2 (lower frequency task) will take priority over your task 3 (higher frequency task). If the time to execute task 2 is longer than the period of each task 3 trigger, then you will have some overrun, which I believe is what you are seeing. You can monitor the overflow flag for task 3 in the MIOVF.INT3 register field to confirm.

    Just to confirm, both the events triggering the tasks take place in the same clock domain, is that correct? In other words, every time task 2 is triggered, should task 3 also trigger (almost simultaneously)? If you are wanting each task to execute exactly the number of times it is triggered, below are the options that come to mind:

    1. Shorten Task 2 execution to be less than Task 3's trigger period (as you have already mentioned)
    2. If task 3's execution time is relatively short, you could move part of Task 2's execution to a lower priority task (ex. task 4) so that the order of events would be:
      1. If both task 2 and task 3 are triggered simultaneously
        1. task 2 is serviced 
        2. task 4 is triggered at the end of task 2
        3. task 3 is serviced
        4. task 4 is serviced
      2. If task 2 is triggered first
        1. A task 2 is serviced
        2. during task 2 execution, task 3 is triggered
        3. task 4 is triggered at the end of task 2
        4. task 3 is serviced
        5. task 4 is serviced

    It would be helpful to toggle some GPIOs when the tasks are being triggered as well as during their execution to understand the timing better.

    Best Regards,

    Delaney

  • Hello,Delaney

    I think I understand the problem, and the ideas you give for the two solutions. My final solution was to intersperse the high frequency TASK3 into TASK2. This way I just need to split TASK2 into equally spaced parts. Thank you for your reply, which makes me have a better understanding of cla.

    Best regards.

  • Hello,

    Glad I could help Slight smile I will close this thread for now but please feel free to post another one if you run into any more issues.

    Best Regards,

    Delaney