Hi all,
I'm currently working with a Piccolo ControlSTICK to get a sin-waveform out of the ePWM module via a lowpass filter.
Because this is my first microcontroller I'm programming I'm not used to the techniques. I'm stuck with setting up an interupt to change the compare value. My thought was to change the CMPA register every overflow of the TBCTR but I can't find a hint on how to do this.
Just putting this code
for(i=0;;i+=1)
{
EPwm1Regs.CMPA.half.CMPA = sinus1[i]; // set compare value
i = i%128; // modulo to endlessly loop after one period
}
in the runtime section doesn't change CMPA every PWM cycle but every now and then even before one cycle is completed. So I'm looking for help on how to make this code to work after one TBCTR overflow.
Many thanks,
Mario