On Wed, 19 May 1999, Lance Allen wrote: > Has anyone here used the DDS method to generate sinewaves with a PIC? > We used a 16c74 running at 8MHz to generate 1Hz to 2000Hz in 1 Hz > steps. Great for the original application but now we want to ramp up > to 20kHz in 1 Hz steps but we just cant squeeze enough for 20kHz out > of the code (now a 16MHz xtal). Has anyone done this? Some clues for > tight code?... please. Have you seen: http://www.brouhaha.com/~eric/pic/sine.html Or http://www.interstice.com/~sdattalo/technical/software/pic/picsine.html The former implementation (Eric Smith's) is faster, while the latter (mine) has more frequency resolution. A DDS implementation with my routine would require at most 80 cycles (and I know a way to reduce it by 20) and would easily generate a 20kHz sine wave with milli-Hz (or perhaps ten's of) resolution. Eric's routine would probably allow generate a 150kHz sine wave, but with less resolution (frequency that is). Your Choice... Scott