EnesAyaz / Narrowband-Wideband

0 stars 0 forks source link

[2 MHz] TMS320F Code preperation #2

Closed ozgurgulsuna closed 3 months ago

ozgurgulsuna commented 3 months ago

squeezing all the bits to the limits

ozgurgulsuna commented 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

ozgurgulsuna commented 3 months ago

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.

ozgurgulsuna commented 3 months ago

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.

ozgurgulsuna commented 3 months ago

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.