Hi Jan, I have just been working on some code that uses a 50:1 clock to cutoff ratio chip and I had to produce a 750Hz - 50000Hz clock to give a cut-off frequency range of 15 - 1000Hz. Very similar to what you want but without the divided by 50 output. I looked at using the CCP module to produce the square wave, as Robert Rolf suggested each CCP interrupt changes the polarity of the next CCP event so the output pin toggles state each time. The problem in my case was I had too much other stuff going on with interrupts and it was going to get all messed up especially at the higher frequencies. I suggest it is probably a very good method if you have no other interrupts enabled. Oh for a multi level interrupts! In the end I used the PWM mode to generate my square wave, switching the prescaler between 1:1, 1:4 and 1:16 to get the best resolution over the full range. Anyway, once you have produced your 500 - 50,000Hz square wave using the CCP, it should be pretty easy in the interrupt routine to increment a variable and when it gets to 50 toggle the state of an output. Hey presto a divided by 50 output. Brent Brown Electronic Design Solutions 16 English Street Hamilton, New Zealand Ph/fax: +64 7 849 0069 Mobile/text: 025 334 069 eMail: brent.brown@clear.net.nz -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body