On Wed, 28 Nov 2001, Brandon Stewart wrote: > But how do you know how to update your index ( by how much time has > elapsed?) AND most of all, > how the heck to I get the values to create the sine tables to start with?? > Should each consecutive value be the y axis value of the sine wave- where > each value is ...say 50 microsecons apart on the x axis.... or something > like that??/ And if that is true,,, then updating the index would just be > incrementing by one each time??? right??? I am confussed!!!! Brandon, You may quell your confusion by learning how a "phase accumulator" works. This will allow you to vary the rate at which the "index" or "x axis" varies while the table is accessed at a constant rate. For example, if you access the table every 50us, then the frequency of the produced sine wave will be a miminmum if the index is incremented at each access (and rolls over at the end). However, if you skip every other index, you double the sine wave's frequency. The phase accumulator will allow you to automagically adjust the frequency by non-integer amounts as well. If you do not use interpolation, then you'll need a finely gridded sinewave (i.e. the array holding the sinewave needs to be "large") to avoid error. If you use interpolation then you may reduce the size of the table. After wrapping your brain around phase accumulators, take a look at either: http://www.brouhaha.com/~eric/pic/sine.html http://www.dattalo.com/technical/software/pic/picsine.html The first link, Eric Smith's is an easy to use sine table. It'll probably be adequate for your situation. The second link is my sine table and it illustrates the phase accumulators and linear interpolation. Scott -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics