On Thursday 08 January 2004 00:27, you wrote: > Actually, Koen's proposal looked like straight PWM; I'm sure the > PICLIST archives contain numerous examples of PWM sine-wave > generation using a quarter-period lookup table. Lancaster's > "magic sine waves" are different in that they cancel harmonics. There is nothing magic about it, but its not PWM either (at least, I use only full on/full off). The thing that makes it look like a sine wave is the integrating amplifier. See the attached PNG: Green the sine I want to achieve, blue the PIC output and red the integrand of the PIC output. In binary the PIC output is 11110110 10010000 00001001 01101111, which is 0xF6, 0xF6 flipped&inverted, 0xF6 inverted, 0xF6 flipped. So you need a quarter-period lookup table of 1 byte. That's not a large table... I hope this makes something clear :o) Koen -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads