> > 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. > Thanx for the help, the timer1 & CCP module thing sounds like what I need. 16bits is what I need :) I would still need to use the lookup table, right? About the PWM, we have a choice of going that way or using DDS(Direct Digital Synthesis: for DDS theory --->http://www.geocities.com/CapeCanaveral/5611/dds.html) Although I will need to port it to a 16C717 or flash version of it, I think PWM is the way to go. BTW: I didnt make myself clear about the accuracy, because it was a thumbsuck...:) But it does actually have to be accurate. esp. the higher Hz. And I need to have the Hz. in integers, ie. (1,2,3,4,5.....399,400) Sorry about that... -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body