Hi Hank,
There might be also a problem with the code I posted. This is new territory for me as well.
I think that the PWM is one part of the problem, do try it with a R2R resistor DAC on a port and see what happens?
However, don't forget how this works.... The lookup table is 256 entries long. At 500Hz output frequency you would need an interrupt rate of 500*256=128kHz to "hit" every entry in the table (thus producing the highest possible quality output). As the frequency goes up more and more of the table entries are skipped, you might "hit" entry 5, 75, 145, 205, 29, 9, 169, 239, 53, 123,193, 7 and so on. Plotting those values and drawing a straight line between them isn't going to produce a very pretty sine-wave.
I suck at filter desing and analog stuff (too) so I can't help much with the filter desing.
/Henrik.
Bookmarks