Tool/software:
Hi,
I have an issue regarding the CLA.
I'm using the CLA to update the PWM registers every cycle. I want it to be as fast as possible to maximize switching frequency.
Before I was calculating the necessary data in the CLA and copied it into the PWM registers. That took about 1.5µs - 2µs.
I decided to transfer the calculations to the CPU so the CLA can concentrate on only updating the registers.
The CPU calculates the data and writes them into shared memory LS1. The CLA then takes these values and writes them into the PWM registers.
I was expecting this to be much faster, but quite the opposite is true. Now the transfer to the PWM register takes 7µs! How is that possible?
This is how the access to the register looked before:
EPWM_setCounterCompareValue(PWM_MODULE_BASE_ADRESS_S1_S2, EPWM_COUNTER_COMPARE_A, CMPA_S1_S2);
with CMPA_S1_S2 being a local variable calculated in the CLA.
And this is how it looks now:
EPWM_setCounterCompareValue(PWM_MODULE_BASE_ADRESS_S1_S2, EPWM_COUNTER_COMPARE_A, cmp_hw_data[cla_current_shadow_index].hw[temp].CMPA_S1_S2);
with cmp_hw_data being a struct located at LS1.
Thanks!
Kind regards,
Milad