Roman Black wrote: > Christopher Tyler wrote: > > > > Hi, I am still an amateur PIC programmer and am having problem writing > > a program. What I am trying to do is write a frequency generator to > > generate pulses between 20 and 400Hz. I am using a 16C57 for the > > program. I am using the RTCC to get the frequency. I tried using a > > lookup table to change frequencies, but it was to big to fit into the > > 1st 256bytes of the page(the simulator gave all sorts of wierd problems) > > and I had to use 2 tables...one for the RTCC and another to change the > > Prescaler.....This was not very effiecient......Can anyone give me any > > ideas on other ways of doing this? > > 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. -Chris > > -- > 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 -- 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