Hello,
i am trying to write a Program where a sample is taken which then gets analyzed by the cla and controls the duty cycle of the ePWM module. I am trying to get as fast as possible while maintaining stable execution.
Since i am not an expert at dsp programming i use MATLAB and Simulink to create the code.
At the moment, ePWM1 is used to trigger the SOC of the ADC. The EOC event triggers the CLA and another ISR in the cpu which writes the ADC result to the CPUtoCLA register. The CLA then reads the result from CPUtoCLA register and updates the duty cycle of ePWM3. I guess the mistake here is that the CLA should read the ADC result directly without using the CPUtoCLA register. But other than that it seems like a good solution to me. Could anybody confirm this please?
I think a good advantage would be that the CLA can run in parallel for the first half of the ADC acquistion time so a higher accuracy can be achived without additional delay?
Am i right that the ADC aquisition runs parallel to the cpu so that the cpu is able to execute other tasks? So in the above scenario, with direct access for the CLA to the ADC result, the cpu would only have to deal with the ePWM1 interrupt for SOC of the ADC?
And one last question where i havent found any info yet, is there any advantage or is it even possible to start SOC inside the CLA and wait for the result before further processing? I don´t think this is a good solution but can it be done?
Thank you!
Best Regards
Martin R.