1.1 NCO Output and PWM Output Comparison
This section provides the comparison between the NCO module and the traditional PWM module. When using a PWM module to generate a pulse train with variable frequency, use Figure 1 to calculate the PWM frequency.
For an 8-bit Period Register, the value can vary from 0 to 255. With the oscillator clock frequency being fixed, the value in the Period Register determines the frequency of the PWM output. Since the Period Register value forms the denominator in Figure 1, any change in the value of Period Register will not yield a linear variation of FPWM, although the incremental change in the denominator or Period Register value is linear.
Figure 2 illustrates the variation of PWM frequency with respect to a corresponding change in the Period Register value.
The relation between the frequency of the NCO output and the incremental register is provided in Figure 3. From Figure 3, note that FNCO is directly proportional to the increment value, and the accumulator overflow value is always fixed to 220 = 1048576. Therefore, any change in the increment value will yield a very linear variation in the output frequency of the NCO (i.e, FNCO).
This concept illustrates the variation of FNCO with a corresponding change in the increment value, see Figure 4.
Therefore, a better frequency resolution over a wide frequency range can be obtained using the NCO for waveform generation, when compared to the conventional PWM-based approach.