Are there any code examples, suggestions, or guidelines on how I could implement a fixed resolution higher than the frequency used in AN908, AN984, and AN1162?
Microchip does not have a code example with a 0.01 Hz/bit resolution.
AN984 discusses how to generate a sinusoidal waveform. If you wish to create at a 60 Hz modulation frequency with a 0.01 Hz resolution, you need to increase two parameters:
- the number of entries in your sine table (increase your PWM frequency),
- and the number of bits you use as resolution-bits in your PWM sine table pointer.
As an example, a 60 Hz modulation frequency, a 16 KHz PWM (from AN984), and a sine table with 16 KHz/60 Hz results in 267 sine table entries. A 267 entry table requires a 9-bits pointer. Using a standard C language 16-bit pointer allows the upper 9-bits to point to your sine value and the lower 7-bits to be used for frequency resolution bits.
If the table pointer is updated every PWM period (16 KHz) a complete sweep of the sine table would be completed in 127 * (1/16KHz) * 267) = 2.12 seconds. This creates an oscillation frequency of 1/2.12 secs = 0.472 Hz. If you need a 0.01 Hz PWM resolution, you need to alter your sine table size, PWM frequency, and sine table pointer.