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.

TMS320F28388D: Disable and re-enable CLA task at run-time

Part Number: TMS320F28388D


Hi,

I would like to know how to stop a CLA task and to re-enable it properly. It's critical because in that task, I compute the control loop of my converter.

Here is my application:

ePWM1 generates a pulse on SOCA

This pulse triggers SOC0

EOC0 triggers ADCAINT1

ADCAINT1 triggers CLA Task 1 

Problem: when a special event occurs (as a protection for example), I want to stop computing task 1. Untill know, I used the bit SOCAEN of ETSEL register from ePwm1Regs to stop the pulse that triggers SOC0.

But when I re-enable it, CLA task 1 is first computed asynchronously with ePWM1 module => and after this strange phenomenon it goes back to normal operation.

You can see it below, the blue curve shows task 1 computation by toggling an I/O at the beginning and at the end of task 1. And the other curve is ePWM1 output. I don't expect the first asynchronous blue pule.

So is there a way to do it properly ? I have the same question for CPU interrupt, what's the proper way to stop an interrupt and to re-enable it ?

Thank you,

Adrien

  • I've just tried the same thing (to stop and re-enable interrupts using the SOCEN bit, I also tried to use PIER register to disable the interrupt) using the CPU instead of the CLA and I get the same behavior. The first 2 pulses are not synchronous with ePWM1 module. So what I need is a proper way to stop and re-enable interrupts for CPU (or tasks for CLA) ? There is no clear answer to do this in the TRM.

  • Hi Adrien,

    Sorry for the delayed reply. I am reaching out to the experts on this topic and will get back to you soon.

    Thanks,

    Ashwini

  • Hi Adrien,

    One suggestion - if the goal is to disable/enable the CLA task, one other option is:

    1. Disable Task

    Clear the INT1 bit in MIER Interrupt Enable register to block the task.

    2. Re-enable Task

    Clear pending interrupts flag using MICLR. Then enable the task using MIER. 

    Let me know if you have any questions.

    Thanks,

    Ashwini

  • Hi,

    Thanks for your reply. My solution for the moment is not to disable tasks anymore and I manage it by software using flags. It takes more resources but I think it's more robust than enabling/disabling tasks while program is running. When I'll have time, I'll try to clear the pending interrupt flag as you mentioned before enabling the task. Maybe that's the issue.

    Adrien