Introduction - If you have any usage issues, please Google them yourself
Example for the carrier frequency 20KHz, or carrier period is 50μs. DSP crystal 10MHz, internal 4 multiplier, the clock frequency of 40MHz, counting cycle 25ns. Assuming wave frequency modulation by external input (1 ~ 50Hz), and converted into an appropriate format (in this case for Q4 format). Modulation coefficient M is 0 ~ 0.9. Dead time 1.6μs. Delete the smallest pulse width 3μs. The work of the main program is based on input frequency modulation wave calculation of N, 2N and M values.
Packet : 29782184spwm_asm.rar filelist
SPWM_ASM.doc