Part Number: TMS320F280034
Other Parts Discussed in Thread: C2000WARE
We are using the CLA to speed up control law execution with our power electronic system and toggling a GPIO to allow us to profile the execution times on the CLA. We have a system which uses the EPWM1 to trigger an ADC measurement and the EOC for the ADC measurement then triggers the CLA task 1. This all works as expected. Initially I have just toggled an LED in the CLA task in order to check how long things take, here is the CLA task code:-
//-----------------------------------------------------------------------------
//
// Task 1 - PWM control loop
//
// Description: PWM control logic can be implemented here.
//
//-----------------------------------------------------------------------------
__attribute__((interrupt)) void Cla1Task1 ( void )
{
//
// Turn ON Loop1 Profiling GPIO
//
GPIO_writePin(16,1);
loop1_task();
//
// Turn OFF Loop1 Profiling GPIO
//
GPIO_writePin(16,0);
}
The task is triggered every 20us as expected but the toggling of the LED on and off takes ~2us. This seems like a long time, especially for the CLA which should be a very fast peripheral. THE CLA is in direct control of hte GPIO and this is what we get:-

Any idea why turning an LED on and off like this in a CLA task would take so long to execute?

