Configure the PWM to use shadow
registers and interrupts.
Configure the PWM frequency for
the desired DAC resolution.
Determine the number of samples
needed to adjust the duty cycle. This subsystem example uses 128 samples stored
in an array.
Cycle through the sample array.
This example increments the array index during the associated ISR, and loads a
new compare value to change the duty cycle of the PWM.
Design a low-pass filter for the
PWM output, to create the analog voltage. This example uses a single pole RC
filter.