In SX Microcontrollers, SX/B Compiler and SX-Key Tool, James Newton wrote: [url=http://www.sxlist.com/techref/new/letter/news0404.htm ]http://www.sxlist.com/techref/new/letter/news0404.htm [/url] Has an interesting method of making pretty good sine waves in very few cycles. The biggest problem you face is the lack of IO pins and your desire to avoid PWM. The first thing that jumps to mind is to calculate the exact sinewave value (table or the link above) and then just use the top 2 or three bits of it, but accumulate the error from the other bits that are not used and total that into the next value. The result will be that at lower frequencies, you will have some PWM "effect" where one or both of the pins switch on and off rapidly to compensate for the error and at higher frequencies, there will be no time for that and you will get more like a squarewave. Not sure if that makes sense... ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=108186#m108686 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)