CLKOUT from any PIC will give you the Oscillator Frequency. If you're running on internal oscillator, that's probably going to be 4MHz. Not too handy I guess for you, BUT, if you put it through a divider (eg 4020) you can get either 15.6kHz (divide by 8) or 7.8kHz (divide by nine). That saves you the bother of having to generate a constant frequency. To work out how to set the configuration fuses for CLKOUT on any PIC, read the FAQ...
http://www.picbasic.co.uk/forum/show...=&threadid=543
Because you need to do other things besides generating a tone, you have two additional alternatives over and above what I suggested above...
1. Chose a PIC with Hardware PWM as well as ADC's... 16F872, 16F876 etc immediately spring to mind, but there are heaps of others... the PWM can then be your constant frequency output.
2. Have your 10kHz generated by background interrupts... tricky (but quite achieveable) with PICBasic, especially if you also need to devote significant foreground time to other tasks.
It all depends on your skill level and how you want to proceed. You can do it all in a 12F675... actually, it's such a simple application, you probably could do it in a PIC10F series... but if you're a bit shaky with attempting some creative programing, then go for option 1.
Bookmarks