Hi,
I am trying to change the configuration of ePWM Action Qualifier Control Registers in between a code execution. Here is the setup:
10kHz interrupt frequency ( 100us time period). My average computation time is about 10us.
Compare values are loaded in shadow mode at CTR = 0.
I basically need the new configuration and values to be executed at the start of the next CTR =0. The shadow mode does this perfectly.
For updating the AQCTLA and AQCTLB I have two options.
a) Update the configuration at the end of computations. This makes sure that the correct configuration is available for the next CTR =0. However the incorrect configuration is updated for the one cycle till the CTR =0 which might cause problems.
b) Update the configuration at the beginning of the next interrupt. By this the correct configuration is updated just past CTR =0. This has incorrect pwm behavior only till the next compare event is reached. However it still might cause problems if the compare event happens before the configuration gets changed.
I was wondering if there is a better approach for this implementation.
Thank you,
Aditya Ghule