Other Parts Discussed in Thread: CONTROLSUITE
I have some problems with reloading PWM frequency and duty cycles without causing any glitches in the signals on a 28032 part.
I have an interrupt that calculates a new frequency and duty cycles for all my PWMs at a 100kHz rate. The interrupt is not run in synchronization with the frequency on the PWMs, and the PWM frequency is varied in a range higher than the interrupt frequency. When I reload the PWM frequency and duty cycles I sometimes observe that some of the signals deviate from the frequency or duty cycle that I reloaded. Since the interrupt frequency and PWM frequency is not synchronized I cannot always guarantee that I reload all the PWMs prior to period or zero (center-aligned counters). I control the period, duty cycle and deadband on eight PWMs and my reload routine requires quite a few cycles.
So my question is how can I guarantee that reloading does not cause glitching? I have worked with MCUs where it was possible to write to a load register (after reloading all the shadow registers) which activated a reload at the next period or zero from shadow. I haven't found a similar mechanism in C2000.
Do any of you have any ideas/experience on how to solve this problem?
Thanks.