Description: 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.
File list (Check if you may need any files):