> > Hi Christopher, how many different frequencies > > do you need, and how accurate does each one have > > to be? 20Hz t 400Hz is not a very big range. > > -Roman > > > > Preferably all 380, but in the program I cut it down to 20Hz to 255Hz. with > one value for each frequency. This was so that all the registers were kept as > 8bit . Also about 5% accuracy is alright.....I worked out a table > for each of the values.....just implementing it into the program is a > problem.. :) I hope that helps. Saying "all" 380 makes no sense here, since there are an infinite number of frequencies between 20Hz and 400Hz I guess you mean all the frequencies that happen to come out to integer values when measured in Herz? OK, but that contradicts your 5% accuracy requirement. 400Hz/20Hz is a frequency range of 20:1. At 5% accuracy, this can therefore be covered by Log1.05(20) = 62 different frequencies. You need to decide what your requirements really are. A simple way to produce different tones is using the PWM output as a square wave generator. However, the lowest frequency generated that way is oscillator/16,384. You could use either a slow clock if the PIC has little else to do, or an external divider after the PWM output. Another way is to use timer 1 with a CCP module in compare mode. This gets you a 16 bit period register. Another way is to do it all in software. This is feasible in your case because your frequencies are so low. Even a 12C508A can do this, but I don't know what other features you need to decide which frequency to emit. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- 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