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.

TMS320F28377S: Implementing high speed control loop on CLA

Part Number: TMS320F28377S


My goal is to implement a high speed control loop on the TMS320F28377S microcontroller. The reference input to the controller will be a sine wave. Therefore I have four ime critical tasks:

1)Calculate sine input

2)Run Controller

3)Assign new controller output to PWM

4)Data filtering

Currently I am running tasks 1,3, and 4 in the main CPU ISR and task 2 on the CLA. I'm interested in moving tasks 1 and 3 to the CLA to increase the speed of my control loop. Is it possible to write register values (specifically the CMPA value of the ePWM peripheral) from the CLA. What are the steps involved in this? 

For the reference signal generation, is it possible to run the SGEN module from the CLA. That is what I am currently using in the CPU. If not, what are the differences between the SGEN module and the CLAMath library. It seems like they have similar capabilities, so I could simply use the CLAMath library and write my own signal generation block.

Thanks,
Matt 

  • Hi Matt,

    Matt Bossart said:
    Is it possible to write register values (specifically the CMPA value of the ePWM peripheral) from the CLA. What are the steps involved in this? 

    Yes, this is possible. You will have to include F2837xD_Cla_typedefs.h, followed by the peripheral header file (EPWM). You can write to the CMPA using the bitfields of the appropriate EPWM register, just as you would on the C28x. If its an EALLOW (HW write protected) register you will have to wrap the statement in a MEALLOW/MEDIS (similar to EALLOW/EDIS on the c28x)  block on the CLA. 

    Matt Bossart said:
    For the reference signal generation, is it possible to run the SGEN module from the CLA.

    No, the SGEN was written in C28x assembly and wont work on the CLA. The SGEN was written in fixed point format. The CLA is a floating point engine so you can use the CLA math library to compute the sine but, you will have to work exclusively in floating point format.