Closed ozgurgulsuna closed 3 months ago
We had 200 clock cycles in single 1 MHz timer,
our aim is to update the duty cycle within this 200 cycle
After turning on the optimization for main.c the full timer interrupt routine takes about 68 cycles including sine calculation, counting and updating the duty cycle registers.
It has been able to operate with 1 MHz switching frequency with 10 kHz increments (it was presumed to be 5 kHz) and 87.5 kHz fundamental with 50 Hz increments.
The output pwm is jittery since the sine calculations are not synchronized (I guess), but the FFT of the output seems to be accurrate in representing 87.5 kHz and 1.07 MHz.
squeezing all the bits to the limits